Quantcast
Channel: Data converters
Viewing all articles
Browse latest Browse all 27683

Forum Post: RE: ADS1220: ADC resolution and sampling rate

$
0
0
Thank you Bob, that helped me. I'm having another issue. I have a PSoC connected with the ADS1220 through SPI communication. When the data is received from the ADS1220 , the data is send to Matlab through UART. However, the resolution is very bad. I'm having huge steps. Do you have any idea why? I have attached the hardware configuration of the ADC, and t his is the code in PSoC: #include "project.h" #include "stdio.h" #include #include #define FALSE 0 #define TRUE 1 #define TRANSMIT_BUFFER_SIZE 4 uint32 dummy = 0; int main(void) { /* Variable to store ADC result */ int OutputBuffer[3]; int32 Output = 0B00000000000000000000000000000000; int32 test = 0; int32 check = 0B00000000000000000000000000000000; int32 cancel; /* Variable to store UART received character */ uint8 Ch; /* Flags used to store transmit data commands */ uint8 ContinuouslySendData; uint8 SendSingleByte; uint8 SendEmulatedData; /* Transmit Buffer */ char TransmitBuffer[1]; /* Start the components */ UART_1_Start(); SPIM_Start(); /* Initialize Variables */ ContinuouslySendData = FALSE; SendSingleByte = FALSE; SendEmulatedData = FALSE; uint8 resetData = TRUE; /* Start the ADC conversion */ ADC_DelSig_1_StartConvert(); /* Send message to verify COM port is connected properly */ UART_1_PutString("COM Port Open"); CyGlobalIntEnable; /* Enable global interrupts. */ /* Place your initialization/startup code here (e.g. MyInst_Start()) */ SPIM_WriteTxData(0B00000110); // Reset ADC CyDelayUs(1000); SPIM_WriteTxData(0B00001000); // START ADC /*Configuring control register with : SPIM_WriteTxData(0x43); SPIM_WriteTxData(0B0110000); //R0 SPIM_WriteTxData(0B11010100); //R1 SPIM_WriteTxData(0B11100111); //R2 SPIM_WriteTxData(0B00000000); //R3 int i = 0; LED_Write(0); for(i = 0; i >8); UART_1_PutChar(Output>>16); UART_1_PutChar(Output>>24); LED_Write(1); CyDelay(35); UART_1_ClearTxBuffer(); } else { UART_1_ClearTxBuffer(); LED_Write(0); } } } And Matlab Serial communication is configured like this: serial_PSoC=serial('COM1','BaudRate',115200,'Parity','none','DataBits',8,'StopBits',1); set(serial_PSoC,'InputBufferSize',4096,'ByteOrder','littleEndian');

Viewing all articles
Browse latest Browse all 27683

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>