MSP430 F5529 硬件SPI OLED 单片机 0.96英寸7针OLED SPI 6针OL
2021-02-02 来源:eefocus
https://www.ti.com/lit/ug/slau533d/slau533d.pdf
UCA0 用了这个串口就不能用了
P2.7//UCA0CLK
P3.2//UCA0STE
P3.3/UCA0TXD/UCA0SIMO
P3.4/UCA0RXD/UCA0SOMI
#include #include 'oled.h' #include 'bmp.h' // | P3.4|<- Data In (UCA0SOMI) // | F5 P3.3|-> Data Out (UCA0SIMO) --D1(OLED) // | P2.7|-> Serial Clock Out (UCA0CLK) --D0(OLED) // | P2.0|->RES(OLED) 任意指定一个引脚 // | P2.2|->DC(OLED) 任意指定一个引脚 // | GND|->CS(OLED) 直接接GND片选上OLED int main(void) { WDTCTL = WDTPW + WDTHOLD; /* Stop WDT */ OLED_Init(); /* OLED初始化 */ OLED_DrawBMP(0,0,128,64,BMP1); while (1) { } } UCB0 P2.7/UCB0STE/ P3.0/UCB0SIMO/ P3.1/UCB0SOMI/ P3.2/UCB0CLK/ // | P3.1|<- Data In (UCB0SOMI) // | F5 P3.0|-> Data Out (UCB0SIMO) --D1(OLED) // | P3.2|-> Serial Clock Out (UCB0CLK) --D0(OLED) // | P2.0|->RES(OLED) 任意指定一个引脚 // | P2.2|->DC(OLED) 任意指定一个引脚 // | GND|->CS(OLED) 直接接GND片选上OLED