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

UART interfaces (rs232) problem

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



Joined: 16 Oct 2008
Posts: 2

View user's profile Send private message

UART interfaces (rs232) problem
PostPosted: Thu Nov 06, 2008 5:08 am     Reply with quote

> Hello,
>
>
>
> I am using a PIC24FJ256GB106 and I want to use two of its hardware UART interfaces (rs232).
>
> I am also using PCWHD version 4.081.
>
>
>
> For that I wrote the following code:
>
>
>
>
>
> #include<24FJ256GB106.h>
>
>
>
> //--------------------------fuses------------------------------------------
>
> #fuses HS,NOWDT, PR_PLL, PLL2, NODEBUG
>
>
>
> #use delay(clock=32000000)
>
>
>
> #byte TRISE = 0x02E0
>
> #byte LATE = 0x02E4
>
> #byte TRISG = 0x02F0
>
>
>
> //BT_UART
>
> #byte RPINR18L = 0x06A4 //Peripheral Pin Select Input Register(lower byte): UART1 Receive
>
> #byte RPOR1H = 0x06C3 //Peripheral Pin Select Output Register(higher byte): RP3
>
>
>
> //PC_UART
>
> #byte RPINR19L = 0x06A6 //um RX2 auf RP19 einzustellen
>
> #byte RPOR13L = 0x06DA //um TX2auf RP26 einzustellen
>
>
>
>
>
> #use rs232(baud = 115200, parity = N, bits = 8,stop =1,UART1, Stream = PC)
>
> #use rs232(baud = 115200, parity = N, bits = 8,stop =1, UART2, Stream = BT)
>
>
>
> void main(){
>
>
>
> RPINR18L = 0x0C; // UA1T_RX (RP12)
>
> RPOR1H = 0x03; //UA1T_TX (RP3)
>
> RPINR19L = 0x13; // UA2T_RX (RP19)
>
> RPOR13L = 0x05; // UA2T_TX (RP26)
>
>
>
> while(true)
>
> {
>
> fprintf(PC,"Hello\r");
>
> }
>
> }
>
>
>
>
>
> When I compile this code, I get the following error message according to the marked code line, although the microcontroller has 4 different hardware UART units:
>
>
>
> "USE parameter value is out of range No Second UART"
>
>
>
> Could you please tell me, why do I get that error message and how can I otherwise implement 2x RS232 interfaces.
>
>
>
> Thank you very much in advance.
>
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