I am new to this forum and just started studying electronics gotta project to build system that takes a message from a PC unit and then sends the message to a PIC and then displays the message on an LCD using pic16F690,max232 and 2 x 16 LCD
Project includes
1)develop a program that displays a message on a LCD when button RA1 is pressed.
2) develop wiring diagrams to connect the PIC to a PC and convert the PC voltage levels to PIC based voltage levels using a MAX232C chip.
3) develop a program that receives a message through the PIC RS232c communication port when button RA2 is pressed (you can use hyper terminal to test this program).
7) develop wiring diagrams to connect the PC to a PIC and convert the PC voltage levels to PIC based voltage levels using a MAX232C chip.
8)connect the PIC to the PC and display a PC information on the LCD display
I built the circuit and it works fine with computer. I am having trouble to connect LCD to pic16F690. my MPLAB codes are given below. I just compiled it and it works. don't know much about coding though.
Could you help me out please.
Thank You.
Project includes
1)develop a program that displays a message on a LCD when button RA1 is pressed.
2) develop wiring diagrams to connect the PIC to a PC and convert the PC voltage levels to PIC based voltage levels using a MAX232C chip.
3) develop a program that receives a message through the PIC RS232c communication port when button RA2 is pressed (you can use hyper terminal to test this program).
7) develop wiring diagrams to connect the PC to a PIC and convert the PC voltage levels to PIC based voltage levels using a MAX232C chip.
8)connect the PIC to the PC and display a PC information on the LCD display
I built the circuit and it works fine with computer. I am having trouble to connect LCD to pic16F690. my MPLAB codes are given below. I just compiled it and it works. don't know much about coding though.
Rich (BB code):
#define _LEGACY_HEADERS
#include <htc.h>
#include "lcd.h"
#include <stdio.h>
#include "usart.h"
void pause( unsigned short usvalue ); //Establish pause routine function
unsigned char b0,input,count;
#define number 0x30
__CONFIG (INTIO & WDTDIS & MCLRDIS & UNPROTECT);
void main(void)
{
ANSEL = 0; // Set PORTA all Digital
ANSELH = 0;
CM1CON0 = 0; // Comparator 1 off
CM2CON0 = 0; // Comparator 2 off
TRISA = 0; // All PORTA Outputs
TRISC = 0; // All PORTC Outputs
lcd_init(); // Initialize LCD Display
INTCON=0; // purpose of disabling the interrupts.
init_comms(); // set up the USART - settings defined in usart.h
// running LCD
while (1==1)
{
lcd_clear(); // Clear LCD screen
lcd_goto(0); // select first line
for (b0=0; b0<10; b0=b0+1) // Create counting loop
{
lcd_putch(b0+number); // Display count on LCD
pause (250); // Delay 250 msec to see count
}
lcd_goto(0x40); // Select second line
lcd_puts("Hello World"); // Display Hello World
pause (1000); // Delay for 1 second to read display
}
while(1)
{
for (count = 0x31; count <= 0x39; count = count +1)
{
putch(count); // Send Count in ASCII
input = getch(); // Read a response from the user
putch(input); // Echo back response
}
while(1)
{
printf("Press a key and I will echo it back:\r\n");
input = getch(); // read a response from the user
printf("I detected [%c]\r\n",input); // echo it back
}
}
}
Thank You.
Last edited by a moderator: