2015-12-07 12:50 AM
Hello,
Myself nischal, i'm using stm32f103RC controller to get data from ADS1248 temperature IC using SPI as a communication medium. The problem i'm facing is, when controller request data from ads1248 through SPI i'm getting response for every 250ms instead of 16ms. So i request anybody to resolve the issue ASAP. Thank you in advance.Nischal2015-12-07 05:45 AM
Do you need to clock the interface faster? How fast are you clocking it now?
2015-12-07 09:30 PM
hello clive ,
i'm clocking at 281250bps2015-12-08 11:31 AM
Perhaps a wrong command is going to the ADS1248 external ADC. But that is difficult to pinpoint without seeing the code.
Edit: The default sampling rate for the ADS1248 is 5/sec. Is that what you are observing? Cheers, Hal2015-12-09 02:28 AM
hello baird,
i'm facing problem in ADS1248 when SPI send request for response ads1248 sends two garbage values one after the other and there 2 sec delay as initialized so there the problem occurring can you help me to show2015-12-09 10:55 AM
Describe how you are coordinating the ADS1248 Start pin timing relative to the commands sent on SPI.
Cheers, Hal2015-12-09 09:49 PM
hello baird.hal,
i'm forwarding code, float Read_IC1_REF0(void){volatile float tot_adc_val = 0.0;volatile unsigned short int fl_k = 0;volatile unsigned short int fl_index = 0;volatile unsigned char SPI1_Rx_buffer[3]={0};volatile unsigned int ADC_Converted_Data = 0;/****** Configuration for MUX1 Register ******/ IC1_VREFCON_Int_ON // Internal Reference is always ON IC1_REFSELT_Onboard_Ref // Onboard Reference selected IC1_MUXCAL_Ext_Ref0 // External REF0 is selected as system monitor sar_Write_2_Register(IC1_MUX1_Address,IC1_MUX1_Data); /****** Delay ******/ Delay_Flag_16ms = 0; while(Delay_Flag_16ms == 0); // 16 ms Delay MB1_process();/****** Read Data Once ******/ _2_sec_Delay_Flag = 0; do { while(!(GPIOC->IDR & 0x0001)) { _2_sec_Delay_Flag = 1; delay_2s_count = 0; } } while(_2_sec_Delay_Flag == 0);// while(GPIOC->IDR & 0x0001); // -->IC1 Wait till Data Conversion Cpmplete (i.e DRDY != 1). If it goes to Zero, indicates Data Conversion is Complete while((GPIOC->IDR & 0x0001)==0); while(SPI2_BUSY_FLAG); // Wait for Busy flag reset to send next data byte SPI2->DR =0x12; // Read Once Cmd is 12 or 13. while(SPI2_BUSY_FLAG); // Wait for Busy flag reset to send next data byte SPI2_Rx_dummy_buffer = SPI2->DR; // receive 1st byte which is a dummy data/* here communication delay occurring and receiving dummy byte */ _2_sec_Delay_Flag = 0; do { while(!(GPIOC->IDR & 0x0001)) { _2_sec_Delay_Flag = 1; delay_2s_count = 0; } } while(_2_sec_Delay_Flag == 0);// while(GPIOC->IDR & 0x0001); while((GPIOC->IDR & 0x0001)==0); while(SPI2_BUSY_FLAG); // Wait for Busy flag reset to send next data byte SPI2->DR =0x12; // Read Once Cmd is 12 or 13. while(SPI2_BUSY_FLAG); // Wait for Busy flag reset to send next data byte SPI2_Rx_dummy_buffer = SPI2->DR; // receive 1st byte which is a dummy data/* here communication delay occurring and second time receiving dummy byte,this major thing and delay has more */ for(fl_k=0;fl_k<3;fl_k++) { while(SPI2_BUSY_FLAG); // Wait for Busy flag reset to send next data byte SPI2->DR =0xff; // NOP Cmd while(SPI2_BUSY_FLAG); // Wait for Busy flag reset to send next data byte SPI1_Rx_buffer[fl_index++]=SPI2->DR; }2015-12-11 07:53 AM
Read the (not)DRDY description on Sheet 36 of the ADS1248 data sheet. It indicates that a delay is needed between (not)DRDY and the first SCLK pulse.
TI also provides programming examples for the ADS1248 that can be compared with your code to find omissions in setup and communication. Cheers, Hal2015-12-17 02:01 AM
hello everyone,
can any buddy suggest me how to work the SPI in parallel ..?2015-12-17 03:46 AM
How do you mean that ?
You have the options to use separate SPI peripherals in parallel, or control NSS via software (i.e. in your code) and have separate NSS lines, one to each slave.