| View previous topic :: View next topic   | 
	 
	
	
		| Author | 
		Message | 
	 
	
		
			Marco27293
 
 
  Joined: 09 May 2020 Posts: 136
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				| DSPIC33EP512GP502 -- PCD v5.115  UART2 Enabling | 
			 
			
				 Posted: Fri May 03, 2024 3:01 am     | 
				     | 
			 
			
				
  | 
			 
			
				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: 19967
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Fri May 03, 2024 6:28 am     | 
				     | 
			 
			
				
  | 
			 
			
				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. | 
			 
		  | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
	 
	    
	   | 
	
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
  
		 |