Debugging Serial Terminal
Hello folks,
I am currently attempting to print out values coming from my MCP3208 ADC converter in the parallax serial terminal window and I am having trouble accomplishing this. I am pretty sure my code is correct, but recently fried my PropUSB built in EEPROM and might have fried something that deals with this usb interface.
Here is my code:
Regards
Robert
I am currently attempting to print out values coming from my MCP3208 ADC converter in the parallax serial terminal window and I am having trouble accomplishing this. I am pretty sure my code is correct, but recently fried my PropUSB built in EEPROM and might have fried something that deals with this usb interface.
Here is my code:
CON
_CLKMODE = XTAL1 + PLL16X
_XINFREQ = 5_000_000
OBJ
adc : "mcp3208"
Debug : "FullDuplexSerialPlus"
Terminal : "Parallax Serial Terminal"
VAR
LONG curradc
PUB main
Debug.start(31,30,0,38400)
waitcnt(clkfreq*2 +cnt)
Debug.tx(Debug#CLS)
adc.start(29, 28, 27, %1111_1111) ' start ADC MCP3208
repeat
Debug.tx(1) ' Send the HOME code to the DEBUG terminal
Debug.str(string("Gyroscope ADC Value")) ' Display Header Text
Debug.tx(13) ' Send the RETURN key code to the DEBUG terminal
curradc := adc.in(0) ' Get input
Debug.dec(curradc) ' Print
Debug.str(string(" "))
Regards
Robert

Comments
It seems you can download stuff to the prop (big assumption here) which would suggest that the USB part is still working. I'm a bit concerned about using the I2C pins (28 & 29, by convention) for the ADC. Is that correct?
Some extra info: I burnt parts of my PropUSB version chip by putting a 13V supply into the VIN pin.... it still works but I don't know the extent of the damage...
Robert
Could you add an incrementing value (result++) to your output to verify that it actually stopped?
Regards,
Robert