home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / documentation / documents / a252eur3 < prev    next >
Text File  |  1999-04-27  |  53KB  |  1,096 lines

  1.                                                |
  2.  EEEEEEEE                        K          A  |
  3.  EE                  R R    EE   K         AA  | The BITS ArcSIG 
  4.  EE         U   U   RR RR  E  E  K K      A A  | Newsletter
  5.  EEEEEEE    U   U   R      EEEE  KK      AA A  |
  6.  EE         U   U   R      E     K K    A  AA  | Issue #03
  7.  EEEEEEEE    UUUU   R       EEE  K  K  A    A  |
  8.                                                | Compiled & linked by Dave
  9. --------------------------------------------------------------------------
  10.  
  11. STOP PRESS: We're now in circulation on Monochrome, the multi-user "everything"
  12. system at City University; TNX*1.0E6, Pelago!
  13.  
  14.  In its current incarnation, which has been running for over a year now, Mono
  15. has grown into a highly sophisticated messaging and bulletin board system,
  16. covering just about every topic under the sun (and, of course, Suns!). Acorn
  17. machines have their own dedicated section, known as A-Corner, which has a great
  18. deal of technical info available, sections to post questions, and occasionally
  19. some information kindly leaked by Acorn themselves concerning future
  20. developments...
  21.  You can find Monochrome at paddington.city.ac.uk, UID mono, password mono.
  22.  
  23. Editorial
  24. ~~~~~~~~
  25.          To be quite frank, I really can't believe how EurekA's taken off. This
  26. is only the third issue, and we already have, via Monochrome, an international
  27. circulation...
  28.  In addition, as more people have got in touch with me and given me ideas as to
  29. what _really_ goes on inside these machines, we've become more technical.
  30. Thanks here are due to tony Duell, Rob Wheeler & Graham Willmott, all of whom
  31. have helped make EurekA what it is. For two released issues, we're doing OK.
  32. Indeed, this issue is probably the most technical of the three so far; if any
  33. of you have ever wanted to build a podule, I've detailed everything I can dig
  34. up on the subject in this issue. This may have something to do with my latest
  35. plans to interface an Arc to a Transputer array, but then again....:-)
  36.  
  37. Now we're live on mono, of course, I hope that those of you who run user groups
  38. which support the Arc will get in touch and tell us what _you're_ up to. 
  39.  
  40.  Recently, especially from the hardware point of view, I've started to have
  41. problems making sure that my articles are relevant to all Archimedes systems;
  42. for instance, in order to complete the podule article, I had to borrow an A3000
  43. tech ref (thanks, Tom) to get the mini-podule pinouts. Needless to say, I was
  44. shocked to see the absence of a +12V and -5V line... what are Acorn playing at?
  45. It worries me to think that this acceptance of differing standards for
  46. expansion cards may eventually result in Arc hardware compatibility becoming as
  47. big a farce as PC hardware compatibility. Please, Acorn, don't let this be the
  48. start of a trend....
  49.  
  50. Dave Walker, ArcSIG Leader (phdw@siva.bris.ac.uk Monochrome ID gabriel)
  51.  
  52. PS. Just noticed, while reading the ARM data book... the designers at
  53. Acorn/VLSI have a very dry sense of humour. The base series number for the ARM
  54. chipset is 86000... reverse the first two digits, and won't Motorola be pleased!
  55.  
  56. *OBEY !RUN
  57. ~~~~~~~~~
  58.  
  59. SWI "OS_GenerateError"
  60. ----------------------
  61.                       Many thanks for the feedback on last issue's Assembler
  62. Programmer's Pocket Guide; in addition to several typos, I managed to get one
  63. important fact wrong and forget to document two very obvious and very useful
  64. mnemonics. Thanks to Graham Willmott and KJB1003 (Kevin Bracey) for spotting
  65. this lot.
  66.  
  67. First of all, the errors. In the documentation of the floating point system,
  68. R0-R7 should be F0-F7. In the memory map, I forgot to document the fact that
  69. the RAM filing system maps in at &1000000. Also, in the Floating point
  70. again, the suffix refers to conditional execution, whereas the precision
  71. is chosen from:
  72. ----------------------------------------------------------------------------
  73.  
  74.      IEEE Single Precision (S)
  75.      IEEE Double Precision (D)
  76.      Double Extended       (E)
  77.      Precision
  78.      BCD Packed Decimal    (P)
  79.  
  80. The rounding mode is then chosen from:
  81.  
  82.      Round to nearest      (no mnemonic)
  83.      Round to + infinity   (P)
  84.      Round to - infinity   (M)
  85.      Round to Zero         (Z)
  86. ------------------------------------------------------------------------------
  87.  Apologies to all concerned if my nomenclature was insufficiently clear.
  88.  
  89.  Second, the mnemonics. I somehow missed documenting the LDR and STR
  90. instructions; don't ask me how, I guess I must have been rowing. Here they 
  91. are, described in Pocket Ref. format. However, as this gives me the chance to
  92. cover the various addressing modes available, I think they can go in a separate
  93. section and you can cross-reference to it within the opcode mnemonic list.
  94. ------------------------------------------------------------------------------
  95.  
  96. Addressing Modes in ARM Assembler
  97. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  98.                                  As R15 has a 26-bit wide address field, it is
  99. obviously not possible to fit an absolute address description into a 32 bit
  100. instruction which also has to contain the opcode, conditional(s) and operand
  101. registers. Hence, when specifying absolute addresses in ARM code, it is
  102. necessary to use indirection.
  103.  
  104. The basic operands to load and store single-word registers are LDR and STR. LDR
  105. will be used in the examples illustrating addressing modes.
  106.  
  107. Pre-Indexed Addressing
  108. ----------------------
  109.  
  110.  Syntax: LDR <suffix><destination>, [<base>{,<offset>}]
  111.  
  112.          <base> is a simple register.
  113.          <offset> is an optional quantity such that the memory word loaded 
  114.          into <destination> is the contents of address (base+offset).
  115.          <offset> may be a simple register, a shifted register or an immediate
  116.          constant in the range -4095 to +4095.
  117.  
  118.  Write-back is also implemented, so the instruction
  119.  
  120. LDR R0,[R3,R8,LSL#2]  has the effect Load R0 with the contents of (R3+4*R8) and
  121.                       set R3=R3+4*R8.
  122.  
  123. Post-Indexed Addressing
  124. -----------------------
  125.  
  126. Syntax: LDR <suffix><destination> [<base>],<offset>
  127.  
  128.  The contents of <base> are taken as the address to load <destination> from,
  129. and then the contents of <offset> are added to it. Write-back is implicit.
  130.  
  131. Hence:
  132.  
  133. LDR R8,[R2],R5,LSL#4   ; Load R8 from address R2: R2=R2+16*R5.
  134.                                   
  135. ------------------------------------------------------------------------------
  136.  In addition, although I have seen no information as to changes in the segment
  137. of proprietary Acorn code included to re-sync the registers, an official
  138. statement has been made that the conditional extender NV is not to be used in
  139. future software, as Acorn plan to reassign the current NV bit pattern to
  140. another instruction. However, MOV R0,R0 should provide an equally effective
  141. no-op.
  142.  
  143. APPEND
  144. ------ 
  145.       KJB1003, a student at Cambridge (this newsletter is spreading!), also
  146. suggested that I add documentation about the OPT assembly directive. Here goes;
  147. update your copies of the Pocket Reference, everyone, as I expect the CC would
  148. be unamused if I crunch as much net.bandwidth as last time...
  149. ------------------------------------------------------------------------------
  150. This bit can be included under:
  151. Register Assignment, Parameter Passing and Assembler Directives.
  152.  
  153.  OPT <var> is a pseudo-opcode which directs the assembler to perform specific
  154.            functions, and when used, is always the first operator after the [.
  155.            When OPT is not explicitly specified, the default value is set to 3.
  156.  
  157.            <var> is an integer, or variable containing an integer, which has
  158.            bits flagged to produce the following effects:
  159.  
  160. Bit 0   clear = No listing produced
  161.           set = Listing produced
  162. Bit 1   clear = No errors reported
  163.           set = Errors reported
  164. Bit 2   clear = No offset assembly
  165.           set = Offset assembly performed
  166. Bit 3   clear = No range check performed
  167.           set = Range check performed (via L%)
  168.  
  169.  The "no errors" bit is necessary for the first pass of a multi-pass assembly
  170. (ie where forward-referenced labels have been used).
  171. ------------------------------------------------------------------------------
  172. Digging through the PRMs, I also found the mnemonic to opcode conversion tables
  173. for the floating point system. However, the latest news from our erstwhile BITS
  174. Librarian (Rob Wheeler) is that he has some PD software available which allows
  175. the FP system to be used in assembler. If you'd like a copy, contact him direct
  176. as se1043@seqa.bris.ac.uk.
  177. ------------------------------------------------------------------------------
  178.  
  179. Unary Operations
  180. ----------------
  181.  
  182. Command format  <unaryop><suffix><precision>{rounding mode} <Fdest>,(<Fop> #val)
  183.  
  184.  Mnemonic      Effect               Calculation           Opcode
  185.  --------      ------               -----------           ------
  186.    MVF         Move                   Fdest=Fop            00001
  187.    MNF         Move negated           Fdest=-Fop           00011
  188.    ABS         Absolute value         Fdest=ABS(Fop)       00101
  189.    RND         Round to integer       Fdest=INT(Fop)       00111
  190.    SQT         Square root            Fdest=SQR(Fop)       01001
  191.    LOG         Log to base #10d       Fdest=LOG(Fop)       01011
  192.    LGN         Natural log            Fdest=LN(Fop)        01101
  193.    EXP         Exponent               Fdest=EXP(Fop)       01111
  194.    SIN         Obvious                Fdest=SIN(Fop)       10001
  195.    COS         Equally obvious        Fdest=COS(Fop)       10011
  196.    TAN         Ditto                  Fdest=TAN(Fop)       10101
  197.    ASN         ]                      Fdest=ASN(Fop)       10111
  198.    ACS         ] (Obvious)^-1         Fdest=ACS(Fop)       11001
  199.    ATN         ]                      Fdest=ATN(Fop)       11011
  200.  
  201. Binary Operations
  202. -----------------
  203.                 
  204. Command format:  
  205.  
  206. <binaryop><suffix><precision>{rounding mode} <Fdest>,<Fop1>,(<Fop2> #value)
  207.  
  208.  Mnemonic      Effect               Calculation           Opcode
  209.  --------      ------               -----------           ------
  210.  
  211.    ADF         Add                    Fdest=Fop1+Fop2      00000
  212.    MUF         Multiply               Fdest=Fop1*Fop2      00010
  213.    SUB         subtract               Fdest=Fop1-Fop2      00100
  214.    RSF         Reverse subtract       Fdest=Fop2-Fop1      00110
  215.    DVF         Divide                 Fdest=Fop1/Fop2      01000
  216.    RDF         Reverse divide         Fdest=Fop2/Fop1      01010
  217.    POW         Raise to power         Fdest=Fop1^Fop2      01100
  218.    RPW         Reverse raise...       Fdest=Fop2^Fop1      01110
  219.    RMF         Remainder              Fdest=Fop1 MOD Fop2  10000
  220.    FML         Fast multiply          Fdest=Fop1*Fop2      10010
  221.    FDV         Fast divide            Fdest=Fop1/Fop2      10100
  222.    FRD         Fast reverse divide    Fdest=Fop2/Fop1      10110
  223.    POL         Polar angle            Fdest=angle between  11000
  224.                                             Fop1 and Fop2
  225.  
  226.  Note that the "fast" instructions only produce single-figure accuracy,
  227. regardless of the precision specified in the mnemonic.
  228.  
  229. Also, more useful entry points, to be appended to your Pocket Programmer's
  230. Reference (perhaps I should do a Mk. II memory map sometime, with all these
  231. locations listed) for those of you who wish to access the I/O devices in your
  232. Arcs directly.
  233.  
  234. Cycle Type   Base Address           Device              Device IC
  235. ----------   ------------           ------              ---------
  236.  
  237.   Fast         &3310000     Floppy disc controller       WD1772
  238.   Sync         &33A0000        Econet controller          6854
  239.   Sync         &33B0000        Serial controller          6551
  240.   Fast         &3350000          Printer data             LS374
  241.  
  242.  As you'll see later, I'm doing some work on podules this issue. Here's some
  243. useful podule entry points to know... however, including all of these in your
  244. Pocket Reference means you'll either have bad eyesight shortly from reading the
  245. small print, or you already have a very large pocket.
  246.  
  247.   Fast         &3360000          Podule IRQ register       
  248.   Fast         &3360004          Podule IRQ mask           
  249.                                    register
  250.   Slow         &3270000          Extended external
  251.                                    podule space
  252.  
  253.   Slow         &3240000          Podule 0
  254.   Med          &32C0000          Podule 0
  255.   Fast         &3340000          Podule 0
  256.   Sync         &33C0000          Podule 0
  257.  
  258.   Slow         &3244000          Podule 1
  259.   Med          &32C4000          Podule 1
  260.   Fast         &3344000          Podule 1
  261.   Sync         &33C4000          Podule 1
  262.  
  263.   Slow         &3248000          Podule 2
  264.   Med          &32C8000          Podule 2
  265.   Fast         &3348000          Podule 2
  266.   Sync         &33C8000          Podule 2
  267.  
  268.   Slow         &324C000          Podule 3
  269.   Med          &32CC000          Podule 3
  270.   Fast         &334C000          Podule 3
  271.   Sync         &33CC000          Podule 3
  272.  
  273.  Although these are the current lookup addresses, Acorn make no guarantees that
  274. they will stay here in future incarnations of the OS. Writing to and reading
  275. from these addresses is currently the fastest way to interact with a podule,
  276. but for future compatibility, it's safer to use the SWIs detailed later this
  277. issue. Alternatively, build your own lookup table using SWI
  278. "Podule_HardwareAddress", or (from what I've heard about it) take a look at
  279. !StrongHlp.
  280.  
  281.  Please keep me posted with any errors you find in the Pocket Programmer's
  282. Reference, along with your wishlists of features to be covered in future.
  283.  
  284. Marginal Hacks (Part 11 of 1<<31)
  285. --------------
  286.  
  287. Differences between the A3010 and A3020: tony Duell
  288. ---------------------------------------
  289.  
  290. These 2 machines, based on the ARM250 (integrated ARM CPU, MEMC, IOC, VIDC -
  291. all on one chip) are very similar. In fact the main differences are 
  292.  
  293.   A3010 (designed as a home computer)
  294.   Joystick port, RF modulator, No hard disk, No network, Green function keys,
  295.    Silly label on the back (No, not a DEC 'Silly Sticker' :-))
  296.  
  297.   A3020 (designed as a replacement for the BBC micro in education)
  298.   Network option, IDE hard disk internally, Red function keys.
  299.  
  300. Well, they are actually built on the same PCB, and you can in principle add
  301. options to either machine that are only present in the other one. One thing
  302. that is worth knowing (all reviews so far have said that it is impossible), is
  303. that the A3010's disk controller is capable of controlling an IDE hard disk -
  304. it's just that the socket is not fitted. It is possible to add it, and thus
  305. save your single mini-podule slot for something else.
  306.   If you want to try this, you should obtain the technical reference manual
  307. from Acorn (I don't have it), as there _may_ be decoupling capacitors and
  308. similar to add as well.
  309.  
  310. Identifying monitor type on an A540; where to look
  311. --------------------------------------------------
  312.                                                   The 540 is unique among
  313. old-style (pre-A5000) Arcs in that it can accept a very wide range of monitors,
  314. and has a VIDC Accelerator built in. For those of you who didn't know or hadn't
  315. worked it out, VIDC will clock at several speeds, dependent on the monitor type
  316. configured. The video sync polarity and VIDC clock speed are stored in a
  317. write-only register at  &3350048, with the bit patterns
  318.  
  319.  Clock Speed      Bit 1   Bit 0             Sync Polarity     Bit 3   Bit 2
  320.  -----------      -----   -----             -------------     -----   -----
  321.                                                V     H
  322.     24 MHz          0       0                  +     +          0       0
  323. 25.175 MHz          0       1                  +     -          0       1
  324.     36 MHz          1       0                  -     +          1       0
  325.   Reserved          1       1                  -     -          1       1
  326.  
  327. OK, so this is a write-only register... maybe we'll just have to convince MEMC
  328. otherwise!
  329.  
  330. Sound Improvements
  331. ------------------
  332.                   On implementing the Arc sound system, Acorn added a number of
  333. low-pass filters before the headphone output; whether they didn't envisage
  334. people connecting this output to anything other than a pair if headphones I
  335. don't know, but it sounds pretty awful through my hi-fi. Needless to say, this
  336. is no fault of my hi-fi!
  337.  Fortunately, these filters can be bypassed by rewiring a socket on the
  338. motherboard. PLEASE NOTE: After this modification, the headphone socket signal
  339. will have insufficient power to drive a pair of headphones. It may, however, be
  340. fed into a stereo amplifier.
  341.  
  342. Find LK9. (Likely to be a different designation on a 300/400/5000/30n0 machine;
  343. there is _NO_ equivalent socket on an A3000; the job would require taking
  344. wiretaps direct off ICs. Mail me if you want to know which ones...) It's a 10
  345. pin in-line, and should be close to the headphone socket at the rear of the
  346. machine. In release configuration, the left headphone channel comes off pin 3,
  347. and the right channel comes off pin 7. The 'raw' (unfiltered) left and right
  348. channels come from pins 1 and 9 respectively; 2,4,6,8 and 10 are  ground, and 5
  349. is an auxiliary input.
  350.  
  351. There is a possibility that this will cause the headphone amplification stages
  352. to go into oscillation; although this will do no harm to the computer, it could
  353. well ruin the sound quality (but not your hi-fi...).
  354.  However, I haven't heard of this happening yet...
  355.  
  356. 1 2 3 Testing...
  357. ----------------
  358.                 On the A540 (I don't know whether it's in the 400 or 5000
  359. series; it certainly isn't in the 300 or 3000 series, and I wouldn't expect it
  360. to be in the 30n0 series) Acorn included a socket for their own test hardware.
  361. This socket, LK4, has the pinout
  362.  
  363. P1  +5V
  364. P2  D<0>     (Lowest bit of Data bus)
  365. P3  La<21>   (Bit 21 of Logical Address bus.... should go high when accessing
  366.               the high ROM area)
  367. P4  RomCS    (ROM Select)
  368. P5  Rst      (System Reset)
  369. P6  0V
  370.  
  371. Graham tells me (I haven't looked here yet) that RISC OS 3.10 and 3.00 have an
  372. extensive self-test routine branched to at the start of ROM space (&3800000),
  373. which puts all sorts of bits on the bus, checks the integrity of ROM and RAM,
  374. and finds out how much RAM your machine has and which ARM is present.
  375.  If anyone can find a use for this, let me know!
  376.  
  377. Features
  378. ~~~~~~~
  379.  
  380. A Chip off the Old !block: ARM3 and ARM610 compared; ARM7 rumours
  381. -------------------------
  382.                           Recently (OK, not _too_ recently!) the ARM family was
  383. joined by a new member; the 610. This processor has received a great deal of
  384. speculative press, having been selected as the processor for Apple's Newton
  385. Palmtop machine. Also, Acorn forums on the net have been rife with rumours of
  386. yet another, incredibly high-end pair of ARMs, so far designated (for want of a
  387. better name) ARM 7 and ARM 8.
  388.  
  389. To add a little light relief to this issue of EurekA, I thought I'd distil what
  390. I've heard, and compare it to our friend the ARM 3; not only does this make a
  391. change from reading about my perennial wars with the PCM, but I haven't much
  392. choice; I deleted my emulator last week. Not from disgust at MS DOS, I hasten
  393. to add (although it was more than a passing contributor to the reasons why it
  394. didn't get reinstated!) but because of the dreaded "disc full" message. From my
  395. internal 120Mb hard drive (the 100Mb external hard drive being reserved for
  396. UNIX). One vaped PC partition and some rearranging later, I'm now happy with
  397. 45Mb free on it, and the partition ain't coming back. :-)
  398.  
  399.  Anyhow, to work.
  400.  
  401.   The ARM 610 is the first implementation of the ARM 6 macrocell, released
  402. jointly with the ARM 60 (an unaugmented ARM 600 package, pin-compatible with
  403. the ARM 2). I don't think an ARM 600 was ever released, although it was
  404. designed. Not surprisingly, it was designed to look like an ARM 3.
  405.  
  406.  The ARM 6 cell is built out of fully static CMOS, which means that the clock
  407. signal  to it can be turned off without losing information on the chip's state
  408. or the data contained therein. As the macro is based on micron-scale data
  409. paths, the final cell is sufficiently small to be included  wholesale on a
  410. custom wafer of standard size, (2.8 mm^2) with physical room to spare for cache,
  411. controllers etc. Indeed, the cell is already in use as an embedded controller
  412. in some of the latest laser printers.
  413.  
  414. At most levels, the 610 is instruction-compatible with the ARM 3. However, the
  415. address space has been expanded to the full 32 bits possible (the processor
  416. flags & status mode bits have been moved to a new register, making 17 registers
  417. visible), and an extra pair of data lines (PROG32 and DATA32) which switch
  418. between full 32 bit instruction and data paths, and the 26 bit versions for ARM
  419. 1,2 & 3 compatibility. (Does anyone out there have an old ARM 1 evaluation
  420. system? If so, please let me know!) Also note that BYTE (second-sourcing the
  421. relevant bits of a December 1991 article, here) seem to have it wrong again...
  422. the data path (even the coprocessor data path) is the full 32 bits wide! My
  423. print set says so!
  424.  
  425.  In addition, there is a status line to switch the processor addressing mode
  426. between big and little-endian. This makes the ARM 610 compatible with EVERYBODY
  427. else!
  428.  
  429.  Virtual memory drivers have been implemented in hardware; instead of the old
  430. address exception error, the system now calls the drive controller via a
  431. software service routine to load the missing page into RAM, and the specific
  432. instruction into cache. These exceptions may be handled in both supervisor and
  433. user mode.
  434.  
  435.  Recalling the Pre-Fetch and Data-Abort vectors in Archimedes zero page (see
  436. EurekA #2), it's interesting to see that on the 610, there are moves towards
  437. delaying the last possible abort until even later in the cycle. This would
  438. result in far less strain on the cache, but require extra garbage collection.
  439. The feature is not implemented on the ARM 6; expect it on the ARM 8. However, a
  440. LATEABT signal has been added, which when high, will simulate this extra
  441. feature.
  442.  
  443.  Pages, and indeed page size (4-64K, variable) is controlled by the on-chip
  444. MMU. Virtual and real page numbers are stored in a cached translation lookaside
  445. buffer (TLB), which also stores memory protection level data. When accessing a
  446. page, the processor checks to see if the TLB contains a translation from the
  447. virtual address to a real address in RAM; if so, the physical address is
  448. output.
  449.  
  450. However, the interface to this (fairly conventional) memory model is based on
  451. an object-oriented user view of memory. If the page is not in RAM, the MMU
  452. allocates an index into the translation table, ofset by an address held in the
  453. translation table base register.
  454.  If the table entry is for a section (number of pages), the index will contain
  455. the section's base address, which may be combined with a virtual-address index
  456. to give a physical address to load the data at.
  457.  If the entry is for a single page, the index contains a pointer to the page
  458. table, where the address can be found.
  459.  
  460.  One of the nicest tricks used in the new ARM is that lists of pointers are
  461. terminated by dummy instructions not on word boundaries. As the MMU traps
  462. accesses to all such words, the end of a list may be detected by intercepting
  463. the error raised by the MMU.
  464.  
  465.  Access permissions are mapped separately from the virtual addresses, and
  466. can be manipulated in isolation. Page faults and permission faults are also
  467. handled by independent hardware. Access permissions are held in a 'domain
  468. space,' which is a contiguous arbitrary-sized block of pages. The chip supports
  469. up to 16 of these domains, each of which may be assigned an access level by the
  470. task managing it. Tasks are divided into clients, which may be denied access to
  471. a domain if the relevant access bits are set, and managers, which can always 
  472. grab a domain directly. Each task may (and usually will) use multiple domains.
  473.  
  474.  The trouble with this kind of management is that it generates huge amount of
  475. garbage, as tasks claim and release domains. It is predicted that  the ARM 610
  476. will support (not had the specs on this) a garbage collection program, running
  477. concurrently with whatever other task are present, which will release areas of
  478. memory which were claimed by a task since terminated by changing the
  479. permissions; I'm still not sure that this wouldn't leave some tasks stranded,
  480. though. Further info on this would be appreciated.
  481.  
  482.  Rumours of the ARMs 7 and 8 exist, and it is believed that a prototype ARM 8
  483. (probably built from ECL) has been run on Acorn's testbeds. Both ICs are said
  484. to be fully parallel-capable, and rumour has it that the ARM 8 is capable of
  485. asynchronous processing (although the current Arcs canbe considered asynch, as
  486. each of the four main ICs runs at a different speed; I'd be interested to know
  487. how an ARM 250 clocks the various parts of its mega-wafer). If this is so, an
  488. Archimedes n (where n is large!) would basically put mainframe processing power
  489. squarely on the desk. Thank you, Intel, and goodnight.
  490.  
  491.  
  492. A CALL to ARMs
  493. --------------
  494.               In my humble opinion, it's about time that BITS produced
  495. something useful, other than the occasional Newsletter. The HP SIG already has
  496. a serial to IR converter, so I thought some Archimedes hardware projects
  497. wouldn't go amiss, especially as the podule interface seems easy enough to
  498. design for. In order to cater for control of the final boards, I'm documenting
  499. the podule control SWIs later in this issue.
  500.  
  501. Ideas so far: Archimedes to Transputer card; offload some of the processing
  502.               time from your ARM to a (or more than one!) T800(s). 
  503.               I'm looking into this at the moment; hence the podule stuff in
  504.               this issue!
  505.  
  506.               For those of you on Monochrome (you know who you are...) who have
  507.               a spare ARM and RISC OS 2 ROM set, here's an idea. The ARM was
  508.               first sprung on the world in the form of the ARM 1 evaluation
  509.               system, which ran as a second processor on an Acorn Proton. This
  510.               means that, at a pinch, an ARM Tube is possible, although it may
  511.               be less than 32 bits wide. If it can be coaxed into giving us 16
  512.               bits, how about building an ARM second processor and going for
  513.               true multiprocessing? I'd be most impressed if anyone out there
  514.               has the ARM 1 system schematic...
  515.  
  516.  
  517.               I/O Podule; catch up with those interfaces on the 8 bit machines.
  518.               If anyone out there reads Elektor, check out the July / August
  519.               1991 issue; John Kortink (of !Translator, !Creator and !AIM fame)
  520.               supplies the circiut diagrams and PCB masks for a cheap black and
  521.               white video digitiser, which includes an I2C interface...
  522.  
  523.               Econet upgrade; to be ported from the BBC Master document set.
  524.               See if it will run on an existing network.
  525.  
  526.               FPA: Acorn haven't released it, & I don't know why. However, we
  527.               have the FPE, which is a full software model of the FPA, and the
  528.               pinout of the FPA socket. If the worst comes to the worst, is
  529.               anyone prepared to try out a pin-remapped ARM 2 and assorted 
  530.               interfacing chippery running the FPE (from an old RISC OS 2 ROM 
  531.               set) in the FPA socket?
  532.  
  533.               System clock modification; I heard from Rob Wheeler, who was at
  534.               the BAU show, that Aleph One had a 540 which they had reclocked 
  535.               using a voltage controlled oscillator, just to see how fast it
  536.               would go. Rob believes it ran stably at 50MHz, which should put
  537.               the machine (assuming basic 13.5 MIPS out of a 27 MHz ARM 3) up
  538.               to about 20 MIPS, without an FPA. If you have any ideas
  539.               concerning motherboard mods to do this (ie loading the RISC OS
  540.               ROMs into fast RAM on system reset so they don't have to keep 
  541.               up, and indeed if 70ns on the RAM is fast enough), or if you saw
  542.               more than Rob did, please let me know. 
  543.  
  544. For your information, a feasible Transputer interface has already been built on
  545. a podule, and is going into testing, now that my old 310 is down at the lab.
  546. I'll have a T425 (wish I could afford a T800...) or several hung off the back
  547. of my 540 yet!
  548.  
  549.       
  550. Down to the Metal: Of Acorn, Inmos and non-von Neumann machines....
  551. -----------------
  552.                  As those of you who've talked to me recently will know, I've
  553. gone just about sufficiently mad to decide that interfacing my Arc(s) to a
  554. Transputer system would not only be a serious hack and a major factor in 
  555. speeding my machines up (I have had my 540 overloaded before now...), but that
  556. it shouldn't be too difficult a job. Also (this shows I've lost any remaining 
  557. sanity!) I think OCCAM is cute.
  558.  
  559.  Anyhow. After a long, hard look at the Transputer Data Book, it appears that
  560. the IC for the interfacing job is the IMS CO11.
  561.  Basically, transputers are very simple entities to treat as black boxes. They
  562. clock universally off a 5MHz signal, which does not have to be in synch on all
  563. the chips (no worries about board size here!), and communicate with eachother
  564. via a pair of unidirectional serial links. The external clock is stepped up
  565. inside the chip using a phase-locked loop system, which is regulated by an
  566. external  high-quality capacitor. However (implementers beware) they're very
  567. tricky to start up; like all CMOS devices, they have to be soft-started,
  568. otherwise they'll hang and eventually blow.
  569.  
  570.  The CO11 is designed with two purposes in mind; in operating mode 1 it can be
  571. used as a peripheral interface on a transputer array, and in mode 2 it can act
  572. as an interface between the transputer serial system and an 8-bit 
  573. microcomputer bus. Needless to say, I'll be configuring it in mode 2. Although
  574. the CO11 is only capable of handling 8 bit data, it's enough to handle the
  575. transputer instruction set; a more ambitious project could be to run a pair of
  576. CO11s off the podule bus, interfaced to two separate transputer networks...
  577. However, even I'm not that mad yet!
  578.  
  579.  
  580.                    -----------
  581.     Linkout   1  [|     U     |]  28 VCC
  582.      Linkin   2  [|           |]  27 CapMinus
  583.       RnotW   3  [|           |]  26 InputInt
  584.   Outputint   4  [|           |]  25 notCS
  585.         RS0   5  [|           |]  24 D0
  586.         RS1   6  [|           |]  23 D1
  587.   DoNotWire   7  [|   IMS     |]  22 D2
  588.          D3   8  [|   CO11    |]  21 DoNotWire
  589.   DoNotWire   9  [|           |]  20 D4
  590.          D5  10  [|           |]  19 DoNotWire
  591.   HoldToGND  11  [|           |]  18 D6
  592.          D7  12  [|           |]  17 LinkSpeed
  593.       Reset  13  [|           |]  16 SeparateIQ
  594.         GND  14  [|           |]  15 ClockIn
  595.                    -----------
  596.  
  597.  Pin Name     Data Direction                   Function
  598.  --------     --------------                   --------
  599.   D0-D7          in/out                 Bidirectional microprocessor data bus
  600.   notCS            in                   Chip select
  601.   RS0-RS1          in                   Register select
  602.   RnotW            in                   Read/Write control signal
  603.   InputInt         out                  Interrupt; link receive buffer full
  604.   OutputInt        out                  Interrupt; link transmit buffer empty
  605.   LinkSpeed        in                   Set link speed as 10 or 20 Mbits/sec
  606.   HoldToGND                             Must be connected to 0V
  607.   DoNotWire                             Must be left disconnected.
  608.   VCC, GND                              Power supply (+5V) and return
  609.   CapMinus                              External capacitor for clock
  610.   ClockIn          in                   Input clock
  611.   Reset            in                   System reset
  612.   SeparateIQ       in                   Chip mode select
  613.   LinkIn           in                   Transputer bus input channel
  614.   LinkOut          out                  Transputer bus output channel
  615.  
  616.  As with most ICs these days, VCC must be decoupled to GND via at least one
  617. 100nF low inductance (eg ceramic) capacitor.
  618.  
  619.  The capacitor to control the internal clock should be connected between VCC
  620. and CapMinus, with the negative terminal to CapMinus if the capacitor is of the
  621. polarised type. The capacitor should be of value 1uF, preferably ceramic, and
  622. with impedance less than 3 Ohm between 100 kHz and 10 MHz.
  623.  
  624.  The clock signal for the system, input at ClockIn, must be derived from a
  625. crystal, as R-C oscillators aren't stable enough for this job. A decent 10 MHz
  626. crystal, fed through a divide-by-two, should suffice. Mark/space ratio is
  627. unimportant. Although I have the data, I'm not bothering to put the info in
  628. about rise & fall times, etc.... if you want them, email me.
  629.  
  630.  To configure the IC for mode 2, SeparateIQ should be connected to GND.
  631.  
  632.  Standard Transputer bus speed is 10 Mbits/sec, selected by pulling LinkSpeed
  633. low. The CO11 may also communicate at 20 Mbits/sec, and this is affected by
  634. holding LinkSpeed high.
  635.  
  636. Communicating with the CO11
  637. ---------------------------
  638.                             The microprocessor bus D0-D7 is bidirectional, and
  639. is high impedance unless the CO11 is selected (see below) and RnotW is high.
  640. D0 is the least significant bit.
  641.  
  642. RnotW is the read/write select. RnotW high = read from CO11
  643.                                 RnotW low  = write to CO11
  644. RnotW is latched by notCS going low; if timing allows, it is possible to alter
  645. RnotW before notCS going high.
  646.  
  647. notCS is used to select the IC for reading/writing by the microprocessor.
  648. Register selectors RS0 and RS1 must be valid before the chip is selected, as
  649. must D0-7 if a microprocessor write operation is specified by RnotW.
  650. The chip is selected by pulling notCS low, and data is read by the chip on the
  651. rising edge of the notCS signal. However, I'm not planning to do this...
  652.  
  653. The bit pattern on RS0 and RS1 determine which of the four registers in the
  654. CO11 is to be accessed by the microprocessor. A register is addressed by
  655. setting up RS0 and RS1, then taking notCS low. The state of RnotW determines
  656. whether the register is to be read from or written to.
  657.  
  658.  RS0      RS1    RnotW     Register
  659.  ---      ---    -----     --------
  660.   0        0       1       Read data
  661.   0        0       0       Invalid
  662.   0        0       1       Invalid
  663.   0        1       0       Write data
  664.   1        0       1       Read input status
  665.   1        0       0       Write input status
  666.   1        1       1       Read output status
  667.   1        1       0       Write output status
  668.  
  669. Input Data Register:
  670.                     Holds the last data packet received from the serial link.
  671. The data is valid only when the "data present" flag is set in the input status
  672. register.Reading the data herein is destructive (ie cannot read the same data
  673. twice). Writing to this register has no effect.
  674.  
  675. Input Status Register:
  676.                       bit 0 = data present flag
  677.                       bit 1 = interrupt enable flag for InputInt line.
  678.  When writing to this register, bits 2-7 must be set to 0.
  679.  
  680. Output Data Register:
  681.                      Data written to this register is transmitted out of the
  682. serial link as a transputer data packet. Data should only be written when the
  683. "output ready" bit of the output status register is high. This register should
  684. not be read from; the resulting data is undefined.
  685.  
  686. Output Status Register:
  687.                        bit 0 = output ready flag
  688.                        bit 1 = interrupt enable
  689.  When writing to this register, bits 2-7 must be set to 0.
  690.  
  691.  The InputInt output is set high to indicate that a transputer packet has been
  692. received. It is inhibited from going high when the interrupt enable bit has
  693. been set low, which occurs on a Reset, and when data is read from the input
  694. data register.
  695.  
  696.  The OutputInt output is set high to insicate that the CO11 is ready to receive
  697. data for packeting and transmission. It is inhibited from going high when the
  698. interrupt enable bit is set, and is reset low when the CO11 is Reset or data is
  699. written to the data output register.
  700.  
  701.  Well, that's it for this instalment. While writing it, it's amazing how much
  702. comms handling code you think up to handle the signals...
  703.  Anyway, in conjunction with the Podule Interface article below, I hope that I
  704. can get this unit fitted on a podule, and exchanging pleasantries with a T425.
  705. More next issue....
  706.  
  707. Down to the Metal: Another Article! This time, Podule Interfacing
  708. -----------------
  709. The Hardware
  710. ~~~~~~~~~~~
  711.                  Before you start working on devices to plug into the back of
  712. your precious Arc(s), you'll need to know the pinout and signal levels of the
  713. podule interface. As these aren't documented in the User Guide or the PRM set,
  714. I guess I'd better produce them here.
  715.  
  716.  An application note, "A Series Podules," which contains a more complete
  717. specification of the podule interface, is available on request from Acorn.
  718.  This note should also cover the A3000/A30n0 (where n>=1) mini-podule.
  719.  
  720. First of all, the power available per podule can be worked out from the
  721. backplane ratings:
  722.  
  723.  +5V    1A maximum
  724.  +12V   250mA maximum
  725.  -5V    50mA maximum
  726.  
  727.  Once you've worked out your power requirements, you'll need the pinout.
  728.  
  729.  The Podule socket is a 64-way DIN 41612; the a side is to the bottom of the
  730. podule, the b (centre) line is unused, and the c side is the top.
  731.  
  732.  Pin Number       a side       c side             Description
  733.  ----------       ------       ------             -----------
  734.      1              0V           0V                Ground
  735.      2             LA[15]       -5V
  736.      3             LA[14]        0V                Ground
  737.      4             LA[13]        0V                Ground
  738.      5             LA[12]     Reserved             
  739.      6             LA[11]       MS[0]              MEMC Podule select
  740.      7             LA[10]     Reserved
  741.      8             LA[9]      Reserved 
  742.      9             LA[8]      Reserved
  743.     10             LA[7]      Reserved
  744.     11             LA[6]      Reserved
  745.     12             LA[5]        RST                Reset
  746.     13             LA[4]        PR/W               Read/not write
  747.     14             LA[3]        PWE                Write strobe
  748.     15             LA[2]        PRE                Read strobe
  749.     16             BD[15]       PIRQ               Normal interrupt
  750.     17             BD[14]       PFIQ               Fast interrupt
  751.     18             BD[13]       S[6]
  752.     19             BD[12]       C1                 IIC serial bus clock (SCL)
  753.     20             BD[11]       C0                 IIC serial data      (SDA)
  754.     21             BD[10]       S[7]               External podule select
  755.     22             BD[9]        PS[0]              Simple podule select
  756.     23             BD[8]        IOGT               MEMC podule handshake
  757.     24             BD[7]        IORQ               MEMC podule request
  758.     25             BD[6]        BL                 I/O data latch control
  759.     26             BD[5]        0V                 Supply
  760.     27             BD[4]        CLK2               2MHz synchronous clock
  761.     28             BD[3]        CLK8               8MHz synchronous clock
  762.     29             BD[2]        REF8M              8MHz reference clock
  763.     30             BD[1]        +5V                Supply
  764.     31             BD[0]        Reserved
  765.     32              +5V         +12V
  766.  
  767.  LA[0] and LA[1] are not routed.
  768.  Note that RST is the system reset signal, which is driven by IOC on power-up
  769. or by the system reset switch. The signal is open-collector, and may be driven
  770. by podules. Pulse width on this line to affect a reset should be at least 50ms.
  771.  
  772. The podule data bus BD[0:15] connects to the main system bus D[0:31] via a set
  773. of bidirectional latches, and is mapped such that during a write (ARM to
  774. podule) D[16:31] is mapped to BD[0:15], and during a read (peripheral to ARM)
  775. BD[0:15] is mapped to D[0:15].
  776.  
  777. The podule is read & identified (when PRE goes low) by the following bits on
  778. the data bus.
  779.  
  780. BD[0] 0 = Podule generates IRQ
  781.       1 = Podule does not generate IRQ
  782. BD[1] 0 = Podule absent
  783.       1 = Podule present
  784. BD[2] 0 = Podule generates FIRQ
  785.       1 = Podule doesn not generate FIRQ
  786. BD[7] 0 = Acorn podule
  787.       1 = Third party
  788.  
  789. BD[3:6] are the podule identification nybble.
  790.  
  791.  When PS goes low, the address (from the table in previous article) is made
  792. available on address lines LA[2] to LA [15], and the data appears at BD[0] to
  793. BD[32].
  794.  
  795. A3000 Users
  796. -----------
  797.            The A3000 mini-podule is a slightly cut-down version of the above
  798. pinout. Pin 2c is re-designated Reserved, as is pin 32c. Also, you have a
  799. separate, internal I2C connection, 
  800.  
  801. I'll see if I can get a better source of the Podule system calls for the next
  802. issue; the PRMs aren't particularly clear on this, especially on the chunk
  803. handling side.
  804.  
  805. The I2C bus - what is it? tony Duell
  806. -------------------------
  807.  
  808.  This information originally appeared in Coredump, the newsletter of the BITS
  809. Hardware and Old Systems SIG, and is reprinted here with permission of the SIG
  810. Leader.
  811.  
  812. The I2C bus (it stands for Inter Ic Communication) is a 2-wire (clock and data)
  813. multi-device bus designed by Philips originally for consumer electronics
  814. (Televisions, Video Recorders, etc). One of the main problems in such devices
  815. was the large number of peripheral devices (Teletext decoders, front-panel
  816. displays, remote control systems, etc) that were controlled by the central
  817. microcontroller, and which thus required the microcontroller's address and data
  818. busses to be routed around the complete device. However, none of these devices
  819. really required fast control (I mean, you don't change channels every
  820. microsecond, now do you?), and a serial bus was the obvious answer.
  821.  
  822. _The_ reference on the I2C bus is the Philips data book. In my set, it's book
  823. 4, parts 12a and 12b. I think that may have changed now. If I find out any more
  824. information, I'll report it in Coredump.  These books give complete
  825. specifications of the signals to be sent on the bus, and of the chips designed
  826. to connect to it. However, I'll summerise the most important aspects here.
  827.  
  828. Both the clock (called SCA), and data (called SDA) are driven by open-collector
  829. (or equivalent in non-bipolar technologies) drivers, and are pulled up by
  830. resistors, external to all the IC's. If you have a personal computer on the
  831. bus, it's normal for the computer to be fitted with these resistors. So, in the
  832. idle state, both lines are in the logic 1 state, and can be forced to the
  833. logic 0 state by any device on the bus.
  834.  
  835. Its important at this point to define 4 important terms : 
  836. Transmitter - the device that outputs data
  837. Receiver - the device that inputs data
  838. Master - the device that controls the transfer, and generates the clock signal
  839. Slave - the device controlled by the master. A particular IC may be designed to
  840. be a slave only, and in that case, it will be incapable of driving the clock
  841. line (although, of course, it will still monitor it).
  842.  
  843. Data is passed serially, MSB first, on the data line. The data line is sampled
  844. by the slave when the clock is high, and thus, except in special circumstances, 
  845. the data line may only change state when the clock is low. Data is transfered
  846. in 8-bit bytes, and after the last bit is transfered, the transmitter allows
  847. the data line to float high, and the master generates one more clock pulse.
  848. During this time, the receiver pulls the data line low as an acknowledge
  849. signal.
  850.  
  851. 2 special conditions must also be defined - those to start and stop a
  852. transfer. They are the only time the data line changes state when the clock is
  853. high. In fact, a 1->0 change on the data line defines a start, a 0->1 change
  854. defines a stop.
  855.  
  856. I've not said anything about addressing the various devices on the bus yet. The
  857. first byte transfered after the start signal is interpreted as an address. The
  858. LSB is 0 for a write, and 1 for a read. The other 7 bits select the device. It
  859. is normal for the top for bits to be permanently defined within a particular
  860. chip, and to allow some of the other bits (from 1 to 3) to be selected by
  861. external pins, thus allowing multiple devices of the same type on the same I2C
  862. bus - every device must have a unique address of course.
  863.  
  864. Here are some typical sequences of data transfer on the I2C bus
  865.  
  866. Write to slave IC
  867.  
  868. Start | Address (LSB=0) | data | Ack | data | Ack | Stop
  869.  
  870. Read from slave IC (a simple IC, with only 1 register)
  871.  
  872. Start | Address (LSB=1) | data (from slave) | Ack | Stop
  873.  
  874. Write to IC to select register, then read back
  875.  
  876. Start | Address (LSB=0) | data (to slave - here a register select) | Ack |
  877. Start (here called a repeated start) | Address (LSB=1) | data (from slave) | 
  878. Ack | Stop
  879.  
  880. How to get your computer talking on the I2C bus
  881. -----------------------------------------------
  882. If you have an Acorn Archimedes, then you are lucky. It has a I2C port built
  883. in, accessible on 2 pins of the podule connector. If you have some other
  884. machine, you will have to build a port yourself. Elektor magazine did an
  885. article describing a plug-in card for the IBM PC, for which both the etched
  886. circuit board, and a disk of driver software (including source code) are
  887. available. It uses the Philips PCF8584 device, available from RS components,
  888. under stock number 296-699. The examples I give will assume that you have this
  889. card, and the software. You will have to translate them for some other machine.
  890. In fact, the PCF8584 is a very easy-to-use device. It takes an 8-bit data bus,
  891. 1 address line, an 8MHz clock (or other values can be used), and control
  892. signals. It even looks at the first access after a reset (which should be a
  893. write to the chip's register 0), and works out if it is being driven by an
  894. Intel-bus (the Arc is generally classed as an Intel bus-alike : Dave) or
  895. Motorola-bus CPU. It then defines the rest of the signals accordingly. I'll
  896. probably be designing boards to use this chip with other personal computers in
  897. due course, and will describe them in future issues of Coredump.
  898.  
  899.  
  900. Build a simple real-time clock for the I2C bus
  901. ----------------------------------------------
  902. Here's the first of (hopefully) many projects to work in the I2C bus. It's a
  903. real-time clock in 6 components, using the PCF8583 device (RS stock number
  904. 296-683). Here's how to wire it up. The PCF8583 has 8 pins 
  905.  
  906.              --V--
  907. OSCI--------|     |----- +5v
  908. OSCO--------|     |-----INT
  909. A0----------|     |-----SCL
  910. Ground------|     |-----SDA
  911.              -----
  912.  
  913. +5v and ground are obvious!
  914. SCL and SDA are the I2C connections, and should be linked to the correct
  915. connections on whatever computer you are using to control this project
  916.  
  917. INT is an interupt output. For now, just pull it high by a 1k resistor to +5v
  918.  
  919. A0 is an address select input. It defines the LSB of the 7 bit address. The
  920. address is either 1010000 or 1010001. To use my software, simply connect it to
  921. ground. 
  922.  
  923. OSCI and OSCO are the connections for a 32.768 kHz crystal (a digital watch
  924. crystal). Just connect it between the pins, and then connect a 5-25pF trimmer
  925. capacitor from OSCI to +5V. 
  926.  
  927. That's it. If you are using the Elektor I2C interface and software, the program
  928. below should run as-is. If you are using some other machine, you can still use
  929. the method.
  930.  
  931.  
  932. program real_time_clock (input,output,bus);
  933. {Test PCF 8583 clock chip on I2C bus }
  934.  
  935. {i2c is a unit provided on the Elektor I2c software disk}
  936. uses i2c,crt;
  937.  
  938. var
  939.   bus:i2cfile;
  940.   packet:array[0..7] of byte;
  941.   r,p:byte;
  942.   i:integer;
  943.  
  944. {The PCF8583 uses 8 bit BCD numbers (2 digit). The following 2 functions
  945. convert bytes to/from such BCD representations}
  946.  
  947. function bcd2bin(x:byte):byte;
  948. begin;
  949.   bcd2bin:=(x div 16)*10 + (x mod 16);
  950. end;
  951.  
  952. function bin2bcd(x:byte):byte;
  953. begin;
  954.   bin2bcd:=(x div 10)*16 + (x mod 10);
  955. end;
  956.  
  957. begin;
  958.   {the array PACKET will be used to read/write to the PCF8583. The bytes
  959.    are mapped to the internal registers. First, we clear them }
  960.   for i:=0 to 7 do packet[i]:=0;
  961.  
  962.   {Now, we get the current time, and put it in the correct bytes of PACKET.
  963.   Hours are regist 4, minutes 3, seconds 2 - see the PCF8583 data sheet
  964.   for more details }
  965.   clrscr;
  966.   write('hours : ');
  967.   readln(p);
  968.   packet[4]:=bin2bcd(p);
  969.   write('minutes : ');
  970.   readln(p);
  971.   packet[3]:=bin2bcd(p);
  972.   write('seconds : ');
  973.   readln(p);
  974.   packet[2]:=bin2bcd(p);
  975.  
  976.   {Initialise the I2C system}
  977.   start(bus);
  978.  
  979.   {The PCF8583 has an address with high nybble 1010, low nyble either 0
  980.    or 2 according to the state of the A0 pin. Bit 0 is the read/write
  981.    flag as normal. Here, A0 is tied low }
  982.   address(160);
  983.  
  984.   {R is used as the register pointer for the PCF8583. It is set to the
  985.    number of the first register to be read or written}
  986.   r:=0;
  987.  
  988.   {Now actually send the values to the PCF8583}
  989.   write(bus,r,packet[0],packet[1],packet[2],packet[3],packet[4],packet[5],
  990.           packet[6],packet[7]);
  991.  
  992.   close(bus);
  993.  
  994.   {Routine to read in the time and display it}
  995.   clrscr;
  996.  
  997.   {reselect the PCF8583}
  998.   start(bus);
  999.   address(160);
  1000.   repeat;
  1001.  
  1002.     {We'll read in the 8 registers, starting from 0}
  1003.     r:=0;
  1004.  
  1005.     {send the register address to the PCF8583}
  1006.     write(bus,r);
  1007.  
  1008.     {Here, we start reading. In fact, the driver generates a repeated start
  1009.      here}
  1010.     read(bus,packet[0],packet[1],packet[2],packet[3],packet[4],packet[5],
  1011.           packet[6],packet[7]);
  1012.  
  1013.     {display the time}
  1014.     gotoxy(20,3);
  1015.     writeln(bcd2bin(packet[4]):2,':',bcd2bin(packet[3]):2,':',
  1016.             bcd2bin(packet[2]):2);
  1017.  
  1018.  
  1019.   until keypressed;
  1020.   close (bus);
  1021. end.
  1022.  
  1023. Although this third second article is aimed at the design and implementation of
  1024. an I2C bus on a certain "other" computer, it's interesting to see both how it's
  1025. done (our own I2C comes out direct out of IOC), and to get a PASCAL listing
  1026. which those of you with the DDE can test, substituting the SYS"IIC_Control"
  1027. call where necessary.
  1028.  Please mail me with your opinions as to whether you'd like to see the rest of
  1029. the I2C series duplicated in EurekA, and if you'd like to receive Coredump (an
  1030. excellent hardware Newsletter, especially for DEC hackers) tony can be
  1031. contacted as ard@siva.bris.ac.uk. Coredump, like EurekA and Cassini (the HP
  1032. Handheld SIG Newsletter) is also available from info.bris.ac.uk.
  1033.  
  1034. *LIB
  1035. ~~~
  1036.     Yet more freshly-acquired documentation available from your friendly
  1037. neighbourhood SIG Leader...
  1038.  
  1039. BBC Master blueprints
  1040. ---------------------
  1041.                       Those were the days... well, indeed they were. However,
  1042. these docs (never officially released) will hold a great deal of interest for
  1043. those of us who still run Beebs, etc, and for the Arc-only owners as well, this
  1044. print set includes schematics of the Econet interface. Fortunately, the Master
  1045. Econet interface and the Arc Econet interface are electronically identical...
  1046.  
  1047. ARM data book
  1048. ------------- 
  1049.              If you want to know about the insides of the ARM chipset, look no
  1050. further. This is the book designed by hardware developers for same, and tells
  1051. you everything you always wanted to know and weren't afraid to ask, but
  1052. couldn't find inside the PRM or Hardware Ref. Manual. Time to have some fun
  1053. reprogramming the MEMC to tweak RAM protection in Supervisor mode.....
  1054.  
  1055. Time to give my Bank Manager nightmares...
  1056. ------------------------------------------ 
  1057.                                            After much deliberation, I've
  1058. decided _NOT_ to buy a RISC OS 3.10 PRM set.
  1059.  
  1060. (Pause for dramatic effect)
  1061.  
  1062.  At least, not on paper. A CD ROM has been released, priced at #99, (but can't
  1063. remember the name of the supplier at the moment; ho hum) containing
  1064. the following documentation:
  1065.  
  1066.     RISC OS 2.00 /01 PRM
  1067.     RISC OS 3.00 PRM (Unreleased on paper)
  1068.     RISC OS 3.10 PRM
  1069.     Acorn Desktop Assembler manual
  1070.     Acorn Desktop C manual
  1071.     Acorn DDE manual
  1072.     Technical (Hardware) manual for all hardware variants
  1073.  
  1074. Unfortunately, it doesn't contain the ARM data book!
  1075.  
  1076.  In total, this works out, including the CD ROM drive to play it on, as not
  1077.  much dearer than buying all the manuals on paper. In conjunction with the
  1078. advanced searching options available, I reckon it's well worth it.
  1079.  
  1080. *SHUTDOWN
  1081. ~~~~~~~~
  1082.          Issue #3 thus bites the dust. I apologise for the delay in getting
  1083. this one out, but it's involved rather more work than even Issue #2. Also,
  1084. having an Electron Microscopy exam to revise for over Christmas didn't help.
  1085.  As I have more exams at Easter, I can't say when Issue #4 will happen... I'm
  1086. also running a little low on easy-to-implement Arc hacks to write up at the
  1087. moment, as horizons widen and projects get bigger, giving me an inevitable
  1088. backlog. The time may come when I'll document the homebuilt FPA and the
  1089. multitasking BSD UNIX port (from src.doc.ic.ac.uk), including the code for
  1090. UNIXFS:, but I doubt they'll be in the same issue, and certainly not in the
  1091. same posting (goodbye, net.bandwidth)!
  1092.  
  1093.  Meantime have a belated Happy 1993 from me, and happy hacking to you all.
  1094.  
  1095.  
  1096.