IO輸出和輸入/*按鍵連接RB1,點(diǎn)亮LED,PORTA RA0控制輸出。按一次點(diǎn)亮,再按一次熄滅,如此循環(huán)。RB外接上拉電阻。*/#include #define uchar unsigned char#define uint unsigned int// CONFIG#pragma config FOSC =
Led對應(yīng)管腳如下圖所示:所以需要設(shè)置GPB相關(guān)的寄存器,在IO Port里,Port B Control Register。有11個io input/output接口GPB5Led1GPB6Led2GPB7Led3GPB8Led4S3C2440存在接口復(fù)用,所以即需要設(shè)置PnCON以確定io口的功