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 CCS Technical Support

DSPIC33EP512GP502 -- PCD v5.115 UART2 Enabling

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



Joined: 09 May 2020
Posts: 126

View user's profile Send private message

DSPIC33EP512GP502 -- PCD v5.115 UART2 Enabling
PostPosted: Fri May 03, 2024 3:01 am     Reply with quote

Hi, in order to use and enable uart2 on dspic33 is it sufficient:

Code:

#define UART_2_TX           PIN_B11                                              // DsPIC UART2 TX
#define UART_2_RX           PIN_B12                                              // DsPIC UART2 RX
#PIN_SELECT U2TX=UART_2_TX
#PIN_SELECT U2RX=UART_2_RX
#use rs232(uart2,baud=115200,PARITY=N, BITS=8, ERRORS, RECEIVE_BUFFER=100, stream=SPECTRUM)


Or I also need to set to 1 UARTEN bit 15 in register U2MODE address 0x0230 ?

Regards,

Marco
Ttelmah



Joined: 11 Mar 2010
Posts: 19495

View user's profile Send private message

PostPosted: Fri May 03, 2024 6:28 am     Reply with quote

Totally sufficient, _BUT_, you must have an 'enable_interrupts(GLOBAL)',
in your code, since you are relying on an interrupt to handle the receive
buffer.
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