LCD Component
Posted: Tue May 05, 2009 9:17 am
Would it not be a good idea to make your standard LCD component contain the lines:-
clear_bit(intcon, GIE);
set_bit(intcon, GIE);
trisb = trisb & 0x0F; //Sets the high nibble to an output
trisb = trisb | 0xF0; //Sets the high nibble to an input
in appropriate places?
This is because in real life systems it’s common to share LCD's data lines with menu pushbuttons and without the trisb lines the switches are ignored. Also interrupts seem to corrupt the LCD write process.
I find it difficult to believe that Flowcode users other then me have not met these problems.
Admittedly these problems do not affect all code and all PIC types (e.g. the interrupt problem affects my 2520 PIC but not my 886), so it isn’t essential. But it would be useful to at least have them in there commented out, with a note in the header to instruct users how to enable them and under what circumstances they may be needed.
The downsides are small, being slightly larger code and slight pauses in the interrupts.
An alternative would be to include some reference to the problem in a Help or Tutorial file.
clear_bit(intcon, GIE);
set_bit(intcon, GIE);
trisb = trisb & 0x0F; //Sets the high nibble to an output
trisb = trisb | 0xF0; //Sets the high nibble to an input
in appropriate places?
This is because in real life systems it’s common to share LCD's data lines with menu pushbuttons and without the trisb lines the switches are ignored. Also interrupts seem to corrupt the LCD write process.
I find it difficult to believe that Flowcode users other then me have not met these problems.
Admittedly these problems do not affect all code and all PIC types (e.g. the interrupt problem affects my 2520 PIC but not my 886), so it isn’t essential. But it would be useful to at least have them in there commented out, with a note in the header to instruct users how to enable them and under what circumstances they may be needed.
The downsides are small, being slightly larger code and slight pauses in the interrupts.
An alternative would be to include some reference to the problem in a Help or Tutorial file.