文件名称:FM3104_ETC_258776
介绍说明--下载内容均来自于网络,请自行研究使用
#include
intvcon 输出电压变量
sbitDIN=0x91 定义P2.1为串行数据口
sbitCLK=0x92;P2.2为串行时钟端
sbitCS=0x93 P2.3为片选端
voiddac5618(intvcon)TLC5618DAC子程序,三线串行方式
{
chari
intsvcon
svcon=vcon|0x8000 vcon最高位置1,选择
TLC5618的A通道
CS=0 置5618的CS=0,允许片选
for(i=0 i<16 i++)
{
DIN=svcon&0x8000 串行方式送16位
数据
svcon<<=1;
CLK=0;
CLK=1;
}
CS=1 禁止片选
return
}
voidmain0
{
dac5618(0x7FF)
}
-# Includeintvcon output voltage variable sbitDIN = 0x91 definition P2.1 for serial data I sbitCLK = 0x92 P2.2 for serial clock terminal sbitCS = 0x93 P2.3 for the chip select terminal voiddac5618 (intvcon) TLC5618DAC subroutine, three-wire serial way (chari intsvcon svcon = vcon | 0x8000 vcon the highest position one, select the TLC5618 the A-channel CS = 0 Purchase 5618 the CS = 0, chip select permit for (i = 0 i
intvcon 输出电压变量
sbitDIN=0x91 定义P2.1为串行数据口
sbitCLK=0x92;P2.2为串行时钟端
sbitCS=0x93 P2.3为片选端
voiddac5618(intvcon)TLC5618DAC子程序,三线串行方式
{
chari
intsvcon
svcon=vcon|0x8000 vcon最高位置1,选择
TLC5618的A通道
CS=0 置5618的CS=0,允许片选
for(i=0 i<16 i++)
{
DIN=svcon&0x8000 串行方式送16位
数据
svcon<<=1;
CLK=0;
CLK=1;
}
CS=1 禁止片选
return
}
voidmain0
{
dac5618(0x7FF)
}
-# Includeintvcon output voltage variable sbitDIN = 0x91 definition P2.1 for serial data I sbitCLK = 0x92 P2.2 for serial clock terminal sbitCS = 0x93 P2.3 for the chip select terminal voiddac5618 (intvcon) TLC5618DAC subroutine, three-wire serial way (chari intsvcon svcon = vcon | 0x8000 vcon the highest position one, select the TLC5618 the A-channel CS = 0 Purchase 5618 the CS = 0, chip select permit for (i = 0 i
(系统自动生成,下载前可以参看下载内容)
下载文件列表
FM3104_ETC_258776.pdf