1 / 17

Lab 7 – Serial RF Communication

Lab 7 – Serial RF Communication. Start date: Week #10 Due date: Week #11. Serial Communications. 2 types of serial ports on the HC12 Serial communication interface (SCI) = asynchronous Serial Peripheral Interface (SPI) = synchronous

vito
Download Presentation

Lab 7 – Serial RF Communication

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab 7 – Serial RF Communication Start date: Week #10 Due date: Week #11

  2. Serial Communications • 2 types of serial ports on the HC12 • Serial communication interface (SCI) = asynchronous • Serial Peripheral Interface (SPI) = synchronous • Know which one you want to use (RF has no clock signal pin)

  3. SCI • Communication through port S • SCI0 = PS0 (RxD), PS1 (TxD) • SCI1 = PS2 (RxD), PS3 (TxD) • Can do parity (either even or odd) • Supports 8 or 9 data bits • SC0 is in use – communication with terminal

  4. Registers • SC0CR1/SC1CR1 • Mode • Parity • SC0CR2/SC1CR2 • Transmit and receive enables • Interrupt enables • SC0SR1/SC1SR1 • Flags for complete and errors

  5. Registers • SC0DRH/L / SC1DRH/L • Register to send/receive data through SCI • We will be using 8 data bits, so only low is required

  6. Modes to use • Please set to use • 1 start, 8 data, 1 stop • No parity • 9600 baud • Warning SC0 is already in use – this is what you use to communicate with the terminal

  7. RF module • The RF module sends and receives in 2 directions • From board to RF, from RF to board • The RxD and TxD lines are in reference to the RF, ie send and receive over RF • These will seem backwards from board • For RF modules with bent pins – just stick them upright into the board • Warning: sometimes the power light comes on when TxD or RxD is high – you still need to hook up the power or it will not work

  8. Sending Messages • Special Characters in use • SOH – start of header • ASCII $01 • STX – start of text • ASCII $02 • ETX – end of text • ASCII $03 • EOT – end of transmission • ASCII $04

  9. Sending Messages • Special Characters • The base station prints the characters as text because it is easier to read • When you are printing you will see them as special characters (^x)

  10. Message Passing • Base station sends out message to a group • That group stores/prints the message and replies • The base station stores/prints the message and replies • The group stores/prints the message

  11. Message Format – Base Station • Base Station 1st send Message • SOH • GroupXX • STX • Message • ETX • EOT

  12. Message Format - groupXX • Group Reply • STX • Some message less than 20 chars • ETX • EOT

  13. Message Format – Base Station • Base Station Reply to group • SOH • GroupXX • STX • Some other message • ETX • EOT

  14. Summary of message passing

  15. General Notes / Hints • Please put a short delay between when you finish receiving and when you start sending • We will wait for 1 second for a reply from each group • Be aware that you may not receive anything for that time • it can be much longer than that before you receive a message for your own group • Please do not send in other people’s time • The RF modules cannot determine which is the correct signal and the messages will get messed

  16. Testing • The base station will stay on for the whole week before the lab is due – front row • Sending and receiving messages will be printed on the screen • The TA’s will transmit as the last group (group 7) • This is to check that the BS is actually transmitting • If you don’t see the TA group message, the base station may not actually be transmitting • We will try to check on it, but if there is a problem, please email us

  17. Academic Misconduct • Reports and demos are submitted as a group, but it is a SINGLE group effort • You may talk with other groups but sharing code or reports is NOT ALLOWED • Copying code/reports from previous years is also NOT ALLOWED • If we find copying we are REQUIRED to report it

More Related