|
|
View previous topic :: View next topic |
Author |
Message |
hadeelqasaimeh
Joined: 05 Jan 2006 Posts: 105
|
comunictino through rs232 and lcd proplem |
Posted: Thu Jan 05, 2006 1:22 pm |
|
|
hi all
i try to communication between two pic16f874 through rs-232 , iuse the interrput
(#int_rda)on the second pic,but ihave no good result on lcd which supposed
to print the recieved information from the first pic,its print some time nothig
and other time print some of string character and some times print correctly.
note: i use protuse to make run,the apply hardware ,....ineed to say that
my lcd is working correctly.
here is the code of first pic Code: |
#include <16f874.h>
#include "lcd_kbd1.c"
#include <string.h>
#fuses XT,NOWDT
#use delay(clock=4000000) //one instruction=1us
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
void main()
{
LCD_Init ( );
LCD_PutCmd ( CLEAR_DISP );
LCD_SetPosition ( LINE_16_1);
printf(LCD_PutChar," hello");
delay_ms(10000);
printf(" AT");
}//main
|
and here is the code of the second Code: |
#include <16f874.h>
#include "lcd_kbd1.c"
#include <string.h>
#fuses XT,NOWDT
#use delay(clock=4000000) //one instruction=1us
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
static char RX[30], string1[30], string0[30], ptr ;
static int1 jj;
static int8 i;
#int_rda
void serial_isr() {
RX[i++]=getch();
strcpy(string1,RX);
jj=1;
}
void main() {
enable_interrupts(GLOBAL);
enable_interrupts(INT_RDA);
jj=0;
LCD_Init ( );
if(jj==1) {
LCD_PutCmd ( CLEAR_DISP );
LCD_SetPosition ( LINE_16_1);
printf(LCD_PutChar,string1);
jj=0;
}//IF
}//MAIN
|
thanks alot |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
hadeelqasaimeh
Joined: 05 Jan 2006 Posts: 105
|
|
Posted: Sat Jan 07, 2006 10:31 am |
|
|
thanx alot the proplem is solved. |
|
|
hadeelqasaimeh
Joined: 05 Jan 2006 Posts: 105
|
strtok |
Posted: Sat Jan 07, 2006 10:36 am |
|
|
i need to print characters limited by two known char in a recieved string.
i use the same code above with some correction.
i tried to use strtok,but how to print on lcd????
please any help |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|