Posted: Sun Feb 08, 2015 3:18 pm Post subject: getRC lib OK?
Hi All,
I seem to have some issues with getRC and Bascom AVR.
Setup:
Bascom AVR 2.0.7.8
Board 1: Arduino Uno board (M328P)
Board 2: Chip45 Crumb Xmega128A3 board
RC network with 10K and 100n ceramic Cap, build as decribed in Bascom help file (getRC command).
Issue:
The Arduino board gives me a value via the comms terminal but it is always 1, even if I change capacitor value (up to 1u) or change resistor value (up to 100K).
Always the value 1, however it does generate a pulse (see scope screenshot).
FYI disconnecting the scope probe sees no difference (so no probe capacitive loading issue there).
For Xmega the value is always 0, and no pulse comes out of the pin, code slighly different.
Tried different ports and pins, result the same.
Lib Faulty?
Test code for Arduino board
Code:
$regfile="m328pdef.dat"' used micro $crystal=16000000' used xtal $baud=19200' baud rate we want $hwstack=40 $swstack=40 $framesize=40 config clockdiv =1' either use this or change the divider fuse byte
'------------------------------------------------------------------------------- dim w asword , b asbyte dim s asstring*6 , ar(6)asbyte dim RCVal asword configportb=output' make portb an output
do waitms1000' wait 1 sec toggleportb' toggle level
RCval =getrc(PIND , 7) print"RC value: "; RCval ' test serial com
w = w +1: s =str(w)' convert w to a string str2digits s , ar(1)' convert string into an array with binary numbers loop
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum