文件名称:iccavr_source
- 所属分类:
- 微处理器(ARM/PowerPC等)
- 资源属性:
- [Text]
- 上传时间:
- 2012-11-26
- 文件大小:
- 2kb
- 下载次数:
- 0次
- 提 供 者:
- 凌*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
M8 TLC2543
PB5-DATADIN
PB0-DATAOUT
PB1-#CS
PB2-CLOCK
//本程序没有使用tlc2543的EOC(转换结束标志)信号,片选一直处于选中,也可以自己加入片选信号
unsigned int tlc2543(unsigned char senddata)
{
unsigned int recdata = 0
unsigned int i = 0
senddata = 0B11010000 //控制字
recdata = 0 //接收到的转换结果数据
//PORTB &= 0B11111101 //片选使能(可选)
NOP()
NOP()
for(i=0 i<12 i++)
{
if(senddata & 0x80)
PORTB |= 0B00100000
else PORTB &= 0B11011111 //准备发送控制字
senddata <<= 1
if(PINB & 0x01)
recdata |= 0x0001
else recdata &= 0xfffe
recdata <<= 1 //接收上次转换结果-M8 TLC2543 PB5-DATADIN PB0-DATAOUT PB1-# CS PB2-CLOCK// This program does not use tlc2543 the EOC (end of conversion flag) signal, chip select has been in a select, you can also add their own chip-select signal unsigned int tlc2543 (unsigned char senddata) {unsigned int recdata = 0 unsigned int i = 0 senddata = 0B11010000 // control word recdata = 0 // receive the results of the data conversion// PORTB & = 0B11111101 // Chip Enable ( optional) NOP () NOP () for (i = 0 i < 12 i++) {if (senddata & 0x80) PORTB | = 0B00100000 else PORTB & = 0B11011111 // ready to send control words senddata < < = 1 if (PINB & 0x01) recdata | = 0x0001 else recdata & = 0xfffe recdata < < = 1 // Receive the last conversion result
PB5-DATADIN
PB0-DATAOUT
PB1-#CS
PB2-CLOCK
//本程序没有使用tlc2543的EOC(转换结束标志)信号,片选一直处于选中,也可以自己加入片选信号
unsigned int tlc2543(unsigned char senddata)
{
unsigned int recdata = 0
unsigned int i = 0
senddata = 0B11010000 //控制字
recdata = 0 //接收到的转换结果数据
//PORTB &= 0B11111101 //片选使能(可选)
NOP()
NOP()
for(i=0 i<12 i++)
{
if(senddata & 0x80)
PORTB |= 0B00100000
else PORTB &= 0B11011111 //准备发送控制字
senddata <<= 1
if(PINB & 0x01)
recdata |= 0x0001
else recdata &= 0xfffe
recdata <<= 1 //接收上次转换结果-M8 TLC2543 PB5-DATADIN PB0-DATAOUT PB1-# CS PB2-CLOCK// This program does not use tlc2543 the EOC (end of conversion flag) signal, chip select has been in a select, you can also add their own chip-select signal unsigned int tlc2543 (unsigned char senddata) {unsigned int recdata = 0 unsigned int i = 0 senddata = 0B11010000 // control word recdata = 0 // receive the results of the data conversion// PORTB & = 0B11111101 // Chip Enable ( optional) NOP () NOP () for (i = 0 i < 12 i++) {if (senddata & 0x80) PORTB | = 0B00100000 else PORTB & = 0B11011111 // ready to send control words senddata < < = 1 if (PINB & 0x01) recdata | = 0x0001 else recdata & = 0xfffe recdata < < = 1 // Receive the last conversion result
(系统自动生成,下载前可以参看下载内容)
下载文件列表
iccavr_source\ICCAVR源程序.txt
.............\修正版本.txt
iccavr_source
.............\修正版本.txt
iccavr_source