1 / 13

Better Debugging of Embedded via a Debug Port

Better Debugging of Embedded via a Debug Port. ECE152. Overview. Why have a Debug Port? What is a UART? How does the Wunderboard UART work? #DEFINE. What is a Debug Port?. JTAG Digital Satellite, Later ECE courses I2C Proprietary AVR serial ISP Serial (UART).

hidi
Download Presentation

Better Debugging of Embedded via a Debug Port

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. Better Debugging of Embedded via a Debug Port ECE152

  2. Overview • Why have a Debug Port? • What is a UART? • How does the Wunderboard UART work? • #DEFINE

  3. What is a Debug Port? • JTAG • Digital Satellite, Later ECE courses • I2C • Proprietary • AVR serial ISP • Serial (UART)

  4. Understanding Asynchronous Serial (UART) • Agreed on message format • Start and Stop Bits • Parity • Agreed on speed

  5. AVR Hardware UART Peripheral

  6. Handlinga UART in software • Important Registers • USART I/O Data Register n– UDRn • USART Control and Status Register n A – UCSRnA • USART Control and Status Register n B – UCSRnB • USART Control and Status Register n C – UCSRnC • USART Baud Rate Registers – UBRRnL and UBRRnH

  7. Baud Rate • Speed of transmission • Units of bits per second (bps or baud)

  8. Start and Stop Bits • 1 start bit, 1 or 2 stop bitsUSBSn bit in UCSRnC

  9. FTDI UART to USB chip • Modern computers do not have RS232 • USB to UART converters maintain a simple interface • FTDI Chip works on Windows, Mac and Linux • Often driverless installation • Can be disabled to allow for Wunderboard to Wunderboard serial communication

  10. Voltages • Wunderboard • 3.3V • FTDI • 3.3 to 5V • Old School RS232 • ±12V

  11. Enabling and disabling Debug ports • Why Enable and Disable Debug? • Code Size • Code Speed • Security

  12. #ifdef and Preprocessor Statements • Preprocessor statements happen BEFORE compilation #define DEBUG#ifdefDEBUG Serial code goes here...#endif

  13. Things to Remember • Watch your flags to avoid buffer over run • Use #define to remove code before compilation

More Related