Yes. I have used Basic Micro’s other compilers, so DEBUG is not a complete mystery, although I rarely use it to troubleshoot.
I am using Atom Pro BASIC 8.017 on a PC with XP Home, 3.06GHz Pentup4, 1Gig RAM. I had BM program some H83687s, their Atom Pro Plus chip. This is installed on a development board of my own creation. Yes, I’ve observed all the amenities of good digital design, and have progressed to running both hardware serial ports successfully.
I used the DEBUG button in Atom Pro 8.017 to compile with, turned on SFR monitoring, and clicked on AutoUpdate. All well and good, but the green bar won’t advance beyond the first “sethserial” initialization in my code when I use “single step”, or any other debug stepping method.
I arrived at this point because the ADIN command doesn’t work in any way, shape or form for me. BM’s support told me to program the ADC registers directly, and gave me general directions as to how to do that. Which I’ve done, but it’s problematic. The ADDRD register comes back with zero, whether I’m reading AN3 or AN7. And it only responds when I do four-channels conversions, not for singles. So, I am forced to use DEBUG to monitor registers, but have arrived at this impasse. I would REALLY like to find detailed instructions for using DEBUG, in case I am doing something simple minded, yuh know?
That’s sorta long winded, but I visit forum threads where everybody spins their wheels while they painfully extract details out of the OP over several posts, and I’d like to get it all out here and now.
And the code is:
[code]x VAR WORD
y VAR BYTE
adcsr_val VAR BYTE
fp_VoltsA VAR FLOAT
fp_VoltsB VAR FLOAT
fp_VoltsC VAR FLOAT
fp_VoltsD VAR FLOAT
ADC_Val VAR FLOAT
ADC_Val = 0.00488 ; 4.88mV per ADC increment
ENABLEHSERIAL
sethserial h57600,h8databits,hnoparity,h1stopbits
; ENABLEHSERIAL2
; sethserial2 h57600,h8databits,hnoparity,h1stopbits
MAIN
FOR y = 0 to 255
FOR x = 1 to 65535
ADCSR = %01111011 ; Start scanning conversion, AN0 - AN3, 70 clock states
ADCSR = %01011011
adcsr_val = ADCSR
fp_VoltsA = TOFLOAT ADDRA
fp_VoltsB = TOFLOAT ADDRB
fp_VoltsC = TOFLOAT ADDRC
fp_VoltsD = TOFLOAT ADDRD
fp_VoltsA = ((fp_VoltsA/64) * ADC_Val)
fp_VoltsB = ((fp_VoltsB/64) * ADC_Val)
fp_VoltsC = ((fp_VoltsC/64) * ADC_Val)
fp_VoltsD = ((fp_VoltsD/64) * ADC_Val)
HSEROUT "1- adcsr: ", IBIN adcsr_val\8, 13]
HSEROUT "1-VoltsA ", REAL1 fp_VoltsA\2, ", " ,DEC x, 13]
HSEROUT "1-VoltsB ", REAL1 fp_VoltsB\2, ", " ,DEC x, 13]
HSEROUT "1-VoltsC ", REAL1 fp_VoltsC\2, ", " ,DEC x, 13]
HSEROUT "1-VoltsD ", REAL1 fp_VoltsD\2, ", " ,DEC x, 13, 13]
; HSEROUT “1-”, DEC ADDRD, 13]
PAUSE 1000
NEXT ; x
NEXT ; y
END ; just in case[/code]
Any help is appreciated. Especially guidance on how to do ADC reading(s).
kenjj