Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. 16.3.2 EUSART ASYNCHRONOUS
  2. RECEIVER
  3. The receiver block diagram is shown in Figure 16-5.
  4. The data is received on the RB4/AN6/RX/DT/KBI0 pin
  5. and drives the data recovery block. The data recovery
  6. block is actually a high-speed shifter, operating at x16
  7. times the baud rate, whereas the main receive serial
  8. shifter operates at the bit rate or at FOSC. This mode
  9. would typically be used in RS-232 systems.
  10. To set up an Asynchronous Reception:
  11. 1. Initialize the SPBRGH:SPBRG registers for the
  12. appropriate baud rate. Set or clear the BRGH
  13. and BRG16 bits, as required, to achieve the
  14. desired baud rate.
  15. 2. Enable the asynchronous serial port by clearing
  16. bit SYNC and setting bit SPEN.
  17. 3. If interrupts are desired, set enable bit RCIE.
  18. 4. If 9-bit reception is desired, set bit RX9.
  19. 5. Enable the reception by setting bit CREN.
  20. 6. Flag bit, RCIF, will be set when reception is
  21. complete and an interrupt will be generated if
  22. enable bit RCIE was set.
  23. 7. Read the RCSTA register to get the 9th bit (if
  24. enabled) and determine if any error occurred
  25. during reception.
  26. 8. Read the 8-bit received data by reading the
  27. RCREG register.
  28. 9. If any error occurred, clear the error by clearing
  29. enable bit CREN.
  30. 10. If using interrupts, ensure that the GIE and PEIE
  31. bits in the INTCON register (INTCON<7:6>) are
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement