View previous topic :: View next topic |
Author |
Message |
natan
Joined: 08 Oct 2009 Posts: 3
|
Which PIC24 have fully working UART1 and UART2 implemented |
Posted: Tue Oct 27, 2009 10:27 pm |
|
|
Does anyone know if any PIC24's have been fully implemented in terms of their UART functions in v. 4.099? Or are there any other PICs with multiple hardware UARTs that are currently fully supported by built in functions? |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Wed Oct 28, 2009 12:53 am |
|
|
As far as I see, all PIC24 UARTs are supported by PCD built-in functions.
With newer chips, you have to use pin_select statements, e.g.:
Code: | #pin_select U1RX=PIN_B9
#pin_select U1TX=PIN_B8
#use rs232(UART1,baud=9600,parity=N,bits=8,stream=uart1)
#pin_select U2RX=PIN_B3
#pin_select U2TX=PIN_B4
#use rs232(UART2,baud=19200,parity=N,bits=8,stream=uart2)
fprintf(uart2,"Program start");
k=getc(); // refers to the last use rs232 statement, UART2 in this case
k=fgetc(uart1); |
|
|
|
richi-d
Joined: 28 Aug 2007 Posts: 106
|
|
Posted: Wed Dec 16, 2009 10:36 am |
|
|
Hello,
The PIC 24 UART doesn't work. I have seen that the UARTEN bit is "0". After your code FVM... whats now to do? |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Wed Dec 16, 2009 2:43 pm |
|
|
You didn't say about the involved PIC, so I can't comment further on it. I'm using all four UARTS of a PIC24FJxxGA010. Because the built-in functions didn't work with previous PCD versions, I'm using partly direct SFR access to setup the UART, but I verified, that #use RS232 is operational as well.
You may want to post a complete chip and UART setup example, and we'll see, what PCD does with it. |
|
|
|