This is in connection with my old post http://www.keil.com/forum/20496/
I got great help here. Now I can read serial bit stream into a 32bit long, split it in 4 bytes & after some conversion can send the captured data to my 16*2 LCD. I have done it but some of the input bits were lost while doing it & I got garbage data. The real story is like this:
I want to capture data from a device & display it. The MCU in the device sends the display data to MM5452 LCD controller (www.ti.com/.../snls367b.pdf) which is displayed on 3 1/2 LCD display. I am trying to capture the data from the input pins of the LCD controller which are sent by the MCU in the device.
The LCD controller has 3 input pins. One is DATA ENABLE, another is CLOCK & third one is DATA. DATA is latched on high going CLOCK pulse provided DATA ENABLE is low. The first data bit is start bit which is always 1. Next 35 bits are real data bits out of which first 32 bits are needed. I think last 3 bits are for data format compatibility with other similar controllers.
I inverted the clock pulse & used INT0 to detect it. In the ISR, I read the data bit & saved it in 32bit long. As I got garbage data, I checked the signals on CRO. The clock cycle width was 10uS. I am using 24Mhz crystal on 89S52 so single-cycle instruction will take 0.5uS. That means in my interrupt routine maximum of 20 single-cycle instructions are allowed, which I think it is not possible (at least for me). Because I will need to keep track of START BIT, DATA ENABLE & number of bits collected so as to differentiate the data chunk. Further conversion can be done out of the ISR.
Is it possible to solve this issue on different micro-controller such as AVR or ARM?
Sorry for long post, but I thought I should give you as much information as possible in the first go.