|
|
View previous topic :: View next topic |
Author |
Message |
Naiade Guest
|
Problem with RS232 |
Posted: Mon Mar 14, 2005 10:49 am |
|
|
Hi everybody, hope you can help me.
I have a hex compiled with the CCS 3.127 and works ok but I need to change some part of the code and I am using the last one (3.221) and I have a big problem ...
I'm working with a GSM modem and receiving some call I look for "\r\nRING\r\n" but sometimes I just received the \r o \r\n o a little bit more but it seems like the message doesn't arrive ...
someone has got this problem ? Is it a parameter I have to change in the new CCS
Thx for your help.
Naiade |
|
|
Guest
|
|
Posted: Mon Mar 14, 2005 11:04 am |
|
|
I add ther parameters I use
#USE RS232 (BAUD=9600, XMIT=PIN_C6, RCV=PIN_C7, PARITY=N, BITS=8)
thx again |
|
|
Guest
|
|
Posted: Mon Mar 14, 2005 11:29 am |
|
|
I put you the code to see if you see something strange.
#INCLUDE <18F452.h>
#FUSES XT,WDT128,WDT,PUT, NOLVP, NODEBUG
#DEVICE ADC=10
#INCLUDE <string.h>
#INCLUDE <stdlib.h>
#INCLUDE <math.h>
#USE delay(clock=3579000)
#USE RS232 (BAUD=9600, XMIT=PIN_D6, RCV=PIN_D7, PARITY=N, BITS=8,STREAM=SETUP) (this a second RS232 emulated with others I/O pins)
#USE RS232 (BAUD=9600, XMIT=PIN_C6, RCV=PIN_C7, PARITY=N, BITS=8) (this is the modem RS232
Char GetFromRX () {
char data;
if (RXItems > 0)
{
data = *RXInicio;
RXInicio ++;
if (RXInicio > &ColaRX[MAXCOLA-1]) RXInicio = &ColaRX[0];
RXItems --;
return (data);
}
else return(0);
}
#INT_RDA
void Receive (){
char data;
data = getc();
if (RXItems == MAXCOLA) error_fatal();
if (RXItems < MAXCOLA)
{
*RXFinal = data;
RXFinal ++;
IF (RXFinal > &ColaRX[MAXCOLA-1]) RXFinal = &ColaRX[0];
RXItems ++;
}
}
void main()
{
disable_interrupts(GLOBAL);
restart_wdt();
setup_counters(RTCC_INTERNAL, WDT_ON);
setup_wdt(WDT_ON);
restart_wdt();
set_tris_a(0b101111);
set_tris_c(0b11000000);
set_tris_e(0b011);
set_tris_d(0b10000000);
while (TRUE)
{
if (( a=GetfromRX() ) != 0) {recmes[i++]=a;lcd_putc(a);}
if (( i>2 ) && (recmes[i-1] == '\n') ) (LOOKING FOR THE \r\n\ring\r\n)
{
recmes[i]=0;
i=0;
if ( strcmp(recmes,ring) == 0) TAKETHECALL();
}
} |
|
|
Guest
|
|
Posted: Tue Aug 02, 2005 12:52 am |
|
|
|
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Sat Aug 06, 2005 9:47 am |
|
|
This forum is only for CCS Debuggers and Programmers Devices, not for general issues.
Nobody answer you because you posted in the wrong forum.
Go to General Discussion Forum and post the full code and compiler version
http://www.ccsinfo.com/forum/viewforum.php?f=1
Humberto |
|
|
|
|
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
|