c8051单片机使用smbus(I2C)接口的测试程序,keil开发环境-C8051 Singlechip use smbus (I2C) interface testing procedures, keil Development Environment
2023-03-23 11:24:49 64KB F020
1
FM25L16铁电存储器与F020读写 unsigned char SpiReadWrite(unsigned char c) { SPIF = 0; SPI0DAT = c; while (SPIF == 0); return SPI0DAT; } /* unsigned char FMRead(unsigned int addr) { unsigned char b; fm0(); _nop_(); _nop_(); _nop_(); _nop_(); SpiReadWrite(EE_READ); SpiReadWrite(addr >> 8); SpiReadWrite(addr & 0xff); b = SpiReadWrite(0); _nop_(); _nop_(); fm1(); _nop_(); _nop_(); return b; } void FMWrite(unsigned int addr, unsigned char b) { fm0(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); SpiReadWrite(EE_WREN); _nop_(); _nop_(); _nop_(); fm1(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); fm0(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); SpiReadWrite(EE_WRITE); SpiReadWrite(addr >> 8); SpiReadWrite(addr & 0xff); SpiReadWrite(b); _nop_(); _nop_(); fm1(); _nop_(); _nop_(); } */ void FMReadPage(unsigned int addr, unsigned char * index, unsigned char n) { unsigned char i; fm0(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); SpiReadWrite(EE_READ); SpiReadWrite(addr >> 8); SpiReadWrite(addr & 0xff); for(i=0;i> 8); SpiReadWrite(addr & 0xff); for(i=0;i
2021-09-13 11:18:57 2KB 铁电存储器
1
关于F020双串口示例,对于学习F020双串口是一个很好的例程
2021-07-18 16:07:11 1KB F020 双串口
1
实现单片机向PC机发送字符 PC机上显示
2021-03-11 19:32:01 3KB uart
1