witch ones do i need remove?
Currently the 10 extra spaces in the following 5 lines, because the forum else removes the text.
#include < avr/io.h >
#include < avr/interrupt.h >
#include < avr/pgmspace.h >
#include < util/delay.h >
#include < LiquidCrystal.h >
A duty cycle of over 100%, so we have phasing, the LEDs will overlap each other?
Up to 150% atleast. Up to 199% would be better...
Mabbye a sub program tonmake this work? Can be in a derfent mode?
What do you think? Eazy or will it be a total re build of the code?
Your skills are freekin sweet sir!
Also, to make a GUI... It would just read and write from a serial connection? So just read and wright commands? That should be eazy yeah?
Indeed gui would get/set commands and with the calc variables the gui pots/sliders have the correct ranges so it should be less code then the pulse fire code itself, but the gui is very last on my list.
The pulse fire code will work with only the outputs connected all other connections are OPTIONAL !!
The pots I use are 100k but are dividers between 5v and ground so any value would work correct, but would not go below ~5k because else current in pot will get too large.
I've checked the code rawbush posted and think I can add a request freq command what will set multiple variables in one command.
(and realized that it is c++ code in arduino ide, so code can be clean a bit more)
But first thing is to get the variables saved so we can setup the chip
with some commands and use it standalone in different applications.
For example I need 3 output for classic plate cell in my car where the 2 analog inputs maybe connect to engine temp for soft start and the other to gas valve or the vacuum sensor which is the ~inverse.
For tube cell I need 1,2,3 or 6 output, etc,etc.
So I want it to be so universal as it can be as a sort of pwm.
For the overlapping of outputs there need to be new pulse mode.
In the pwm code for 1 output in my autolpm code I used bit fields to sumulate duty and bursting by shifting it to the output bit, like this;
uint16_t ppm_seq_type_data[25] = {
0b1000000000000000, // 93.75% - 1
0b1100000000000000,
0b1110000000000000,
0b1111000000000000,
0b1111100000000000,
0b1111110000000000,
0b1111111000000000,
0b1111111100000000, // 50% - 7
0b1111111110000000,
0b1111111111000000,
0b1111111111100000,
0b1111111111110000,
0b1111111111111000,
0b1111111111111100,
0b1111111111111110, // 6.25% - 14
0b1010101010101010, // turbe mode 50 %
0b1010101011111111,
0b1010101111111111,
0b1001001111111111, //
0b1001001001111111,
0b1001001001001111,
0b1001001001001001,
0b1000111111111111, //
0b1000011100110111,
0b1000001111100011
};
I think this concept can also be done for multiple outputs where every output is one step state ahead.
But it will make freq calc more difficult, I currently find it already hard to get all the options in the calculation which influence the output freq.
Also there still needs to be some changed to the code for steping because i also want have good resolution on higher speeds.
To have a led overlap of 100% you can do that already, start typing;
pulse_init 3 (Start with 2 output on)
pulse_steps 64 (because higher init value steps are bigger)
But when enabling other options the cycle of the first 2 outputs will alway be the same.
Try this;
pulse_init 1 (back to start with one output)
pulse_steps 16 (back to 5 steps/outputs)
pulse_duty 10 (Add wait after train now 10*train_loop to wait before starting next pulse train)
train_loop 5000 (increase speed so now wait 5000x for doing next step)
train_inc 200 (lower train_loop value per step, so nice max value is train_loop(5000)/number_of_outputs(5) = 1000)
step_loop 2000 (enable off time after step, so wait 2000x step int before forint next step)
step_inc 150 (make off time less per step again nice max is step_loop/steps)
So after adjusting x_loop you often also adjust x_inc.
For x_clock and x_tcnt it is more complicated; x_clock determents the divider of the cpu clock (16Mhz) to the hardware counter currently 0.
And the _tcnt is the inital value of the hardware counter which we use to divider the clock by 16. So setting the clock to divider by 64 the tcnt value should also be change to reflect the correct base freq which is fed to the (wait) x_loop variable.
I guessing magnagas clusters into N/S and travel like pulses in the tube.
Then you can get a bit of voltage when coil is around tube, so to add triggering coil just in front of power coil, to do this do something like;
Add trigger coil to ground and other side to diode which goes into comparator IC other side comparator is connected to pot which is in between Vcc and ground.
Output is fed to pin D2 and selected via "pulse_trigger 2".
(maybe the first small winding on your core can function as trigger coil)
Hope be to online somewhere next week for skype, until then lets get good results.