mobo 2pe avr A/D issue
shooter
Posts: 8
trying to test AD function, can't get passed waiting for busy to go low. I've got .3vdc waiting at A0.
the code "should" select REF as VDD, my jumper is set for VDD from usb port.
Do I need to provide an "external" VDD ref on one of the Pxx pins?
anyway, the code continually returns a 1 for bsy.
thanks for your time
dave
the code "should" select REF as VDD, my jumper is set for VDD from usb port.
Do I need to provide an "external" VDD ref on one of the Pxx pins?
anyway, the code continually returns a 1 for bsy.
thanks for your time
dave
' {$STAMP BS2pe} ' {$PBASIC 2.5} 'AVR A/D test program 'Rev 1.0 ' 3/19 del 'taken from datasheet owio CON 10 ' pin10 = A pin6 = B V VAR Word ' a/d 10 bit bsy VAR Bit '0 is mode (no reset, byte, lo speed) '00001011 decoded; ' bit 0 & 1 "11" says all 10 bits, in byte size 'bit 2 says 0 = VDD ref, 1 says 1.1vdc int ref 'bit 3 fixed as 1 'bit 4&5 are address 00 = port 0 01 = port 1 main: OWOUT owio, 0, [%00001011] ' DO: OWIN owio, 4, [bsy] DEBUG "bsy= ", DEC bsy, CR LOOP WHILE bsy OWIN owio, 0, [V.HIGHBYTE, v.LOWBYTE] DEBUG "value of port 0 = ", v.HIGHBYTE, v.LOWBYTE, CR ' GOTO main
Comments
-Phil
I just tried the Dig out and nadda
here's the code (tried both AVRs) it displays all ports high, so no write.
I did do a pins check by running wires from daughterboard header to led's and walked through each pin I had access to and they all went hi n lo, no access to the command pins 'cept SW
btw, is there a better way to post code besides paste'n
copying correction, thx
ModEdit: Code tags added
-Phil
so I busted out the scope, got this screen shot for all those that like to stay up late lookin:)
top = P0 - SDA
bot = P1 _ SCL
thanks
I'm going back to analog, designing n building tube amps .......
https://forums.parallax.com/discussion/158176
-Phil
I do believe they work from a hardware point, since I'm the only "student" anymore, and I drive a buick, I'm gonna keep plugging.
I've found breadcrumbs web'n, but where I'm stuck now, the HMCdatasheet states to do a Read or Write, use $3C, $3D followed by internal reg and data ($3C, 02, 00)
The QMC tells me the internal reg and data, (?? ,$09,$1d), but not what to use for R/W command
and $3C/D just gets me -1, -1, -1
Oh the Qmcdatasheet says the internal I2C ID is set for $FF, really creative!!!!!!