久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费
標題:
這個怎么改成52的程序?
[打印本頁]
作者:
提方!
時間:
2024-9-12 19:14
標題:
這個怎么改成52的程序?
#include "33A04.h"
void AiP33A04_Port_Init(void)
{
CLK = 0;
DIN = 0;
}
void AiP33A04_Write_Reg(unsigned char Current_Mode,unsigned char COM_Data,unsigned int SEG_Data)
{
unsigned char i;
/*傳輸16bit SEG數據*/
for(i=0;i<16;i++)
{
CLK = 0;
delay();
if(SEG_Data & 0x0001 == 0x0001)
DIN = 1;
else
DIN = 0;
delay();
CLK = 1;
delay();
SEG_Data = SEG_Data >> 1;
}
/*傳輸8bit COM數據*/
for(i=0;i<8;i++)
{
CLK = 0;
delay();
if(COM_Data & 0x01 == 0x01)
DIN = 1;
else
DIN = 0;
delay();
CLK = 1;
delay();
COM_Data=COM_Data>>1;
}
/*傳輸4bit 恒流選擇*/
for(i=0;i<4;i++)
{
CLK = 0;
delay();
if(Current_Mode & 0x1 == 0x1)
DIN = 1;
else
DIN = 0;
delay();
CLK = 1;
delay();
Current_Mode = Current_Mode>>1;
}
/*傳輸2bit保留位*/
for(i=0;i<2;i++)
{
CLK = 0;
delay();
DIN = 0;
delay();
CLK = 1;
delay();
}
}
void AiP33A04_Latch(void)
{
CLK = 1;
delay();
DIN = 1;
delay();
DIN = 0;
delay();
}
void AiP33A04_Stop(void)
{
CLK = 0;
delay();
DIN = 1;
delay();
DIN = 0;
delay();
}
void port_init()
{
P0IO = 0xFF; // direction
P0PU = 0x00; // pullup P1PU &= ~0x3f;
P0OD = 0x00; // open drain
P0DB = 0x00; // bit7~6(debounce clock), bit5~0=P07~02 debounce
P0 = 0x00; // port initial value
P1IO = 0xFF; // direction
P1PU = 0x00; // pullup
P1OD = 0x00; // open drain
P15DB = 0x00; // debounce : P54, 52, 17, 16, 12, 11
P1 = 0x00; // port initial value
P2IO = 0xFF; // direction
P2PU = 0x00; // pullup
P2OD = 0x00; // open drain
P2 = 0x00; // port initial value
P3IO = 0xFF; // direction
P3PU = 0x00; // pullup
P3 = 0x00; // port initial value
P4IO = 0xFF; // direction
P4PU = 0x00; // pullup
P4OD = 0x00; // open drain
P4 = 0x00; // port initial value
P5IO = 0xFF; // direction
P5PU = 0x00; // pullup
P5 = 0x00; // port initial value
// Set port functions
P0FSRH = 0x00; // P0 selection High
P0FSRL = 0x00; // P0 selection Low
P1FSRH = 0x00; // P1 selection High
P1FSRL = 0x00; // P1 selection Low
P2FSRH = 0x00; // P2 selection High
P2FSRL = 0x00; // P2 selection Low
P3FSR = 0x00; // P3 selection
P4FSR = 0x00; // P4 selection
P5FSR = 0x00; // P5 selection
}
#include "timer.h"
void Timer2_init()
{
// initialize Timer2
// T2ADRH = 0x07; T2ADRL = 0xcf; period = 1mS
// T2ADRH = 0x00; T2ADRL = 0xc7; period = 0.1mS
IE |= 0x80;
IE2 |= 0x08; // Enable Timer2 interrupt 定時器中斷使能
T2CRH |= 0x80; // timer setting High
T2CRL = 0x60; // timer setting Low8分頻
T2ADRH = 0x00; // period count High
T2ADRL = 0xc7; // period count Low
T2CRH |= 0x01; // timer setting High
}
void clock_init()
{
// internal RC clock (16.000000MHz)
OSCCR = 0x28; // Set Int. OSC
SCCR = 0x00; // Use Int. OSC
}
void INT_Timer2() interrupt 15
{
s=s-1;
}
304.zip
2024-9-12 19:11 上傳
點擊文件名下載附件
95.66 KB, 下載次數: 1
作者:
donglw
時間:
2024-9-13 01:10
首先解釋下面程序的含義,再談如何轉換
// Set port functions
P0FSRH = 0x00; // P0 selection High
P0FSRL = 0x00; // P0 selection Low
P1FSRH = 0x00; // P1 selection High
P1FSRL = 0x00; // P1 selection Low
P2FSRH = 0x00; // P2 selection High
P2FSRL = 0x00; // P2 selection Low
歡迎光臨 (http://m.zg4o1577.cn/bbs/)
Powered by Discuz! X3.1
主站蜘蛛池模板:
一级免费片
|
夜夜欢天天干
|
日韩精品视频在线播放
|
亚洲一区视频
|
国产精品一区三区
|
中国av在线播放
|
日本黄色三级视频
|
精久久久久
|
午夜激情影视
|
五月婷婷在线观看
|
久久色av
|
欧美福利在线观看
|
日韩欧美精品一区二区
|
a在线播放
|
成年视频在线观看
|
久久99精品国产麻豆91樱花
|
成人久久视频
|
三级福利视频
|
久久激情视频
|
日韩视频免费在线观看
|
一区二区三区久久久
|
精品一区二区三区四区
|
国语对白永久免费
|
野外(巨肉高h)
|
欧美日韩亚洲国产
|
欧美黄色一级大片
|
日韩看片
|
婷婷综合视频
|
茄子视频色
|
日韩欧美专区
|
激情综
|
欧美一二区
|
91欧美日韩
|
性视频在线
|
午夜免费毛片
|
韩日一级片
|
亚洲天堂免费视频
|
日韩黄色大片
|
国产日韩av在线
|
亚洲综合视频在线观看
|
亚洲天堂日本
|