prizrak21
Joined: 16 Oct 2008 Posts: 2
|
UART interfaces (rs232) problem |
Posted: Thu Nov 06, 2008 5:08 am |
|
|
> 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.
> |
|