From: Tracy B. <tr...@bo...> - 2008-07-09 12:28:11
|
Hi Dave, Thanks for all the help, I have one, hopefully last question for you. The eventual goal is to store 10 bit ADC readings in a circular buffer (CBuF) and then transfer them to an external file when requested. To do this I have set m_entry to a uint16_t. However I still seem to get truncated results on the other side. I have developed a i2c_io_read function in i2c-io-api.c which use the transfer bytes command, which I assume can only transfer 1 byte at a time until the maximum transfer of 30 bytes has been acheived. That means that no matter what is in my circular buffer, the ultimate result out of the transfer will be a byte. What function should I use to transfer the 16 bit numbers as fast as possible and as many at a time as possible? Tracy. Dave Hylands wrote: > > Hi Tracy, > >> Sorry for the multiple replies but I think I have figured it out. It is >> not >> the ADC function that was causing issues. I was storing ADC into a >> circular >> buffer and then using the function I2cReadBytes to send 30 entries of the >> buffer at a time until it was empty. Obviously this was sending an 8 bit >> byte and not at 16 bit one. If you have any ideas how to get around this >> it >> would be greatly appreciated. > > If you're using CBUF to implement the circular buffer, then just make > the entries in the circular buffer be uint16_t's. And remember that > the size of your buffer is now twice as big, so 15 entries will occupy > 30 bytes. > > -- > Dave Hylands > Vancouver, BC, Canada > http://www.DaveHylands.com/ > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > > -- View this message in context: http://www.nabble.com/Difference-betwwen-methods-of-ADC-tp18258363p18359969.html Sent from the Gumstix mailing list archive at Nabble.com. |