|
|
View previous topic :: View next topic |
Author |
Message |
miskol
Joined: 01 Feb 2011 Posts: 16
|
Weird problem for working on 2 UARTs |
Posted: Fri Oct 07, 2011 7:17 pm |
|
|
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
|
|
Posted: Thu Oct 13, 2011 8:17 am |
|
|
Please help anyone? Thanks. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Oct 13, 2011 1:09 pm |
|
|
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: 9225 Location: Greensville,Ontario
|
|
Posted: Thu Oct 13, 2011 1:44 pm |
|
|
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
|
|
Posted: Thu Oct 13, 2011 7:48 pm |
|
|
Noted, thanks for the responses. |
|
|
|
|
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
|