Presentation is loading. Please wait.

Presentation is loading. Please wait.

Better Debugging of Embedded via a Debug Port ECE152.

Similar presentations


Presentation on theme: "Better Debugging of Embedded via a Debug Port ECE152."— Presentation transcript:

1 Better Debugging of Embedded via a Debug Port ECE152

2 Overview

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 Handling a 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 bits USBSn 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 #IFDEF DEBUG Serial code goes here... #ENDIF

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


Download ppt "Better Debugging of Embedded via a Debug Port ECE152."

Similar presentations


Ads by Google