5. •
0 • •1
MUX Control Bit
0 = I/O Function
1 = Primary Function
Pin
Primary
Peripheral
Function
I/O DAT
Bit (R/W) In
Out
•
I/O DIR Bit
0 = Input
1 = Output GPxMUX
GPxDIR
GPxDAT
QUALPRDreserved
7 - 015 - 8
GPxQUAL
00h
01h
no qualification (SYNC to SYSCLKOUT)
QUALPRD = SYSCLKOUT/2
0
.2h
.
FFh
QUAL
.PRD = SYSCL
.KOUT/4
. .
QUALPRD = SYSCLKOUT/510
Some digital I/O and
peripheral I/O input
signals include an
Input Qualification
feature
C28x GPIO Functional Block Diagram
RANJA
N
SINGH
6. C28x GPIO MUX/DIR Registers
Address Register Name
70C0h
70C1h
70C2h
GPAMUX
GPADIR
GPAQUAL
GPIO A Mux Control Register
GPIO A Direction Control Register
GPIO A Input Qualification Control Register
70C4h
70C5h
70C6h
GPBMUX
GPBDIR
GPBQUAL
GPIO B Mux Control Register
GPIO B Direction Control Register
GPIO B Input Qualification Control Register
70CCh
70CDh
70CEh
GPDMUX
GPDDIR
GPDQUAL
GPIO D Mux Control Register
GPIO D Direction Control Register
GPIO D Input Qualification Control Register
70D0h
70D1h
70D2h
GPEMUX
GPEDIR
GPEQUAL
GPIO E Mux Control Register
GPIO E Direction Control Register
GPIO E Input Qualification Control Register
70D4h
70D5h
GPFMUX
GPFDIR
GPIO F Mux Control Register
GPIO F Direction Control Register
70D8h
70D9h
GPGMUX
GPGDIR
GPIO G Mux Control Register
GPIO G Direction ControlRegister
RANJA
N
SINGH
7. Address Register Name
70E0h
70E1h
70E2h
70E3h
GPADAT
GPASET
GPACLEAR
GPATOGGLE
GPIO A Data Register
GPIO A Set Register
GPIO A Clear Register
GPIO A ToggleRegister
70E4h
70E5h
70E6h
70E7h
GPBDAT
GPBSET
GPBCLEAR
GPBTOGGLE
GPIO B Data Register
GPIO B Set Register
GPIO B Clear Register
GPIO B ToggleRegister
70ECh
70EDh
70EEh
70EFh
GPDDAT
GPDSET
GPDCLEAR
GPDTOGGLE
GPIO D Data Register
GPIO D Set Register
GPIO D Clear Register
GPIO D ToggleRegister
70F0h
70F1h
70F2h
70F3h
GPEDAT
GPESET
GPECLEAR
GPETOGGLE
GPIO E Data Register
GPIO E Set Register
GPIO E Clear Register
GPIO E ToggleRegister
70F4h
70F5h
70F6h
70F7h
GPFDAT
GPFSET
GPFCLEAR
GPFTOGGLE
GPIO F Data Register
GPIO F Set Register
GPIO F Clear Register
GPIO F ToggleRegister
70F8h
70F9h
70FAh
GPGDAT
GPGSET
GPGCLEAR
GPIO G Data Register
GPIO G Set Register
GPIO G ClearRegister
C28x GPIO Data Registers
GPGTOGGLE
RANJA
N
SINGH
11. RANJA
N
SINGH
Watchdog Timer
• Resets the C28x if the CPU crashes
–
–
–
Watchdog counter runs independent of CPU
If counter overflows, reset or interrupt is triggered
CPU must write correct data key sequence to reset the counter before
overflow
• Watchdog must be serviced (or disabled) within ~4,3ms after reset (30 MHz
external clock)
• This translates into 6.3 million instructions!
13. RANJA
N
SINGH
Watchdog Timer
Control Register
• WDCR @ 7029h
7 6 5 4 3 2 1 0
reserved WDFLAG WDDIS WDCHK2 WDCHK1 WDCHK0 WDPS2 WDPS1 WDPS0
Logic Check Bits WD Prescale
Write as 101 or reset Selection Bits
immediately triggered
Watchdog Disable Bit
(Functions only if WD OVERRIDE
bit in SCSR is equal to 1)
15 - 8
WD Flag Bit
Gets set when the WD causes a reset
• Writing a 1 clears this bit
• Writing a 0 has no effect
14. RANJA
N
SINGH
Resetting the Watchdog
• Allowable write values:
55h - counter enabled for reset on next AAh write
AAh - counter set to zero if reset enabled
• Writing any other value immediately triggers a CPU reset
• Watchdog should not be serviced solely in an ISR
–
– If main code crashes, but interrupt continues to execute, the watchdog
will not catch the crash
Could put the 55h WDKEY in the main code, and the AAh WDKEY in an
ISR; this catches main code crashes and also ISR crashes
WDKEY @ 7025h
7 6 5 4 3 2 1 0
reserved D7 D6 D5 D4 D3 D2 D1 D0
15 - 8
15. RANJA
N
SINGH
Sequential
Step
Value Written
to WDKEY Result
1 AAh No action
2 AAh No action
3 55h WD counter enabled for reset on next AAh write
4 55h WD counter enabled for reset on next AAh write
5 55h WD counter enabled for reset on next AAh write
6 AAh WD counter is reset
7 AAh No action
8 55h WD counter enabled for reset on next AAh write
9 AAh WD counter is reset
10 55h WD counter enabled for reset on next AAh write
11 23h CPU reset triggered due to improper write value
WDKEY Write Results
16. RANJA
N
SINGH
System Control and Status Register
SCSR @ 7022h
WD Override (protect bit)
After RESET - bit gives user ability to disable WD by
setting WDDIS bit=1 in WDCR
•clear only bit and defaults to 1 after reset
0 = protects WD from being disabled by s/w
•bit cannot be set to 1 by s/w (clear-only by writing 1)
1 = (default value) allows WD to be disabled using
WDDIS bit in WDCR
• once cleared, bit cannot set to 1 by s/w
15 - 3 2 1 0
reserved WDINTS WDENINT
WD
OVERRIDE
WD Interrupt Status
(read only)
0 = active
1 = not active
WD Enable Interrupt
0 = WD generates a DSPreset
1 = WD generates a WDINT interrupt