Technical discussions about Freescale Microcontrollers: M68HC11. (Freescale Semiconductor is a Subsidiary of Motorola).
|
Make sure you have a pulldown resistor tied to all input ports. I use a 4.7K from the pin to ground. Without these, even a very short piece of wire can act like an antenna and make the input unstable -- a characteristic of CMOS logic. ----- Original Message ----- From: "bal_gill21" <> To: <> Sent: Sunday, November 28, 2004 11:40 AM Subject: [m68HC11] Port C > > Hi > When reading the contents of port c I have to have a delay in my code > that is quite long (ie ffff on x stack and all pulled off again). > Without the delay I get garbage read from port C. This doesn't seem > right as it's only supposed to be a couple of machine cycles for the > port to be read. What could possibly be the cause of this? > > Thanks guys > > Bal > > Yahoo! Groups Links > ************************************************************** > Scanned by VisNetic MailScan for SMTP Servers. > Visit http://www.deerfield.com/products/visnetic_mailscan. > ************************************************************** |
|
Hi When reading the contents of port c I have to have a delay in my code that is quite long (ie ffff on x stack and all pulled off again). Without the delay I get garbage read from port C. This doesn't seem right as it's only supposed to be a couple of machine cycles for the port to be read. What could possibly be the cause of this? Thanks guys Bal |
|
|
|
----- Original Message ----- From: "bal_gill21" <> To: <> > When reading the contents of port c I have to have a delay in my code > that is quite long (ie ffff on x stack and all pulled off again). > Without the delay I get garbage read from port C. This doesn't seem > right as it's only supposed to be a couple of machine cycles for the > port to be read. What could possibly be the cause of this? Well, the port is actually read in a single cycle within the LDAA command (for example). So, if the delay is causing it to work and no delay messes it up, it seems that whatever you have connected to PORTC isn't setting up its data fast enough. What do you have on PORTC? > Bal |
|
|
|
Connected to PORTC is a vacuum flourecent display (VFD). The VFD becomes busy when an ASCII character or any other command is sent to it. I am reading the busy line so I can then send it more data. It claims in the data sheet that instructions take no longer than 50uS at a time (for the commands i'm sending it), my delay exceeds that. Bal > > When reading the contents of port c I have to have a delay in my code > > that is quite long (ie ffff on x stack and all pulled off again). > > Without the delay I get garbage read from port C. This doesn't seem > > right as it's only supposed to be a couple of machine cycles for the > > port to be read. What could possibly be the cause of this? > > Well, the port is actually read in a single cycle within the LDAA command (for > example). So, if the delay is causing it to work and no delay messes it up, it > seems that whatever you have connected to PORTC isn't setting up its data fast > enough. What do you have on PORTC? > > > Bal > > tonyp@a... |