3 How to Use DBG Pin
This chapter gives some examples for DBG pin setting in different modes.
3.1 Used as 1-line UART pin / P12 pin
In Debug mode, DBG pin is used as 1-line UART pin automatically. DBG pin keeps high
when UART is in idle status. In free-run mode, DBG pin is used as P12 by default. When the
following user code are written,
DDR1_D12 = 1;
// set P12 as output pin
PDR1_P12 = 0;
// pull P12 to low.
DBG pin still keeps high level after running user codes above in debug mode. DBG pin is
pulled to low level after running these codes in free-run mode.
3.2 Used as EC0 pin
DBG pin cannot be used as EC0 pin in debug mode. To realize the external clock input for
8/16 compound timer, EC0 pin can be changed to P04 pin in debug mode.
SYSC = 0xEB;
// set P04 as EC0 pin, disable HCLK1
T00CR0 = 0x71;
// interval timer, external clock source.
TMCR0 = 0x43;
// 8 bit mode, output T00.
T00DR = 0x08;
// set counter.
T00CR1 = 0x81;
// enable output, start T00.
P04 is set as EC0 pin in sample code above and T00 is set in continuous interval timer
mode. Execute the following operations by order, Input a clock signal to P04 pin
codes in debug mode
by 8.
SYSC = 0xE3;
// set P12 as EC0 pin, disable HCLK1
T00CR0 = 0x71;
// interval timer, external clock source.
TMCR0 = 0x43;
// 8bit mode, output T00.
T00DR = 0x08;
// set counter.
T00CR1 = 0x81;
// enable output, start T00.
P12 is set as EC0 pin in sample code above and T00 is set in continuous interval timer
mode. Execute the following operations by order, Input a clock signal to P12 pin
codes in free-run mode
by 8.
DBG pin operation V1.0
Chapter 3 How to Use DBG Pin
c heck T00 pin; then output clock can be used as input clock divided
→
c heck T00 pin, then output clock can be usde input clock divided
→
MCU-AN-500009-E-10 – Page 6
r un these
→
→
r un these