I,ve decided to ditch using op-amps to condition the signal for my altimeter and just use a max187 12-bit adc to supply the voltage to the 18x picaxe.
Before, when using the internal 10-bit ADC, I was able to 'manually' program the lookup table of a 24lc256 eeprom by sending 256 bytes from internal eeprom space over i2c. As there were 1024 words to write, it took 8 versions of the program with different data and addresses to completely program the table. Now that I have 4 times that amount of data to program, I,d like a easier approach. My idea was to use quick basic to supply the data from a file, sending it over via a serial port, and the picaxe then sending over i2c to the relevant address of the i2c eeprom. However, my program seems to stall after the 1st byte sent and I don't understand why. Here is the qbasic code, only to get the principle working, ie not complete :
..and the picaxe code, again, only to prove the principle :
Note that I,m using port 0 for IN, and port 5 for OUT of the picaxe.
When the QBasic code is run (after the picaxe is already running) the following is seen typically:
E796
Received : E796
E753
...and then it stops. Note that the LED comes on, then goes out, so I am assuming that the picaxe has stopped at the 'start:' label, ie waiting for more serial input. If I hit the reset button on the picaxe, 'Hi' is sent and received by qbasic, then the next number in the talbe is successfully sent and received, ie :
E796
Received : E796
E753
Received : Hi
E710
Received : E710
E6CD
..and stops again.
Any idea's why only 1 packet is sent and received? Incidently I,d be quite happy to move over to VB.net code, as I,ve followed a couple of the Doc's Instructable's, if its possible.
Cheers,
Texy
Before, when using the internal 10-bit ADC, I was able to 'manually' program the lookup table of a 24lc256 eeprom by sending 256 bytes from internal eeprom space over i2c. As there were 1024 words to write, it took 8 versions of the program with different data and addresses to completely program the table. Now that I have 4 times that amount of data to program, I,d like a easier approach. My idea was to use quick basic to supply the data from a file, sending it over via a serial port, and the picaxe then sending over i2c to the relevant address of the i2c eeprom. However, my program seems to stall after the 1st byte sent and I don't understand why. Here is the qbasic code, only to get the principle working, ie not complete :
Code:
OPEN "COM2:2400,N,8,1,RS,CS,DS,CD" FOR RANDOM AS #1
OPEN "table.txt" FOR INPUT AS #2
start:
INPUT #2, abc$
PRINT abc$
PRINT #1, abc$; CHR$(13); CHR$(10)
FOR j = 0 TO 50: NEXT j
INPUT #1, def$
PRINT "Received : "; def$
GOTO start
Code:
symbol LED=0
serout 5,N2400,("Hi",cr,lf)
;goto main
start:
serin 0,N2400,b1,b0,b3,b2
high LED
pause 2000
serout 5,N2400,(b1,b0,b3,b2,cr,lf)
low LED
pause 2000
goto start
When the QBasic code is run (after the picaxe is already running) the following is seen typically:
E796
Received : E796
E753
...and then it stops. Note that the LED comes on, then goes out, so I am assuming that the picaxe has stopped at the 'start:' label, ie waiting for more serial input. If I hit the reset button on the picaxe, 'Hi' is sent and received by qbasic, then the next number in the talbe is successfully sent and received, ie :
E796
Received : E796
E753
Received : Hi
E710
Received : E710
E6CD
..and stops again.
Any idea's why only 1 packet is sent and received? Incidently I,d be quite happy to move over to VB.net code, as I,ve followed a couple of the Doc's Instructable's, if its possible.
Cheers,
Texy