hoveringuy
New member
This is a programmer (me) problem, not display.
I have a Microchip dsPIC30F4011 running on a development board with integrated MAX232 and such. I am trying to connect the CFA-633 in place of the existing SPI LCD. Using an oscilloscope I can see the Tx pin trying to send one character (or something) and then nothing.
the pertitenent parts of my code is as follows. The UART routines are straight from Microchip examples.
My desired display string is held in character type DisplayData.....
DisplayData [0] = 31; //LCD
DisplayData [1] =22; //length
DisplayData [2] = 0; //x
DisplayData [3] = 0; //y
DisplayData [4] ='H'; ...ello World.
The main routine calls WriteUART_to_RS232. This should activate the UART by loading the first character.....
void WriteUART_to_RS232(void)
{
if ((UARTCharPtr > &DisplayData[0]) &&
(UARTCharPtr < &DisplayData[38])) return;
else
{
UARTCharPtr = &DisplayData[0]; //Re-Initialize UART display
//buffer pointer to point to
//the first character
U1TXREG = *UARTCharPtr++; //Load the UART transmit
//register with first character
}
}
The interupt should load additional characters as the Tx buffer runs dry....
void __attribute__((__interrupt__)) _U1TXInterrupt(void)
{
int i = 0;
while ((*UARTCharPtr != '\0') && (i < 4))
{
U1TXREG = *UARTCharPtr++;
i++;
}
IFS0bits.U1TXIF = 0; //Clear the UART1 transmitter interrupt flag
}
What am I missing here?
I have a Microchip dsPIC30F4011 running on a development board with integrated MAX232 and such. I am trying to connect the CFA-633 in place of the existing SPI LCD. Using an oscilloscope I can see the Tx pin trying to send one character (or something) and then nothing.
the pertitenent parts of my code is as follows. The UART routines are straight from Microchip examples.
My desired display string is held in character type DisplayData.....
DisplayData [0] = 31; //LCD
DisplayData [1] =22; //length
DisplayData [2] = 0; //x
DisplayData [3] = 0; //y
DisplayData [4] ='H'; ...ello World.
The main routine calls WriteUART_to_RS232. This should activate the UART by loading the first character.....
void WriteUART_to_RS232(void)
{
if ((UARTCharPtr > &DisplayData[0]) &&
(UARTCharPtr < &DisplayData[38])) return;
else
{
UARTCharPtr = &DisplayData[0]; //Re-Initialize UART display
//buffer pointer to point to
//the first character
U1TXREG = *UARTCharPtr++; //Load the UART transmit
//register with first character
}
}
The interupt should load additional characters as the Tx buffer runs dry....
void __attribute__((__interrupt__)) _U1TXInterrupt(void)
{
int i = 0;
while ((*UARTCharPtr != '\0') && (i < 4))
{
U1TXREG = *UARTCharPtr++;
i++;
}
IFS0bits.U1TXIF = 0; //Clear the UART1 transmitter interrupt flag
}
What am I missing here?
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.