Search found 117 matches

by alanwms
Fri Feb 17, 2023 1:17 am
Forum: General
Topic: Timing Problems
Replies: 11
Views: 1810

Re: Timing Problems

kersing wrote:
Thu Feb 16, 2023 9:04 pm
To solve the numbers being to large you can use a loop to call delay repeatedly. If you have a minute spot on you can just loop the number of minutes you need.
But then don't use interrupts because a delay action will mess up the stack and the program will crash.
by alanwms
Wed Feb 15, 2023 10:28 pm
Forum: General
Topic: Timing Problems
Replies: 11
Views: 1810

Re: Timing Problems

Interrupt is better - Simply have the interrupt setup for a specific timer based time, and each time the interrupt is called, increment your variable. In the main loop, simply look for a variable number larger than the time you need, and then set that variable to zero, and turn off your output. Your...
by alanwms
Sun Jan 29, 2023 7:04 pm
Forum: General
Topic: looking for advice
Replies: 10
Views: 2126

Re: looking for advice

The input can't drop fast due to the input capacitance which has enough stored energy to run the regulator which keeps system 5volts until the input capacitor in depleted to around 7 volts. As you can see, my monitor voltage is derived from the 17V power. So the scenario you suggest is not possible....
by alanwms
Sat Jan 28, 2023 6:57 am
Forum: General
Topic: looking for advice
Replies: 10
Views: 2126

Re: looking for advice

My method of saving data at power down was to feed the supply DC voltage into an analog input and constantly poll the analog watching for a voltage below a limit value. Your smoothing capacitor will provide enough energy to allow your macro to run and save variables in eprom. I have posted the schem...
by alanwms
Wed Jan 25, 2023 9:56 pm
Forum: General
Topic: Properties box for the "While Loop" in version FC9
Replies: 9
Views: 1353

Properties box for the "While Loop" in version FC9

Hello - I do understand how the while loop works. Predominantly used if for a specific count value. I tried the "count using a variable" drop down box. That seems squirrely and does not do what I would inherently expect. However, selecting the "loop Count" check box and putting the variable name in ...
by alanwms
Fri Dec 09, 2022 7:00 pm
Forum: General
Topic: Interrupts
Replies: 3
Views: 937

Re: Interrupts

Perfect Ben. Just what I needed.
by alanwms
Fri Dec 09, 2022 2:04 am
Forum: General
Topic: Interrupts
Replies: 3
Views: 937

Interrupts

Hello - I'm putting a signal (sine wave zero crossing) on the interrupt input pin of the PIC18f2553. I'm driving a motor from AC and the drive is a triac. Works well. Normally, I like to store variables in Eeprom, and since I can't continuously write eprom values due to life, I store on power down. ...
by alanwms
Mon Nov 14, 2022 12:27 am
Forum: General
Topic: Annoying issue if you have an error in your code
Replies: 5
Views: 1265

Re: Annoying issue if you have an error in your code

Not ALL variables can be edited. I have noticed that a floating point variable is there to stay. The only way I could edit it (Change it to a non floater) was to delete and start over.
by alanwms
Mon Nov 14, 2022 12:23 am
Forum: General
Topic: Interrupt jumping to specified location in main code
Replies: 7
Views: 1327

Re: Interrupt jumping to specified location in main code

Simply set a flag in the interrupt, Then when you are out of the interrupt, look at the flag, and reset it, then perform your macro.
by alanwms
Mon Nov 14, 2022 12:17 am
Forum: General
Topic: two Motor control help me!
Replies: 5
Views: 909

Re: two Motor control help me!

You might consider stepper motors since it moves in steps - A simple stepper will have 50 poles, and that would equate to 200 pulses per rev if you 1/4 stepped the windings. At that point, counting and providing pulses to each motor would keep them locked in phase. A top speed from a stepper motor i...