On February 27, 2009 02:20:12 pm Richard Gray wrote: > Hi Folks, > > I am using a Z80180 (64-pin DIL) chip with garden variety Z80 PIO, and I > don't seem to be able to coax the PIO into performing any output > whatsoever.
<snip> > > Now, I've verified that the above code sends the correct data to the PIO > (as far as I can see) with a logic analyser - the chip enable, A/B, and C/D > pins and IORQ are all in the correct state (the A/B and C/D pins are > connected to the A0 and A1 lines in the usual way). I have another piece of > code that changes bit 0 on port B roughly once a second, but interestingly > port B always reads back as 0x00. <snip> > > Can anyone suggest where I might be going wrong? The generated assembly > code shows in0 and out0 instructions, but they still address the correct > port address so I don't really see a problem with that, and the same > principle is used for the Zilog CTC and that works fine. > > I'm completely baffled. Any suggestions would be welcome. You should add M1 to your logic analyser; the Z80 PIO chip generates its own write signal. Here's the equation from the specs of the PIO: /WR = RD . /CE . /IORQ . /M1 (I'm not sure if my old Z80 book is right) Good luck! JP ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user