1、液晶买3.3V电源的,液晶的第三脚对比度要用103的电位器,这样可以调节对比度,不然看不到的
RS:PB5 RW:PB6; EN:PB7 DB0~DB7接PA0~PA7; VO拉电位器,1脚VSS接GND,2脚VDD接3.3V,15脚接3.3V,16脚接GND.
2、 "sys.h"文件
#ifndef __SYS_H
#define __SYS_H
#include "stm32f10x.h"
#define SYSTEM_SUPPORT_UCOS 0
#define BITBAND(addr, bitnum) ((addr & 0xF0000000)+0x2000000+((addr &0xFFFFF)<<5)+(bitnum<<2))
#define MEM_ADDR(addr) *((volatile unsigned long *)(addr))
#define BIT_ADDR(addr, bitnum) MEM_ADDR(BITBAND(addr, bitnum))
#define GPIOA_ODR_Addr (GPIOA_BASE+12) //0x4001080C
#define GPIOB_ODR_Addr (GPIOB_BASE+12) //0x40010C0C
#define GPIOC_ODR_Addr (GPIOC_BASE+12) //0x4001100C
#define GPIOD_ODR_Addr (GPIOD_BASE+12) //0x4001140C
#define GPIOE_ODR_Addr (GPIOE_BASE+12) //0x4001180C
#define GPIOF_ODR_Addr (GPIOF_BASE+12) //0x40011A0C
#define GPIOG_ODR_Addr (GPIOG_BASE+12) //0x40011E0C


564

被折叠的 条评论
为什么被折叠?



