LK204-25 clear display trouble
Posted: Wed Sep 10, 2008 2:32 am
Hi! :)
I've been trying to make my LCD (LK204-25) clear it's screen. I'm using a PIC (PIC24HJ12GP201) to connect to my LCD. I think I read through the forum that PICs output as TTL so the LCD would have to have the jumpers soldered for TTL is this correct? I've changed to TTL and just as trying with Serial RS-232, I get nothing, just the original screen stating (Matrix Orbital and model number displayed). Before changing it to TTL, I've used my program to output on hyperterminal and it works, but trying to display it on LCD has been nothing less than a nightmare :(. I've been asking for assistance with my colleagues and they are just as clueless as to why it does not work. The following is my code (it is very small for I only want to clear screen).
#include <p24hj12gp201.h>
#include <stdlib.h>
#include <stdio.h>
#include <uart.h>
#define FCY 25000000
#define BAUDRATE 19200
#define BRGVAL ((FCY/BAUDRATE)/16)-1
///////////////////////////////////////////////////////////////////
int main ()
{
PORTBbits.RB4 = 1;
///***************************
// Assign U1Rx To Pin RP0
//***************************
RPINR18bits.U1RXR = 0;
//***************************
// Assign U1CTS To Pin RP1
//***************************
RPINR18bits.U1CTSR = 1;
//***************************
// Configure Output Functions
// (See Table 9-2)
//***************************
//***************************
// Assign U1Tx To Pin 11
//***************************
RPOR4bits.RP8R = 3;
//***************************
// Assign U1RTS To Pin 12
//***************************
RPOR4bits.RP9R = 4;
PLLFBD=38; // M=40
CLKDIVbits.PLLPOST=0; // N1=2
CLKDIVbits.PLLPRE=0; // N2=2
RCONbits.SWDTEN=0; // Disable Watch Dog Timer
while(OSCCONbits.LOCK!=1) {}; // Wait for PLL to lock
U1MODEbits.STSEL = 0; // 1-stop bit
U1MODEbits.PDSEL = 0; // No Parity, 8-data bits
U1MODEbits.ABAUD = 0; // Autobaud Disabled
U1MODEbits.BRGH = 0; // Low Speed mode
U1BRG = BRGVAL; // BAUD Rate Setting 19200
U1STAbits.UTXISEL1 = 0;
U1MODEbits.UARTEN = 1; // Enable UART
U1STAbits.UTXEN = 1; // Enable UART Tx
WriteUART1(254); //send to Clear Display
WriteUART1(88); //Fail :(
}
Much thanks for your assistance on this matter
Michel
I've been trying to make my LCD (LK204-25) clear it's screen. I'm using a PIC (PIC24HJ12GP201) to connect to my LCD. I think I read through the forum that PICs output as TTL so the LCD would have to have the jumpers soldered for TTL is this correct? I've changed to TTL and just as trying with Serial RS-232, I get nothing, just the original screen stating (Matrix Orbital and model number displayed). Before changing it to TTL, I've used my program to output on hyperterminal and it works, but trying to display it on LCD has been nothing less than a nightmare :(. I've been asking for assistance with my colleagues and they are just as clueless as to why it does not work. The following is my code (it is very small for I only want to clear screen).
#include <p24hj12gp201.h>
#include <stdlib.h>
#include <stdio.h>
#include <uart.h>
#define FCY 25000000
#define BAUDRATE 19200
#define BRGVAL ((FCY/BAUDRATE)/16)-1
///////////////////////////////////////////////////////////////////
int main ()
{
PORTBbits.RB4 = 1;
///***************************
// Assign U1Rx To Pin RP0
//***************************
RPINR18bits.U1RXR = 0;
//***************************
// Assign U1CTS To Pin RP1
//***************************
RPINR18bits.U1CTSR = 1;
//***************************
// Configure Output Functions
// (See Table 9-2)
//***************************
//***************************
// Assign U1Tx To Pin 11
//***************************
RPOR4bits.RP8R = 3;
//***************************
// Assign U1RTS To Pin 12
//***************************
RPOR4bits.RP9R = 4;
PLLFBD=38; // M=40
CLKDIVbits.PLLPOST=0; // N1=2
CLKDIVbits.PLLPRE=0; // N2=2
RCONbits.SWDTEN=0; // Disable Watch Dog Timer
while(OSCCONbits.LOCK!=1) {}; // Wait for PLL to lock
U1MODEbits.STSEL = 0; // 1-stop bit
U1MODEbits.PDSEL = 0; // No Parity, 8-data bits
U1MODEbits.ABAUD = 0; // Autobaud Disabled
U1MODEbits.BRGH = 0; // Low Speed mode
U1BRG = BRGVAL; // BAUD Rate Setting 19200
U1STAbits.UTXISEL1 = 0;
U1MODEbits.UARTEN = 1; // Enable UART
U1STAbits.UTXEN = 1; // Enable UART Tx
WriteUART1(254); //send to Clear Display
WriteUART1(88); //Fail :(
}
Much thanks for your assistance on this matter
Michel