PDA

View Full Version : problem (bug) in LCDOUT & MSSP-modul



BigWumpus
- 20th April 2007, 09:23
...the last 14 days I was hunting a serious bug in our application...

today I found the solution !
A 16F872 works as a display-controller and receives the characters to print via I2C-communication. Until now, the characters are delivered very slowly, so the uC was able to put them on the display, before another character was received.
Now, I must store some characters and put them on the display, while other charaters are received via I2C. And here the trouble starts!

today I found out, the LCDOUT-command touches the TRIS each time, a character is given to the LCD (read-modify-write), so the TRIS-bits may become wrong (the MSSP switches the TRIS!)

So, I disables the switching of the TRIS in the LCDOUT-macro - it works !

mister_e
- 20th April 2007, 14:39
mmm, interesting. Did you declare PORTx or LATx?

but i'm not sure if PBP DEFINEs will use LAT...

BigWumpus
- 20th April 2007, 18:33
PIC16xxx has no LAT, and the problem is touching the TRIS-Register (read-modify-write) while the hardware does it too.

mister_e
- 20th April 2007, 20:07
Ah crap... better to open my eyes better next time ;)

I don't know why... but i saw 18F