我指的是http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2123¶m=en024284上的一个简单程序(示例2
#include "p33Fxxxx.h"
#pragma config WDT = OFF
void main (void)
{
TRISB = 0;
/* Reset the LEDs */
PORTB = 0;
/* Light the LEDs */
LATB = 0x005A;// tested with PORTB= 0X005A;at first, no change of PORTB in watch
window
while (1)
;
}在监视窗口中,latchB成功更改为0x5A,而PORTB仍为0x0000。我想知道为什么会这样。如果我将端口B连接到LED,它们会亮起吗?
发布于 2013-01-23 16:12:18
哦,我忘了通过AD1PCFGL=0xffff将模拟输入设置为数字;
https://stackoverflow.com/questions/14412672
复制相似问题