Port aliasing on the 328

Discussion of issues related specifically to writing code for native mode devices. This includes ZBasic code as well as assembly language code and C code, both inline and standalone.
Post Reply
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Port aliasing on the 328

Post by FFMan »

I'm porting some code from a zx24 to zx328n. Part of the LCD write routine cribbed from the 8bit example code uses a port alias technique recommended by Don to simply loading 8 pins with a data word.

LCD_DATA=C is how the code appears.

Now switching to the 328, there doesn't appear to be a complete port free to use in this way. Not insurmoutable as one could easily assign each bit of the data to any pin, but the alias is neat and quick.

Port B clashes with pin 14 which I need to do an inputcaputre on, and the XTAL pins
Port C seems to be missing C.7 and clashes with the download port
Port D clashes with the download comms pins

is there a neat solution to this, or do i just assign each pin individually ?

thanks
kranenborg
Posts: 57
Joined: 27 July 2009, 14:20 PM
Location: Groningen, The Netherlands
Contact:

Post by kranenborg »

Hi,

it appears that you can get a fully available port D on the ZX-328 by disabling the COM1 port as discussed in the following link ( I needed a full port too): http://www.zbasic.net/forum/about1278.html

/Jurjen
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Port aliasing on the 328

Post by dkinzer »

FFMan wrote:Part of the LCD write routine cribbed from the 8bit example code [...]
My recommendation would be to use 4-bit mode. There is example code in AN-220 showing how to implement the 4-bit interface.
- Don Kinzer
Post Reply