N76E003 没有采用外部复位,P04 P05 PWM输出端口。
选择发现上电后,P04 P05高电平到PWM正常输出,这个时间居然达到1s多。
这个N76E003 自身的复位时间是多少的?
搞不懂问题出在哪里? 请指教
开始运行的程序,很简单,如下:
void main()
{
uchar state_key = 0;
uchar cct_to_set;
uchar bright_to_set;
uchar w_duty,c_duty;
uchar w_duty_to_set,c_duty_to_set;
Set_All_GPIO_Quasi_Mode;
P04_PushPull_Mode;
P05_PushPull_Mode;
P04 = 0; // 这里已经拉低了,为什么P04 P05还输出高电平?
P05 = 0;
lcd_init();
pwm_init();
Timer1_Delay10ms(100);
ReadDataFlash (0x3800,&cct,1); //read cct and bright value in EEPROM(flash)
ReadDataFlash (0x3801,&bright,1);
cct_to_set = cct;
bright_to_set = bright;
c_duty = ((unsigned int)((cct - MIN_CCT)*bright))/(MAX_CCT-MIN_CCT);
w_duty = bright - c_duty;
w_duty_to_set = w_duty;
c_duty_to_set = c_duty;
show_cct(cct);
show_bright(bright);
pwm_set(c_duty,c_led_channel);
pwm_set(w_duty,w_led_channel);
|