资源简介
RN8302、RN8302B,官方给的芯片使用手册资料,电路原理图,官方提供的源码等。
代码片段和文件信息
/**************************************************************************//**
* @file Dl645_Fft.c
* @brief
*
* @version V1.2
* @date 2017/5/26
*
* @note
* Copyright (C) REnergy Micro-Electronics Co.LTD.
*--------------------------Update History-------------------------------------
* V1.1 add source code of fnRN8302_ReadBuf
* 2017/5/26 V1.2 correct the calculation of total harmonic ftemp_P
*
******************************************************************************/
#define _DL645_fft_GLOBALS
#include
const float Fftcoefficient[50]= // 谐波计算时补偿系数
{
1.0005
1.0027
1.0054
1.0087
1.0129
1.0175
1.0229
1.029
1.0362
1.0438
1.0524
1.0618
1.0718
1.0827
1.0944
1.1075
1.121
1.136
1.1517
1.1685
1.1862
1.2051
1.2255
1.2475
1.27
1.2942
1.3199
1.3468
1.3758
1.407
1.4421
1.4714
1.5107
1.5483
1.5873
1.6312
1.6727
1.7199
1.77
1.8231
1.8797
1.9448
2.0074
2.074
2.1534
2.2126
2.2919
2.3762
2.467
2.5639
};
void fnRN8302_ReadBuf(u16 wRegu8 *pBuf)
{
u8 ijtempchksum;
PinMode_ADCS(GPIO_MODE_OUT);
PinMode_ADSCLK(GPIO_MODE_OUT);
PinMode_ADSDO(GPIO_MODE_OUT);
PinMode_ADSDI(GPIO_MODE_IN);
ENABLE_RN8302();//PinWrite_ADCS(0);
temp = (u8)(wReg & 0x00ff);
chksum = temp;
fnSpi2_WriteByte( temp); //first write hight Addr
temp = ((u8)(wReg >> 4))& 0xf0;
temp = temp | 0x0c ; //BRUST?áè?μ??·?a16
chksum += temp;
fnSpi2_WriteByte( temp);
for(j=0;j< 16 ; j++)
{
for(i = 3; i > 0;i--)
{
pBuf[(i+j*3-1)] = fnSpi2_ReadByte();
chksum += pBuf[i-1];
}
}
if(fnSpi2_ReadByte()!=chksum)
{
DISABLE_RN8302();//PinWrite_ADCS(1);
}
PinWrite_ADCS(1);
PinWrite_ADCS(1);
PinWrite_ADSDO(1);
PinWrite_ADSCLK(1);
}
void fnDl645Fft_init(void)
{
Harmonictemp.Channel=0x00;
Harmonictemp.DataCount=0;
Harmonictemp.StarFlag=0;
Harmonictemp.ADSPIBusy = 0;
memset(&Harmonictemp0sizeof(sADE_Instantaneous_TypeDef));
memset(&HarmonicData0sizeof(sDl645FftHarmonicData_TypeDef));
}
void SampleDataModifyF(float *piRetValue)
{
u8 i;
u32 Temp;
for(i=0; i {
piRetValue[i] = 0;
Temp = 0;
memcpy((u8 *)&Temp &(Harmonictemp.InstantaneousData[i*3]) 3);
if(Temp &0x800000)
{
Temp = (0xffffff - Temp) + 1;
piRetValue[i] = -(float)Temp/8388608;
}
else piRetValue[i] = (float)Temp/8388608;
}
}
void FFT(float dataR[NUM_FFT]float dataI[NUM_FFT])
{
int x0x1x2x3x4x5x6xx;
int ijkbpL;
float TRTItemp;
/********** following code invert sequence ************/
for ( i=0;i {
x0=x1=x2=x3=x4=x5=x6=0;
x0=i&0x01; x1=(i/2)&0x01; x2=(i/4)&0x01; x3=(i/8)&0x01;x4=(i/16)&0x01; x5=(i/32)&0x01; x6=(i/64)&0x01;
xx=x0*64+x1*32+x2*16+x3*8+x4*4+x5*2+x6;
dataI[x
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
I.A.... 530777 2017-09-18 16:04 RN7302\RN7302 DEMO板\原理图及PCB\RN7302_DEMO V1.1.PCB
I.A.... 1163264 2017-09-18 16:04 RN7302\RN7302 DEMO板\原理图及PCB\RN7302_DEMO.Ddb
I.A.... 99470 2017-09-18 16:04 RN7302\RN7302 DEMO板\原理图及PCB\SCH_RN7302 Demo板 V1.1.pdf
I.A.... 79765 2017-09-18 16:04 RN7302\RN7302 DEMO板\原理图及PCB\SCH_RN7302_DEMO_V11.Sch
I.A.... 1182045 2017-09-18 16:04 RN7302\RN7302 DEMO板\锐能微RN7302 Demo板应用指南V1.0.pdf
I.A.... 1512874 2017-09-18 16:04 RN7302\参考电路\RN7302三相表.zip
I.A.... 834842 2017-09-18 16:04 RN7302\应用笔记\7302直流测试应用笔记_V1.1.pdf
I.A.... 381727 2017-09-18 16:04 RN7302\应用笔记\RN7302三相不平衡检测应用笔记V1.0.pdf
I.A.... 688765 2017-09-18 16:04 RN7302\应用笔记\RN7302谐波分析应用笔记V1.0.pdf
I.A.... 754254 2017-09-18 16:04 RN7302\应用笔记\RN8302、RN7302 应用笔记v1.1.pdf
I.A.... 2568106 2017-09-18 16:04 RN7302\应用笔记\广东省计量院测试报告-闪变.pdf
I.A.... 652622 2017-09-18 16:04 RN7302\应用笔记\锐能微电压质量检测模块说明v08.pdf
I.A.... 356186 2017-09-18 16:04 RN7302\应用笔记\锐能微电压闪变测试环境.pdf
I.A.... 8359 2017-09-18 16:04 RN7302\支持软件\FFT\Dl645_Fft.c
I.A.... 1289 2017-09-18 16:04 RN7302\支持软件\FFT\Dl645_Fft.h
I.A.... 112640 2017-09-18 16:04 RN7302\支持软件\FFT\FFT说明.doc
I.A.... 15856 2017-09-18 16:04 RN7302\支持软件\FFT\三相计量 FFT补偿系数.xlsx
I.A.... 10985 2017-09-18 16:04 RN7302\支持软件\RN7302 C语言计量参考程序v1.1.zip
I.A.... 265824 2017-09-18 16:04 RN7302\支持软件\不平衡度程序.rar
I.A.... 2877309 2017-09-18 16:04 RN7302\用户手册\RN7302用户手册_V1.5.pdf
目录 0 2017-09-18 16:04 RN7302\RN7302 DEMO板\原理图及PCB
目录 0 2017-09-18 16:04 RN7302\支持软件\FFT
目录 0 2017-09-18 16:04 RN7302\RN7302 DEMO板
目录 0 2017-09-18 16:04 RN7302\参考电路
目录 0 2017-09-18 16:04 RN7302\应用笔记
目录 0 2017-10-30 09:50 RN7302\支持软件
目录 0 2017-09-18 16:04 RN7302\用户手册
目录 0 2017-09-25 14:06 RN7302
----------- --------- ---------- ----- ----
14096959 28
............此处省略1个文件信息
评论
共有 条评论