 
- UID
- 123796
- 性别
- 男
|
版主大人,想用P口的4脚用作普通IO口,可是,在该脚加低电平后,也进不去第二个低电平判断的IF,到底怎么设置啊??另外,我用示波器看该管脚为一个波形,奇怪啊!哪位有IO初始化的例程,参考一下,谢谢!
void main(void) {
DDRP_DDRP4 = 0;
PERP_PERP4 = 0;
DDRP_DDRP6 = 1;
DDRK_BIT1 = 1;
EnableInterrupts;
for(;;) {
if(PTP_PTP4 = 1){
PTP_PTP6 = 0;
PORTK_BIT1 = 0;
}
if(PTP_PTP4 = 0){
PORTK_BIT1 = 1;
delay_1ms(1000);
PTP_PTP6 = 1;
}
}
} |
|