Very inconsistent read behavior | Cypress Semiconductor
Very inconsistent read behavior
I feel like there must be something simple I'm overlooking, but I'm having a ton of problems reading data with this project.
This is (supposed to be, some day) a helper module for an old pocket computer. CS enables the MCU when low (from address and chip select decoding off of the PC bus). This fires an interrupt handler. That works perfectly.
From there, I need to read other input pins, like the Address set, and the R/W pin. Right now I'm mainly focusing on the R/W pin. I've tried changing it to software controlled and added a register for the OE. I've tried changing its sync. I've tried disabling its buffer. Nothing seems to make it work correctly. Basically, most of the time it reads RW at 1 (high) regardless of whether it is or not. Occasionally it will go through periods of reading it as 0, again, regardless of the actual value. At one point, while it was reading 0, I disconnected the PC and attached a pull up to VDD. I could read 4.54V on the solder join on the eval board, but a debug breakpoint was still showing the value as 0. That had me thinking that I had blown the MCU or something, but, that was when I tried switching to software and a register... and that changed it to reading 1 all the time. Later, changing back still left it as 1.
It's frustrating, because writing data onto the bus is working pretty well. However, not being able to read anything has me completely blocked.
I may try retargeting for one of the other eval modules, just to rule out a blown MCU...
I did try putting the 214009 back on the Pioneer board and programming a simple LED flash app to test reading P0.4 and P0.5. Both of them read correctly when being used as software pins in that setup. I then switched the input pins to P3.3 and P3.2, and they read fine as well. So, apparently, it's something in my project and not a blown MCU. Is there something about interrupt handling that interferes with pin reads?