Beginners question
Cenlasoft
Posts: 265
Hello,
I have written the following for my demo prop board:
CON
_clkmode = xtal1 + pll16x···················· ' Crystal and PLL settings
_xinfreq = 5_000_000························· ' 5 MHz crystal
OBJ
sqw···· : "ECASquareWave"························ ' Square wave object
VAR
pub go
sqw.Freq(5, 0, 353_000)·················· ' Send 353 KHz
repeat
The code sends out a square wave on pin 5. It works. The square wave excites an LC circuit and produces 3 volts DC at resonance after rectifying. I have routed the output (3 VDC) to pin 1 of the prop. When I put a metal object near the coil, It lowers the voltage to about 1.3 VDC or lower. I want to read pin 1 and display if its high or low. If its high, an led should be lit, if low, the led should go off. How can I modify this code to do this?
Thanks,
Cenlasoft
I have written the following for my demo prop board:
CON
_clkmode = xtal1 + pll16x···················· ' Crystal and PLL settings
_xinfreq = 5_000_000························· ' 5 MHz crystal
OBJ
sqw···· : "ECASquareWave"························ ' Square wave object
VAR
pub go
sqw.Freq(5, 0, 353_000)·················· ' Send 353 KHz
repeat
The code sends out a square wave on pin 5. It works. The square wave excites an LC circuit and produces 3 volts DC at resonance after rectifying. I have routed the output (3 VDC) to pin 1 of the prop. When I put a metal object near the coil, It lowers the voltage to about 1.3 VDC or lower. I want to read pin 1 and display if its high or low. If its high, an led should be lit, if low, the led should go off. How can I modify this code to do this?
Thanks,
Cenlasoft
Comments
Instead of the "repeat" use:
The LED should have its anode connected to pin 0 through an appropriate series resistor and its cathode to ground.
I'll try it now.
Cenlasoft
I used the demo's board pin 23 and it works beautifully. Thanks. Now I will try to figure out how the measure this voltage. I have viewport and I want to use the digital scope in the software. Is there another way to measure the voltage? I tried an ADC, but it loads the circuit.
Cenlasoft