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
Port aliasing on the 328
-
- Posts: 57
- Joined: 27 July 2009, 14:20 PM
- Location: Groningen, The Netherlands
- Contact:
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
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
Re: Port aliasing on the 328
My recommendation would be to use 4-bit mode. There is example code in AN-220 showing how to implement the 4-bit interface.FFMan wrote:Part of the LCD write routine cribbed from the 8bit example code [...]
- Don Kinzer