portb.txt
来自「picc_18v 8.35pl35 PIC18系列单片机开发C编译器」· 文本 代码 · 共 33 行
TXT
33 行
Title: portb
Target: PIC18C658
Description:
A demonstration PORTB, the interruptable port. External influences
on PORTB can trigger up to 5 different interrupts. There are 4
edge triggered interrupt sources on pins 0-3. The fifth interrupt
occurs if there is any change on input pins 4-7.
Controls:
A RED DIP switch is used to act on PORTB pins 0-3. These are the
pins that trigger an interrupt is the correct edge sensitive
event has been detected. To select between rising or falling edge
interrupts, use the switch. When such an interrupt has occurred,
the corresponding yellow LED will blink for a period of time.
A BLUE DIP switch acts on PORTB pins 4-7. These pins will cause
an interrupt on any change at all. The interrupt routine itself
interprets what kind of change has occurred.
A low to high transition will cause a BLUE LED to blink for a
period of time, whereas a HIGH to LOW transition will cause the
GREEN LED to blink for a period of time.
Connections to the PIC18C658:
LED YELLOW [0:3] -> PORTC[0:3]
DIP RED [1:4] -> PORTB[0:3]
Switch 1 -> PORTA5
LED BLUE [0:3] -> PORTC[4:7]
DIP BLUE [1:4] -> PORTB[4:7]
LED GREEN -> PORTA6
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?