Intel Edison generic calculator shield photo journal
|
04-05-2015, 08:16 AM
(This post was last modified: 04-05-2015 11:43 AM by MarkHaysHarris777.)
Post: #48
|
|||
|
|||
RE: Intel Edison generic calculator shield photo journal
Greetings, my edison 'blocks' came from Sparkfun yesterday; so, I am finally able to read my 'highly unorthodox' analog keyboard with the Intel Edison. This came with several hours of investigation &research into the TI ADS1015 differential analog to digital converter employed on the Sparkfun ADC block. I am helping Danny in Tokyo setup this block, so I'm going to refer him to this site (photos explanation) from the Sparkfun forum as well; welcome Danny.
First, it is hopeless to attempt an analog read of the ADS1015 without understanding the datasheet particularly page(s) 15-16. It is also necessary to understand I2C protocol and Sparkfun has one of the best tutorials; see the link. First my hi-res pics, then comment as usual; Danny, click the pic to get a larger view: Tonight I'm powering the Edison from the console block; as well communicating through the console block, from my Raspberry PI if you must know. The GPIO block is the base, and the ADC block is directly beneath the Edison. I mounted a header on my ADC, and have supplied a rainbow ribbon out to breadboard from the ADC block. I am going to use the ADC block to 'read' the analog keyboard (simple resistor voltage divider) select-able via push-button. The ADC block can be configured (see pages 15-16) to continuously scan (or just once) and to scan four analog inputs, or two analog differential inputs. Four boards may be stacked because each board has a soldered address (the default is 0x48). I am going to read Ain1; however, by changing the configuration register I can easily read any of the four inputs Ain0, Ain1, Ain2, or Ain3. (Danny, you need not make my keyboard; just use a pot between 3v3 and gnd, attaching the wiper to Ain1, and 'read' the pot) Also, I'm going to do everything from the terminal using gnu/linux tools on-board in the Edison, no need to install anything, and NO programming till you get things working: i2cdetect, i2cdump, i2cget, & i2cset. First detect your board: (this is on i2c bus 1 (one) not 6 (not six) i2cdetect -r -y 1 (it should show up on 0x48, if not something is wrong with your stack) Next set the configuration register: i2cset -y 1 0x48 1 0x8352 w (I2C uses little-endian, so the config is really bits 0x5283, just be aware) Now it is time to 'read' the Ain1 value, also little-endian: i2cget -y 1 0x48 0 w (I got back 0xe017, which is really 0x17e0) The config value 0x5283 means continuous, 4v max, Ain1, non latching, no comparator... see datasheet Ain0 = 0x4283 Ain1 = 0x5283 Ain2 = 0x6283 Ain3 = 0x7283 The second pic shows some sample reads from the analog keyboard on Ain1. There is very nice resolution, and with the I2C interface I can easily read 16 x four 35 button keyboards, if necessary. I am still playing with both options (digital vs analog). The ADS1015 chip will make the analog reads easy, for instrumentation if for nothing else; else the analog keyboard is on the table again boys and girls! Ps Danny, et al, I would make sure your ADC setup works from the terminal first, THEN move to coding this up in C|C++... words to the wise. PPS Be VERY CAREFUL with the commands i2cset, i2cdump, i2cget, and i2cdetect. These commands are potentially VERY dangerous... read the man pages and double check your values. Cheers, marcus Kind regards, marcus |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 7 Guest(s)