当前位置:网站首页>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
边栏推荐
- Serious internal entanglement in the we media industry: where should the enterprise we media go
- 【Flutter 问题系列第 71 篇】Flutter 中 Uint8List 和 Image 之间的相互转换
- Realization of 2D code generation in micro build low code
- 【Word 教程系列第 1 篇】如何去除 Word 表格中的箭头
- How powerful is the Zadig build? Practice together
- Understand shell script in one article
- Basic knowledge diagram of K-line Diagram -- meaning of single K-line
- Summary of time series prediction series (code usage)
- Is it safe to open a stock account online?
- Leetcode 324 swing sort ii[sort double pointer] the leetcode path of heroding
猜你喜欢

Basic knowledge diagram of K-line Diagram -- meaning of single K-line

如何使用伦敦金画出支撑阻力线

2022-06-28: what does the following golang code output? A:true; B:false; C:panic; D: Compilation failed. package main import “fmt“ func main() {

直击产业落地 | 飞桨重磅推出业界首个模型选型工具

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

00 後雲原生工程師:用 Zadig 為思創科技(廣州公交)研發開源節流

一张能卖上千万,商家扩张比玩家还快:球星卡的江湖你不懂
![LeetCode 324 摆动排序 II[排序 双指针] HERODING的LeetCode之路](/img/41/b8ba8d771b7224eac1cc8c54fe9d29.png)
LeetCode 324 摆动排序 II[排序 双指针] HERODING的LeetCode之路
![[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

如何结合均线分析伦敦金行情走势线图
随机推荐
[deep learning] (3) encoder mechanism in transformer, complete pytoch code attached
Panxiaoming, senior vice president of IC nansha|amd and President of Greater China: process, architecture and platform optimization break through the computing boundary
How to analyze the trend chart of London gold market with the moving average
台式机没声音怎么样才能解决
Windows mysql5.7 enable binlog log
超级工厂里的生意图鉴
Google Earth engine (GEE) -- crop extraction and analysis using sentinel-2 data
LeetCode 324 擺動排序 II[排序 雙指針] HERODING的LeetCode之路
【深度学习】(2) Transformer 网络解析,代码复现,附Pytorch完整代码
带链接跳转的微信红包封面制作教程和使用指南
2022-06-28: what does the following golang code output? A:true; B:false; C:panic; D: Compilation failed. package main import “fmt“ func main() {
【Flutter 問題系列第 71 篇】Flutter 中 Uint8List 和 Image 之間的相互轉換
没找到实习,他总结了这些
【HackTheBox】dancing(SMB)
Online linear programming: Dual convergence, new algorithms, and regret bounds
直击产业落地 | 飞桨重磅推出业界首个模型选型工具
浅析搭建校园在线教学视频汇聚平台的必要性及解决方案
Understand shell script in one article
Redis+AOP+自定义注解实现限流
Qtcreater5.15.0 source code compilation process record