Technological Arts 11/11/98 (416)963-8996 www.interlog.com/~techart Software Considerations for X68C75 ================================== When writing software for use with the Xicor X68C75 Microperipheral, there are a few special considerations to keep in mind. Adapt11C75, Adapt11C75DX, and Adapt11C75DXE all use 68HC11 in expanded mode, where PORTS B and C are transformed into a multiplexed address/data bus. Thus, HC11 registers for Ports B and C do not exist in expanded mode. To compensate for the loss of two I/O ports, Adapt11C75DX provides two ports, XPORTA and XPORTB, in the X68C75J microperipheral chip. Also, the X68C75 has its own register block, located at 0x8400 (or at 0x0400 for Adapt11C75DXE). Refer to the Xicor X68C75 datasheet included with your Starter Package (or available from the Xicor website www.xicor.com) for detailed description of these registers (Fig. 7, page 7). The operation differs slightly from the HC11 port registers. Instead of a data direction register for each port, there is a configuration register (XCR) which has two direction control bits (one for each of XPORTA and XPORTB) (Fig. 11, page 10). Use XPORTA as a replacement for HC11 PORTB, and XPORTB as a replacement for HC11 PORTC. Note also that there are two data registers for each port. The Port Data Register latches data for output, while the Port Pin Register is read when the port is used as input. Single-chip Mode HC11 vs. Expanded Mode with X68C75 =================================================== Most assembly language programmers load an index register with the register base, and then use indexed mode instructions to work with the individual registers. This permits the use of the bit manipulation instructions BSET, BCLR, BRSET, BRCLR. For example, to write a bit pattern of %01010101 to PortB, a typical code sequence in a single-chip HC11 configuration would be: ;set up some definitions rbase equ $1000 ;HC11 register base portb equ $04 ;offset of portb register (note that portb is output only) ;code section ldx #rbase bset portb,x #$55 To achieve the same effect in an expanded mode system using X68C75, you would first set up XPORTA as an output port (emulating HC11 PORTB), then write to the XPORTA Port Data Register. ;set up some definitions xrbase equ $8400 ;use $0400 for Adapt11C75DXE xcr equ $20 ;X68C75 configuration register xpdra equ $10 ;XPORTA Port Data Register ;initialize X68C75 Configuration Register ldx #xrbase bset xcr,x #$08 ;set XPORTA as CMOS outputs (leave other bits unchanged) ;manipulate the port bset xpdra,x #$55 If you are manipulating bits in an HC11 port and an X68C75 port in the same section of code, you could use the X register for rbase, and the y register for xrbase. The code section would be something like this: ;set up some definitions rbase equ $1000 ;HC11 register base porta equ $00 ;HC11 porta offset xrbase equ $8400 ;use $0400 for Adapt11C75DXE xcr equ $20 ;X68C75 configuration register xpdra equ $10 ;XPORTA Port Data Register ;initialize X68C75 Configuration Register ldx #xrbase bset xcr,x #$08 ;set XPORTA as CMOS outputs (leave other bits unchanged) ;manipulate the ports ldx #$rbase ldy #$xrbase bset porta,x #$40 ;turn on PA6 (LED) bset xpdra,y #$aa ;write an alternating ones pattern to XPORTA