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.

adc resolution lowering - 24bit to 8 bit

Status
Not open for further replies.
yes it will be 0x4a. for sure.

Added after 1 minutes:

Try increasing ur nop instruction.
increase it by double/tripple.

Added after 17 minutes:

I am using 15 nop's. Just try this . Increase it in adc_cmd();

P11=1;//sclk high
++nop;
++nop;
++nop;
++nop;
++nop;
++nop;
++nop;
++nop;
++nop;
P11=0;//sclk=0;
 

still m having same problem...whenever try to write in the register its value comes zero...do any one know y its happening??? whats the problem... i can read the default value of the same register..

Added after 1 minutes:

but i can send the command properly..so it may not b a problem in clock...

Added after 1 hours 21 minutes:

hello sir can you plz send me your code to write the value in register????????
 

Hey did u get the code?

Added after 42 minutes:

I had mailed u.... (PM)
 

hi...
now i can write the data into registers but the problem is my voltage register value is not varying according to my input...what is the problem?? i have set cycle count as 4000 and selected high pass filter for voltage channel...so,what should i do???
plz help
 

hello mandar_mahajan sir plz help me last time as m vry confuse...
i can read,write everything n everything is fine but as u knw m jst taking 12 bit msbs as my output..so at 0.6mv input m getting 3205 and whenever my input voltage goes arnd 13.8 or more output goes to 0 as 12bit value 4096 gets overflow...so sir what should i do for this???? should i do calibration process???? sir plz help me...
 

I read through that post and implemented the initializations. but there still seems to be a problem. the 24 bit data read is still 00 00 00. Here's my code.

void begin()
{
unsigned int i;
RESET=0; //initial reset
SDelay(100);
RESET=1;

write_to_register(0x5E, 0x00, 0x00, 0x01); //status reg= 000001
write_to_register(0x40, 0x00, 0x00, 0x04); //config reg= 000004
write_to_register(0x4A, 0x00, 0x00, 0x32); //cycle count=000032
write_to_register(0x78, 0x00, 0x00, 0x08); //control reg=000008
write_to_register(0x74, 0x80, 0x00, 0x00); //mask reg= 800000
write_to_register(0xE8, 0xFF, 0xFF, 0xFF); //start conv, nop, nop, nop
write_to_register(0xFF, 0xFF, 0xFF, 0xFE); //nop, nop, nop, nop

read_register(0x0E); //read inst current reg
SDelay(200); //delay

for (i=0;i<50;i++)
{
P2=0xFF; led1=0; P0=Display((high_byte>>4)& 0x0F); //Display High
SDelay(300);
P2=0xFF; led2=0; P0=Display((high_byte)& 0x0F);
SDelay(300);

P2=0xFF; led3=0; P0=Display((mid_byte>>4)& 0x0F); //Display Mid
SDelay(300);
P2=0xFF; led4=0; P0=Display((mid_byte)& 0x0F);
SDelay(300);

P2=0xFF; led5=0; P0=Display((low_byte>>4)& 0x0F); //Display Low
SDelay(300);
P2=0xFF; led6=0; P0=Display((low_byte)& 0x0F);
SDelay(300);
}
return;
}

void write_to_register(char command,char low,char mid,char high)
{
transfer_byte(command); //Transfer command followed by 24 bit data
transfer_byte(high);
transfer_byte(mid);
transfer_byte(low);
return;
}


void read_register(char command)
{
transfer_byte(command);
high_byte = recieve_byte(); //Receive Bytes
mid_byte = recieve_byte();
low_byte = recieve_byte();
return;
}

void transfer_byte(char number)
{
unsigned int i;
for (i=0; i<8; i++)
{
if (number & 0x80) SDI=1; //bit to be transferred is put on SDI
else SDI=0;

SDelay(100); //delay
SCLK=1; SDelay(100); SCLK=0; SDelay(100); //pulse clock

number = number<<1; //next bit
}
return;
}


char recieve_byte(void)
{
unsigned int i;
unsigned char x, sync=0xFE;
SDI=1;
for (i=0; i<8; i++)
{
x=x|SDO; //bit recieced from SDO is stored
x=x <<1;

if(sync &0x80) SDI=1; //strobing nop on SDI while reading
else SDI=0; //as per 5460 datasheet
sync= sync<<1;

SDelay(100); //delay
SCLK=1; SDelay(100); SCLK=0; SDelay(100); //pulse clock
}
return x;
}

Added after 25 minutes:

I also tried writing to the register im reading.

write_to_register(0x4E, 0xFF, 0xFF, 0xFF); //write instead of start conv, nop, nop, nop
write_to_register(0xFF, 0xFF, 0xFF, 0xFE); //nop, nop, nop, nop

no change.
 

can someone Help to find an Proteus VSM library for CS5460 I m working to build and energy meter based in this chip i hope simulation my source code in virtual because i haven't yet buy the chip
 

I want to use CS5460A IC as an 24 bit ADC. I have read the datasheet of IC CS5460A. But cant understand how to initialize it? Can anyone tell me steps to initialize CS5460A IC? Plz...
Thanking you in advannce....
 

Try this link:

**broken link removed**


John.
 

hey i have already written in my post that how to initialize the ic..
you can initialize it by sending FFFFFFfe then write the value in cycle count register and then start the conversion by giving E8 command..

also refer the datasheet of CS5463, which is same chip with some more registers.. you can understand the ic easily.
 

hey i have already written in my post that how to initialize the ic..
you can initialize it by sending FFFFFFfe then write the value in cycle count register and then start the conversion by giving E8 command..

also refer the datasheet of CS5463, which is same chip with some more registers.. you can understand the ic easily.
Hey bhoomi shah please mail me the code for CS5460 IC.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top