I'm working on a LCD data filter. I've got a milling machine with a display. This machine is controlled by a processor board, with a display for instructions and measurement values. I would like to change the language of the display. My idea is to disconnect the display cable from the processor board and connect a pic to the display cable and try to receive the data from the processor board. My pic will act like a display controller and receives the messages from the milling machine. The only information I need, are the measurment values. My pic will be connected to the display. The display will show the information messages in my own language and it will display the measurment values i've received from the processor board.
I'm using the following code to receive the display instructions from the processorboard. The original display is connected in 4 bit mode.
Now the problem:Code:Main: if changed = 1 then timeout = timeout + 1 endif LCDdataold = LCDdata lcddata.0 = LCD_E ' Copy the pin-states to the LCDdata variable lcddata.1 = LCD_RS lcddata.4 = LCD_DB4 lcddata.5 = LCD_DB5 lcddata.6 = LCD_DB6 lcddata.7 = LCD_DB7 if LCDdataold <> LCDdata then ' Compare the pin states withe the old pin states LCDlog[j] = lcddata ' Save the received data in the log array j = j + 1 changed = 1 Endif if timeout >= 10000 then ' after a while, display the received data timeout = 0 changed = 0 j = 0 for i = 0 to 20 Debug "Received data: ", dec2 i, "-", bin8 LCDlog[i],13,10 LCDlog[i] = 0 'Clear the log next i debug 13,10,13,10 Endif Goto Main
The data I receive is not consequent. When I display the same text on the display (by pussing a button on the machine) a few times, i get different log-information from my pic-system. I think it has to something with timing, but I'm not shure were it goes wrong. Any ideas?




Bookmarks