??? 06/27/07 14:07 Read: times |
#141297 - Ads 1256 |
We are interfacing ADS1256 with a controller using SPI communication. We are getting datas from the default settings. But we are unable to write the data to the ADS Registers to affect new settings. and also unable to read the data from the Registers.we are giving below the sample code that we are using.
Please give us any suggestions //*************************************** // SPI // Interfacing ADS1256 // // SPI clock frequency --> 1.1718MHz // //******************************************************************************************// void main() { ADC_Init(); while(1) { for(i=0;i<500;i++);//delay trans= 0x10 ;// sending first command to Read //Register and starting address as 0x00 trans = 0x000; //sending Second command to // read the number of Register trans = 0x000;// Send Dummy data for READ r_arr[k++] = SpiaRegs.SPIRXBUF; } } //******************r******************************************* // FUNCTION : ADC INITIALIZATION //************************************************************** void ADC_Init(void) { trans = 0x0050; //sending first command to write //Register and starting address as 0x00 // 0x50 + 0x00 <- starting address //of the register trans = 0x000; //sending Second command to write the // number of Register for(i=0;i<500;i++);//delay / /Write data to status Regs trans = 0x001;// for DRDY /* //channel select// MUX trans = 0x0001;// channel AIN0 //ADCON-PGA=1 trans = 0x0001; //D_RATE trans = 0x00F0<<8; // StandBy command trans = 0x00FD; //Synchronize the A/D Conversion trans = 0xFC ; //wake up trans = 0x00; */ } //=========================================================================== // No more. //=========================================================================== |
Topic | Author | Date |
Ads 1256 | 01/01/70 00:00 | |
Code not complete | 01/01/70 00:00 | |
Don't use for delays![]() | 01/01/70 00:00 |