Look at the date of post #57. It is mind-boggling what has gone on in the world since then. I hope all of you who said goodbye are well.
Type: Posts; User: peterdeco1; Keyword(s):
Look at the date of post #57. It is mind-boggling what has gone on in the world since then. I hope all of you who said goodbye are well.
Just my 2 cents here. On most of my 16F819 projects idling current is about 5mA. When I add NAP 0, it drops to 1/2 mA. I put it at the top of the program where it's waiting for something such as a...
At work, we make a product that detects hand motion to light up a string of LED's. You can use a FET to drive the soap pump motor. We use the ADC in a 12F675 to detect fluctuations from a 5528 LDR....
Yes it is old. I think it's version 2.65 or something.
I have used the following header for the 12F683 many times and never encountered any compiling problems. Try it.
CMCON0 = 7 'comparators off
ANSEL = 0 'all inputs digital, the adcin command...
Maincode:
Adcin 0,x
if x=128 then y=y+1
if x=0 then y=y-1
pause 100
if x=255 then pointcheck
if x < 255 then maincode
pointcheck:
Gosub display
goto maincode
I like Tumbleweed's code. Shorter and more to the point.
Will this work for you?
iflag var bit
let iflag =0
reader:
adcin 0,Z
pause 100
IF Z>100 AND Z<130 THEN I=I+5
IF Z<100 and iflag = 0 THEN I=I-5 'only if iflag = 0 it's OK to substract
I have an ICD 2. How do you use it to program PICs? There's no IC socket.
Michael I only needed to use the 'F88 for 1 project. Here is my header. I never had any trouble with the inputs or outputs.
OSCCON = $60 'set int osc to 4mhz
ANSEL = 0 ANALOG INPUTS NONE
ADCON0...
Yes Ioannis I would expect it would have issues at high speed. It was an experiment at low speed just to see if a PIC could "mirror" an output on multiple pins.
Yes. A while back I tied the HPWM output to an input and programmed it to make all my output ports go high and low with the input. I had multiple outputs at the same frequency as the HPWM.
I looked into that a long while ago and was told to optimize my code (which I did) or move to an 18F part. The 18F part number recommendations did not have the same pinout. Unless Microchip released...
Merry Christmas and Happy New Year to All.
NO! Don't hit the off switch. If it comes to that, ask for donations and count me in.
It's hot here in New York too Dave.
I always leave watchdog timer on. I use nap 0 to reduce current drain.
start:
nap 0
if porta.1 = 1 then run
goto start
run:
xxxxxxxxxxxxxxxxxx
Hello everyone. I have a question that is confusing to me. If I draw 1 amp from a battery for 1 second and do this 2 times per minute, how many amp hours am I draining it? I'm trying to figure out...
Thank you everyone. I found a spot that goes up to a full 3V when the circuit is activated but is a difficult connection to make. I'm going to use the ADC solution as this connection is much faster...
Unfortunately the circuit board is already manufactured with a pull down resistor network. The switch that activates the circuit which I'm trying to detect goes to ground when pushed. True, I can use...
Thank you Henrik. I need to find another way to detect when the circuit is active.
Hello all. I'm running a 12F683 at 3.3V. One of the GPIO's is connected to a place in a circuit that rises to only 1.2V when it's activated. Is this enough voltage to reliably support the code "if...
I have 4 identical circuits. If I put at the top of each program:
X var word
pause x
and power up all 4 at the same time, will X be a random number on each of them? The idea here is to make...
Hello. A while back I used this routine to generate 38KHZ with a 12F675 running at 4MHZ.
STARTBIT:
High GPIO.4 'GETTING 38KHZ WITH THIS SUBROUTINE
High GPIO.4
Low GPIO.4
Low GPIO.4
LET X =...
I don't think you will be able to generate 2 distinct tones. From the PBP manual:
Frequency is the desired frequency of the PWM signal. On devices
with 2 channels, the Frequency must be the same...