External ADC to 18F2553 via SPI
Posted: Mon Feb 11, 2013 5:35 pm
Hello All
I am trying to build a prototype to read 16bit data from an external ADC (AD977) via the 18F2553's SPI pins and using the SPI legacy component. I have been able to write a FCF to collect 1.5 bytes of data from the PIC's internal 12bit ADC by using the component macro's "readasint" option, convert this to a string as shown in MM's ADC to USB example, and then send it successfully to the internal USB module for onward transmission.
The problem is that the SPI in Flowcode5 for PIC doesn't have the "readasint" or other binary convertor options but only has "SPI_Get_Char" and "SPI_Get_String" options that are not useful in a digital world. I have checked my Flowcode5 for dsPIC and that too has no facility for collecting digital data from an external ADC but only strings and characters. Can anyone advise me if there is a way round this brick wall.
Thanks
Richard Clarke
I am trying to build a prototype to read 16bit data from an external ADC (AD977) via the 18F2553's SPI pins and using the SPI legacy component. I have been able to write a FCF to collect 1.5 bytes of data from the PIC's internal 12bit ADC by using the component macro's "readasint" option, convert this to a string as shown in MM's ADC to USB example, and then send it successfully to the internal USB module for onward transmission.
The problem is that the SPI in Flowcode5 for PIC doesn't have the "readasint" or other binary convertor options but only has "SPI_Get_Char" and "SPI_Get_String" options that are not useful in a digital world. I have checked my Flowcode5 for dsPIC and that too has no facility for collecting digital data from an external ADC but only strings and characters. Can anyone advise me if there is a way round this brick wall.
Thanks
Richard Clarke