I hope that you won't have to keep working on it too long and that we will hopefully get somewhere. Do you have an oscilloscope? I suggest that we go down on the pins and see what is actually happening. Also, at this point, how is the LCD acting, do you at least see 'H and 'I' (lots of them) and only the '2' and '3' are the ones you do not see, or you see some of the '2's and '3's but not as often as you expect?
void HighISR (void)
{
unsigned char temp;
if (INTCONbits.RBIF == 1)
{
if (SW2 == 0)
{
writeLCD('2');
//debug
if (LATAbits.RA1) PORTAbits.RA1 = 0;
else PORTAbits.RA1 = 1;
// debug
}
// skip SW3 for now
temp = PORTB;
INTCONbits.RBIF = 0;
}
}
With the above code, you should see RA1 toggle every single time the button is pressed. If you do, then there should also be activity on the TX pin thus sending the character to the LCD.
Raquel Malinis
Design and Development
Matrix Orbital
Ok, I figured it out! My RS232 level converter is faulty. It's supposed to power down between transmissions, but for some reason it wouldn't come back up after it powers down the first time while connected to the LCD. I can't explain why it works fine with my PC and not whit the LCD, though. If I configure it to always stay on, it works fine with the LCD, though?!?!?!? Thank you for all of your help!
I'm glad that you have figured out what was wrong. Just so you know, you can also communicate with the LCD2041 via TTL and with TTL you wouldn't need an RS232 converter. Please see the manual how to configure the LCD2041 to TTL levels and so you may connect the PIC directly to the LCD.
If you have any more concerns please do not hesitate to post them.
Raquel Malinis
Design and Development
Matrix Orbital
Yeah, I know about bypassing the voltage converter chip, but the dev board I have already has the RS232 chip in place. Also this allows me to use my PC's com port to troubleshoot, etc... And I've got the problem fixed now, so if it ain't broke...
Another question, I meant to ask before, is, is there a way to designate HEX values in a string? What I mean is, something similar to \r or \n? like \0xFE?
arney wrote:Another question, I meant to ask before, is, is there a way to designate HEX values in a string? What I mean is, something similar to \r or \n? like \0xFE?
Why not replace \0xFE in your procedure/method to write to the display? Something like this (pseudo code):