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 support@ccsinfo.com

Weird problem for working on 2 UARTs

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
miskol



Joined: 01 Feb 2011
Posts: 16

View user's profile Send private message

Weird problem for working on 2 UARTs
PostPosted: Fri Oct 07, 2011 7:17 pm     Reply with quote

Hey guys,

I'm using PCWHD v4.114 for programming dsPIC30F6014A. Below is my coding:

Dual UART initialization
Code:
#use rs232(UART1,baud=9600,parity=N,bits=8,xmit=PIN_F3,rcv=PIN_F2,ERRORS,stream=MCC)
#use rs232(UART2,baud=9600,parity=N,bits=8,xmit=PIN_F5,rcv=PIN_F4,ERRORS,stream=GSM)


Code:
fprintf(MCC,"test dual RS232, this is UART1\n\r");
fprintf(GSM,"test dual RS232, this is UART2\n\r");

- this froze the mC, nothing comes out of UART.

Code:
fputc(0x41,MCC); //A in Hex
fputc(0x54,GSM); //T in Hex

- works, no problem.

Code:
puts("UART1", MCC);
puts("UART2", GSM);

- works, no problem.

Code:
fprintf(MCC,"test dual UART\n\r");
fprintf(GSM,"test dual UART\n\r");

- works, no problem.


So, it seems like if string is similar for both UARTs, fprintf can work... if not, nothing comes out.

Code:
fprintf(MCC,"test dual RS232\n\r");
fprintf(GSM,"test dual RS232\n\r");
delay_ms(100);
fprintf(MCC,"test dual UART\n\r");
fprintf(GSM,"test dual UART\n\r");

- this froze the mC, nothing comes out of UART.

Even so, if needed to change the string, still cannot work.

Please help, thank you.
miskol



Joined: 01 Feb 2011
Posts: 16

View user's profile Send private message

PostPosted: Thu Oct 13, 2011 8:17 am     Reply with quote

Please help anyone? Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Oct 13, 2011 1:09 pm     Reply with quote

Most people don't have the PCD compiler. I don't have it. That's why
I didn't respond. This type of problem is "right up my alley", but I can't
help you.
temtronic



Joined: 01 Jul 2010
Posts: 9163
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Oct 13, 2011 1:44 pm     Reply with quote

Well , I've got the compiler, but don't have any dsPICs ! So I can't help either as I only test with real chips.
miskol



Joined: 01 Feb 2011
Posts: 16

View user's profile Send private message

PostPosted: Thu Oct 13, 2011 7:48 pm     Reply with quote

Noted, thanks for the responses.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion 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