本人本月開發的兩塊屏幕的驅動和電路原理圖;
用了1月
附件中SSD1306和SSD1327的DEMON和原理圖;
用Cadence做的原理圖;
自都是自己原創;
0.png (5.71 KB, 下載次數: 59)
下載附件
2019-3-16 17:31 上傳
STM32單片機源程序如下:
- #include "stm32f10x.h"
- #include "delay.h"
- #include "InitGPIO.h"
- #include "Led.h"
- #include "Key.h"
- #include "exti.h"
- #include "iwdg.h"
- #include "timer.h"
- #include "usart.h"
- #include "OLED.h"
- #include "128_LCD.h"
- #include "IIC.h"
- #include "SPI.h"
- /***********&&&&牢記初始化函數&&&&***********/
- int main(void)
- {
- NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); //搶占優先級設置(012)不超過三位;
- uart_init(115200); //串口初始化
-
-
- InitGPIO();
- delay_init();
- SPI2_Init();
- SPI2_SetSpeed(SPI_BaudRatePrescaler_2);
-
- // IIC_Init();
- // OLED_Init();
- // OLED1305_Init();
- // timer2_Init(4999,7199); //TIM=500ms溢出時間
- // timer3_Init(287,499); //TIM=500ms溢出時間
- LCD_Init();
- // TIM3_PWM_Init(899,0); //不分頻,PWM頻率=72000000/900=80KHz
-
- // IWDG_Init(4,625); //獨立看門狗 最大溢出時間為1s
- // EXTIX_Init(); //外部中斷1
- // delay_ms(500);
- // WWDG_Init(0x7f,0x5f,WWDG_Prescaler_8); //0x5f上窗口,下窗口0x3f固定的,到達0x4f開啟中斷執行;0x7f給定
- // OLCD_Clean();
- u16 i=0;
- while(1)
- {
- // Key_up();
- // Led2 = 0;
- OLCD_Drive = 1;
- OLED_display_string_5x8(0,0,0,"5*7ASCII~!@#$%^&*()-+");
- delay_ms(10);
- OLED_display_string_5x8(8,0,0, "abcdefgABCDEFG1234567");
- delay_ms(10);
- for(i=0;i<256;i++)
- {
- LCD_SetContrast(i);
- delay_ms(10);
- }
-
- // SPI2_ReadWriteByte(0x77);
- Led2 = !Led2;
- // OLED_Clear(0xff);
- }
- }
- /***************************************
- // u16 led0pwmval = 0;
- // u8 dir = 1;
- delay_ms(10);
- if(dir) led0pwmval++;
- else led0pwmval--;
-
- if(led0pwmval>300) dir = 0;
- if(led0pwmval==0) dir = 1;
- TIM_SetCompare2(TIM3,led0pwmval); //PWM占空比裝載值
- ****************************************/
復制代碼
所有資料51hei提供下載:
STM32-OLED2x128_12864.7z
(1.54 MB, 下載次數: 163)
2019-3-16 17:31 上傳
點擊文件名下載附件
電路圖和代碼 下載積分: 黑幣 -5
|