Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. //Set Analog pins as digital...
  2. ADCON1=0X0F;
  3. ///////////////////////////////
  4.  
  5. //Initialize UART2 module with Peripheral Pin Select
  6. Unlock_IOLOCK();
  7. PPS_Mapping_NoLock(0, _INPUT, _RX2_DT2);
  8. PPS_Mapping_NoLock(1, _OUTPUT, _TX2_CK2);
  9. Lock_IOLOCK();
  10. delay_ms(100);
  11. UART_Remappable_Init(9600);
  12. ////////////////////////////////////////////////////
  13.  
  14. //Initialize UART1 module
  15. delay_ms(100);
  16. UART1_Init(9600);
  17. Delay_ms(300);
  18. /////////////////////////
  19.  
  20. //Infinite Loop...
  21. while (1)
  22. {
  23. if (UART_Remappable_Data_Ready()==1)
  24. {
  25. UART_Remappable_Read_Text(output, "OK", 15);
  26. UART_Remappable_write_Text(output);
  27. delay_ms(100);
  28. }
  29. }//loop ends......
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement