Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem using CS5460

Status
Not open for further replies.

kirtan

Junior Member level 2
Joined
Mar 11, 2011
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,515
Hello all,

i am working with CS5460 interfaced with ATMega32.
I am observing/facing following behavior /problems. I have not included code of different functions can discuss if required.

1. In CS5460_init_configure() function status and mask registers are cleared, pulse rate register and cyclic count registers are loaded. After loading this values when they are read back I am able to find the loaded values ok as sent on serial port. By this i understand that my read and write routines for CS5460 are working ok (?????).

2.When inputs are not applied to voltage channel and current channels (they are kept open) and the conversion is started in continuous mode I am able to see (on serial port) change in status register value (DRDY bit) for each end of conversions and on reset. Values of V, I and E as read are always a fixed value which are very small values when appropriately converted.

Problem in this is some times the conversion process continuous for 1 min and then starts giving 0 value when any of the register (status or count reg.) are read. By this i understand that serial port may have been out of synchronization but even after sending the reinitializing sequence (SYNC values) the problem is not solve

3. When the inputs are given to voltage and current channel, the chip gives irrelevant values and DRDY bit is never set.

I have read almost all related threads on the forum and tried in my way to identify the problem but enable to find it....kindly help

int main()
{ unsigned long int temp;
unsigned char check;


delay_100ms(50);
int_uart(baud_count);


send_string_uart("welcome \r\n");

delay_100ms(50);
init_spi();
send_string_uart("SPI inialised \r\n");


CS5460_reset();
delay_100ms(50);
send_string_uart("CS5460 reseted \r\n");

CS5460_init_configure();
delay_100ms(50);
send_string_uart("CS5460 initial configured \r\n");

//************for testing*******************

temp = CS5460_read_24bit(REG_CYCLE_COUNT);
send_24bit_uart(temp);

temp=CS5460_read_24bit(REG_STATUS);
send_24bit_uart(temp);

//**********above part is tested ok**************
check =0x41;

CS5460_start_conversion();

while(!(CS5460_DRDY_ready())); //discard the first computation
send_char_uart(check);
check = check +1;

while(1)
{
while(!(CS5460_DRDY_ready()));
temp=CS5460_read_24bit(REG_STATUS);
send_24bit_uart(temp);
Vrms = CS5460_read_24bit(REG_VRMS);
Irms = CS5460_read_24bit(REG_IRMS);
Energy = CS5460_read_24bit(REG_ENERGY);
send_24bit_uart(Vrms);
send_24bit_uart(Irms);
send_24bit_uart(Energy);
send_char_uart(check);
check = check +1;
CS5460_DRDY_reset();
temp=CS5460_read_24bit(REG_STATUS);
send_24bit_uart(temp);
}

while(1);

}
 

hello sir,
I am new to this ADC and wanted to inquire a few stuffs to you.In the SPI initialization which method have you used hardware reset or clocking sync1 and sync0 commands.Also what else has to be specified in init_spi() function.
Right now i just want to read the registers and not to write anything.
Also in reset() function what have you written if u can provide with the data.
Please help.
 

hello sir,
I am new to this ADC and wanted to inquire a few stuffs to you.In the SPI initialization which method have you used hardware reset or clocking sync1 and sync0 commands.Also what else has to be specified in init_spi() function.
Right now i just want to read the registers and not to write anything.
Also in reset() function what have you written if u can provide with the data.
Please help.

I feel its better to use both first the hardware reset followed by software reset and the synchronizing sequence of sync1/sync0.
 
I feel its better to use both first the hardware reset followed by software reset and the synchronizing sequence of sync1/sync0.

yes sir i have done the same thing...
now i am just reading the registers.
when i read cycle count or status register or config register i am getting zero but when i am reading current channel or voltage channel gain register i am gettin 64.
what could be the reason?

Also Sir is your problem solved ?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top