CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Problem with RS232

 
Post new topic   Reply to topic    CCS Forum Index -> CCS ICD / Mach X / Load-n-Go
View previous topic :: View next topic  
Author Message
Naiade
Guest







Problem with RS232
PostPosted: Mon Mar 14, 2005 10:49 am     Reply with quote

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








PostPosted: Mon Mar 14, 2005 11:04 am     Reply with quote

I add ther parameters I use

#USE RS232 (BAUD=9600, XMIT=PIN_C6, RCV=PIN_C7, PARITY=N, BITS=8)

thx again
Guest








PostPosted: Mon Mar 14, 2005 11:29 am     Reply with quote

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








PostPosted: Tue Aug 02, 2005 12:52 am     Reply with quote

Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Twisted Evil Twisted Evil Twisted Evil Twisted Evil Question Question Question Idea Idea Idea Arrow Arrow Arrow Wink Rolling Eyes Mad Razz Embarassed Crying or Very sad Laughing Cool Confused Shocked Very Happy Smile Sad Surprised
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat Aug 06, 2005 9:47 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> CCS ICD / Mach X / Load-n-Go All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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