| 时钟是用的ds1302吗 |
|
你好,谢谢大佬的分享,这对我这个菜鸟有巨大的帮助。不过对于大佬的工程里有些疑问,如果大佬能抽空回答一下我的问题,感激不尽。 疑问:在函数lcdinit()中,lcd的初始化用的始终是同一个函数lcdwrc4bit(),而在此函数中,每次只能4bit初始化,想问大佬,后面的08H,01H,06H,0CH的初始化如何完成? 附上我对lcdwrc4bit函数的注释:(乱码部分不影响程序) void lcdwrc4bit(long c) { while(readbusy()); //readbusy = f=1 --> busy --> LOOP WITA GPIO_ResetBits(GPIOB,rs); //rs=0 GPIO_ResetBits(GPIOB,rw); //rw=0 GPIO_ResetBits(GPIOB,e); //e=0 delayms(1); //IF C = 0011 0010 -> GPIOB->BSRR = c<<8 & 0xf000; //½«êy¾YËíμ½P0¿ú yfr//BSRR = 0011 0000 0000 0000 -> //D7~D0 = 0011 0000 GPIOB->BRR = ((~c)<<8) & 0xf000; // BRR = 1100 0000 0000 0000 -> delayms(1); GPIO_SetBits(GPIOB,e); //e=1 -> delayms(1); // -> here a pulse -> get D7~D4 GPIO_ResetBits(GPIOB,e);//e=0 -> delayms(1); //IF C = 0011 0010 -> GPIOB->BSRR = c<<12 & 0xf000; //½«êy¾YËíμ½P0¿ú yfr//BSRR = 0010 0000 0000 0000 -> //D7~D0 = 0010 0000 GPIOB->BRR = ((~c)<<12) & 0xf000; // BRR = 1101 0000 0000 0000 -> delayms(1); GPIO_SetBits(GPIOB,e); delayms(1); //e=1 -> GPIO_ResetBits(GPIOB,e);// -> here a pulse -> get D7~D4 delayms(1); //e=0 -> } |