当前位置:网站首页>Cs5463 code module analysis (including download link)
Cs5463 code module analysis (including download link)
2022-06-28 23:02:00 【Night Star 2022】
CS5463 Single phase bi-directional power IC
char CS5463_Init_LZH(void)
{
// newly added
CS = 1;
delay_us(100); // Time delay
CS = 0;
RST = 0;
// uDelay(100);
delay_us(100); // Time delay
RST = 1;
RST = 0;
delay_us(100);
RST = 1;
//----------------------
// Send synchronization sequence
RX_Buff[0] = CMD_SYNC1;
RX_Buff[1] = CMD_SYNC1;
RX_Buff[2] = CMD_SYNC0;
SEGGER_RTT_printf(0, " Serial initialization \n"); // Debug the general
CS5463WriteReg(CMD_SYNC1, RX_Buff); //#define CMD_SYNC1 0XFF // Start serial port reinitialization
RX_Buff[0] = 0x80;
RX_Buff[1] = 0x00;
RX_Buff[2] = 0x00;
CS5463WriteReg(REG_STATUSR, RX_Buff); // initialization -- Status register #define REG_STATUSR 0x5E // state
//----------------------
// initialization -- Configuration register
// The phase compensation is PC[6:0]=[0000000];
// The current channel gain is Igain=10;
//EWA=0;
//INT The interrupt is active at low level IMODE:IINV=[00]
//iCPU=0
//K[3:0]=[0001]
//
//MCLK=4.096MHz If it is required to calculate every second 10 Time ,N=400, The formula Times=(MCLK/K)/(1024*N).// Calculate per second 1 Time ,N=4000
RX_Buff[0] = 0x00;
RX_Buff[1] = 0x00;
RX_Buff[2] = 0x01;//RX_Buff[2] = 0x01;
CS5463WriteReg(REG_CONFR, RX_Buff); // #define REG_CONFR 0x40 // To configure
// Try to modify N value
// Now use N = 800
// RX_Buff[0] = 0x00;
// RX_Buff[1] = 0x03; //0x0F;
// RX_Buff[2] = 0x20; //0xA0; //#define REG_CYCCONT 0x4A // Of a calculation cycle A/D Conversion number
// CS5463WriteReg(REG_CYCCONT,RX_Buff); // initialization --CYCLE COUNT register ,4000
// RX_Buff[0] = 0x00;
// RX_Buff[1] = 0x0F;
// RX_Buff[2] = 0xA0; //#define REG_CYCCONT 0x4A // Of a calculation cycle A/D Conversion number
// CS5463WriteReg(REG_CYCCONT,RX_Buff); // initialization --CYCLE COUNT register ,4000
//10S
// RX_Buff[0] = 0x00;
// RX_Buff[1] = 0x01;
// RX_Buff[2] = 0x90; //#define REG_CYCCONT 0x4A // Of a calculation cycle A/D Conversion number
// CS5463WriteReg(REG_CYCCONT,RX_Buff); // initialization --CYCLE COUNT register ,400
RX_Buff[0] = 0x00;
RX_Buff[1] = 0x9C;
RX_Buff[2] = 0x40; //#define REG_CYCCONT 0x4A // Of a calculation cycle A/D Conversion number
CS5463WriteReg(REG_CYCCONT, RX_Buff); // initialization --CYCLE COUNT register ,40000
RX_Buff[0] = 0x00;
RX_Buff[1] = 0x00;
RX_Buff[2] = 0x00;
CS5463WriteReg(REG_MASKR, RX_Buff); // initialization -- Interrupt mask register #define REG_MASKR 0x74 // Interrupt mask
//----------------------
// initialization -- Operation register
RX_Buff[0] = 0x00;
RX_Buff[1] = 0x00;
RX_Buff[2] = 0x01;
CS5463WriteReg(REG_MODER, RX_Buff); //#define REG_MODER 0x64 // Operation mode
//----------------------
// initialization -- electric current AC Offset Calibration register
// RW24XX(RX_Buff,3,EE_IACBIAS,0xA1);
// CS5463WriteReg(REG_IACOFF,RX_Buff);
//----------------------
// initialization -- electric current Gain calibration register
// RW24XX(RX_Buff,3,EE_IACGAIN,0xA1);
// CS5463WriteReg(REG_IGN,RX_Buff);
//----------------------
// initialization -- voltage AC Offset Calibration register
// RW24XX(RX_Buff,3,EE_VACBIAS,0xA1);
// CS5463WriteReg(REG_VACOFF,RX_Buff);
//----------------------
// initialization -- voltage Gain calibration register
// RW24XX(RX_Buff,3,EE_VACGAIN,0xA1);
// CS5463WriteReg(REG_VGN,RX_Buff);
//----------------------
//----------------------
// initialization -- Pulse rate register
// RX_Buff[0] = 0x00;
// RX_Buff[1] = 0x34;
// RX_Buff[2] = 0x9C;
// CS5463WriteReg(REG_PULRATE,RX_Buff);
//----------------------
//----------------------
//----------------------
// RX_Buff[0] = 0x00;
// RX_Buff[1] = 0x00;
// RX_Buff[2] = 0x00;
// CS5463WriteReg(REG_CTRLR,RX_Buff); // initialization -- Control register #define REG_CTRLR 0x78 // control
//----------------------
CS5463CMD(CMD_STARTC); // Start continuous conversion #define CMD_STARTC 0XE8 // Perform a continuous calculation cycle
//CS5463_Status = 0; // Initialize task process status
//Load_Status = 0;
//CS5463_CrmsSmallCunt = 0;
//CS5463_CrmsOverCunt = 0;
// SEGGER_RTT_printf(0,"CS5463_Init success! \r\n");
return(1); // Once you have completed these steps, you will return to true 1
}


Code and material Links :https://download.csdn.net/download/weixin_37787043/17198637
边栏推荐
- 利用Redis实现点赞功能的示例代码
- 题解 洛谷P1762 偶数/6.21校内考试T2
- A password error occurred when docker downloaded the MySQL image to create a database link
- [deep learning] (3) encoder mechanism in transformer, complete pytoch code attached
- Is it safe and reliable to open a securities account in changtou school?
- Tanghongbin, Yaya live CTO: to truly localize, the product should not have the attribute of "origin"
- 超级工厂里的生意图鉴
- Production environment sonarqube installation
- 邂逅阿维塔 11:强产品力下久违的新鲜感
- Multiomics single cell data integration and regulatory reasoning based on graph linked embedding
猜你喜欢

CS5463代码模块解析(包含下载链接)
![[Chapter 2 of word tutorial series] how to set the table on each page to have a header in word](/img/1a/8416d2c48bf1ddcc45e0c5d9acf242.png)
[Chapter 2 of word tutorial series] how to set the table on each page to have a header in word

Panxiaoming, senior vice president of IC nansha|amd and President of Greater China: process, architecture and platform optimization break through the computing boundary

在线SQL转HTMLTable工具

FANUC机器人_KAREL编程入门(2)_通用IO信号的使用方法

Windows mysql5.7 enable binlog log

穿越过后,她说多元宇宙真的存在

Considerations on the construction of operation and maintenance system - stability

On the necessity and solution of building a campus online teaching video convergence platform

With a monthly salary of 60000 yuan, such people began to be robbed after the Internet "reduced costs and increased efficiency"
随机推荐
LeetCode 324 摆动排序 II[排序 双指针] HERODING的LeetCode之路
Wave picking of WMS warehouse management system module
Qsrand, srand random number generating function in qt5.15 has been discarded
Implementation of go language plug-in platform
The Best of Many Worlds_ Dual Mirror Descent for Online Allocation Problems
【Word 教程系列第 1 篇】如何去除 Word 表格中的箭头
00 后云原生工程师:用 Zadig 为思创科技(广州公交)研发开源节流
Websocket for im instant messaging development: concept, principle and common sense of mistakes
带链接跳转的微信红包封面制作教程和使用指南
Web API learning notes 1
国盛证券开户是真的安全可靠吗
Complex nested object pool (4) -- manage the object pool of multi class instances and multi-stage instances
keil工程,程序写多后,RTT不能打印
月薪6万,互联网“降本增效”后,这类人开始被疯抢
生产环境sonarqube安装
深入虚拟内存(Virtual Memory,VM)
Flowable boundary timer
What is the difference between WMS warehouse management system and ERP
LeCun预言AGI:大模型和强化学习都是斜道!我的世界模型才是新路
go语言插件平台的实现思路