View previous topic :: View next topic |
Author |
Message |
TMLtech
Joined: 20 Jul 2011 Posts: 21 Location: Finland
|
UART problem with DSPIC33EP512GP806 |
Posted: Sun Dec 15, 2013 7:11 am |
|
|
Hello for everyone. I tried to set up hardware uart for DSPIC33EP512GP806 and i can't found which pin it is? Can somebody help. Datasheet says there are four hardware uart port but i don't found any? Maybe i'm blind..
How can i declare it?
Thank you for your help.
Compiler: 4.140 and MPLAD IDE plugin. Mplab version is v8.91 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19520
|
|
Posted: Sun Dec 15, 2013 11:50 am |
|
|
You need to study the datasheet. On most of these chips, peripherals are on 'RP' pins (relocatable peripheral). With these you can route the required peripherals to _any_ suitable RP pin.
The command to do this in CCS, is #PIN SELECT. So you can specify the peripheral pin, and which physical pin you want to connect it to. Repeat for all eight pins from the UARTs. Then on the #USE RS232, just use the UART name, instead of pins, and the connections are made.
Look at Ex_PinSelect.c, and ExPinSelect2.c for simple examples.
Best Wishes |
|
|
TMLtech
Joined: 20 Jul 2011 Posts: 21 Location: Finland
|
|
Posted: Mon Dec 16, 2013 12:50 am |
|
|
Thank you very much Mr. Ttelmah! Now I can be sure for that. And the example says:
Code: |
#pin_select U2TX = PIN_C9
#pin_select U2RX = PIN_C3
#pin_select OC1 = PIN_B7
#use rs232(baud=9600, UART2,ERRORS) |
|
|
|
|