Interfacing ADC0834 to uoLED-96-PROP
![DiverBob](https://forums.parallax.com/uploads/userpics/OK3CBNXVS1EO/n9KKCOSAFUL2X.jpg)
I been experiencing some difficulty with interfacting the uoLED-96-PROP with a 4 input ADC0835 chip.
I·started using the CD_ADC0834 code from Object Exchange library. The demo code was sucessfully modified to run using "vga_text" to output the ADC values to a 15" LCD screen (looks good too). So I know the ADC works, the code is good·and the chip is wired correctly.
However when I try to do the same basic code of just displaying the ADC output in a repeating loop all I get is a non-changing value, depending on the way I try to print.
I use the following pin connections to the oled display:
P18 - sclk
P19 - Sars
P20 - Dout/in
P21 - CS
The display code looks basically like this:
adc.start(18)······· 'pin # for sclk
repeat
· temp1 := adc.GetADC(2)······ 'ADC input to measure
· oled.PutText(0,0,0, 255,255,0, xxxxxxxx)···· 'the xxxxxx is where I can not get the value for temp1 to print
I have used the Numbers library object (Num.ToStr(temp1, Num#DEC)) which I thought should work but it doesn't
I've tried numerous means of getting a value to show, right now I think I'm too close to the problem and am no longer seeing the obvious. I'm hoping someone else has tried a simular item using the uoLED and has the answer I'm missing
Thanks!
Bob
I·started using the CD_ADC0834 code from Object Exchange library. The demo code was sucessfully modified to run using "vga_text" to output the ADC values to a 15" LCD screen (looks good too). So I know the ADC works, the code is good·and the chip is wired correctly.
However when I try to do the same basic code of just displaying the ADC output in a repeating loop all I get is a non-changing value, depending on the way I try to print.
I use the following pin connections to the oled display:
P18 - sclk
P19 - Sars
P20 - Dout/in
P21 - CS
The display code looks basically like this:
adc.start(18)······· 'pin # for sclk
repeat
· temp1 := adc.GetADC(2)······ 'ADC input to measure
· oled.PutText(0,0,0, 255,255,0, xxxxxxxx)···· 'the xxxxxx is where I can not get the value for temp1 to print
I have used the Numbers library object (Num.ToStr(temp1, Num#DEC)) which I thought should work but it doesn't
I've tried numerous means of getting a value to show, right now I think I'm too close to the problem and am no longer seeing the obvious. I'm hoping someone else has tried a simular item using the uoLED and has the answer I'm missing
Thanks!
Bob
Comments
Now I also modified the CD_ADC0834 library object to use the BS2 library object and the displayed output is 0 however I do notice what appears to be a number other than 0 flashing shortly after the program starts up. It almost seems to get a value and display it and then reverts back to 0 and stays there.
Another thing that I was just thinking of was could the pin setup on the OLED be labeled wrong? I am going to do a quick test, just hook up some LEDs to the 4 pins and see if I can get them to light correctly. At least that should eliminate that as a problem.
Bob
I attached the program file and the modified ADC0834 file also.
I commented out a lot of the·main program file to simplify it, I have used both the modified and unmodified ADC0834 library files.
Bob
I know this sounds like a waste of time, but you have multiple problems (display, ADC readings) and your program looks like it ought to work. You really have to simplify things to isolate where the problem is and that's the purpose of backtracking and partially starting over.
I think I am going to put this aside for a bit and go and start work on another part of the coding. I have a whole menu system to set up and test.
I have been hovering on the outside of this forum for a while now, this is the first time I haven't been able to get something to work via experimentation or hints from postings in this forum. I really like programming the prop, so much more fun than the programming I get paid for..... And the oLED display is great fun. The project I am developing this for is·an underwater rebreather loop oxygen sensing and display. I have most of the displays worked out, including real-time moving plot that displays average O2 levels the diver is breathing. The miniature uoLED display resides in a small waterproof housing mounted 4-6 inches in front of the divers mask. A seperate box contains batteries and the ADC circuit along with a few other goodies and sends data serially to the display unit. Piezo-electric switches provide diver input.
Thanks for your ideas so far!
Bob
I recommend what Mike was saying. Think strategically about your program and break it into small chuncks. It sounds like you are doing some of that already. You know the ADC object works. Breaking your program into chucks, and thinking through and testing each portion will help to verify any assumptions.
Your application of the uOLED sounds very exciting. I love the little device!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
www.brilldea.com·- check out the uOLED-IOC, an I/O expansion for the uOLED-96-PROP
www.tdswieter.com
One little spark of imagination is all it takes for an idea to explode