(you are viewing a thread; or go back to
list of threads)
Poor understanding of counter fundamentals (by Ziggy)
OK ...
I am ashamed to say it but ...
Please see the attached file
The idea is that there is a sensor input which instigates a change in PWM duty cycle.
Duty cycle varies between 50 and 0.
Upon starting the ladder initialises warning light and sound
When the sensor button is pressed the light keeps on working while the sound is extinguished based on a combination of three links which short PD5 PD6 and PD7 to ground respectively.
If the sensor button is depressed for longer than 3 counts an output pin latches.
Everything simulates nicely I think. But when the hex file is loaded into the micro ( AtMega8) the three links do not have any influence on the timing of PWM signal.
Any comments welcome. I have obviously missed some finer point and the outcome is garbage
(no subject) (by Ziggy)
It seems the three shorting links are not recognised/decoded correctly
(no subject) (by MGP)
I dont understand what you mean, neither how the program works.
Can you tell us what the input do..
Xon = .............
Xtwo= ............
..
(no subject) (by Ziggy)
Xone Xtwo and Xthree are inputs which should allow different counters/preloads to be selected ( rungs 20 to 27)
Xon is the sensor button which causes the PWM output to run with 0 PWM coefficient for the duration of selected counter final count ( rung 18).
By presetting Xone etc prior to commencement of simulation, different end counts are to be selected.
(no subject) (by Ziggy)
The real question is
how to read the status of three input pins
and set the up counter end of count based on the configuration of the three bits
111 -> 45
110 -> 40
101 -> 35
100 -> 30
011 -> 25
010 -> 20
001 -> 15
000 -> 10
(no subject) (by Ihor Nehrutsa)
Used 'Look-Up Table' element
(no subject) (by Ihor Nehrutsa)
Fragment of CHANGES.txt
...
== Release 3.5.0 experimental pre-release
* Modified:
Max value in Element COUNTER and CIRCULAR COUNTER
was defined as
int max;
now redefined as
char max[MAX_NAME_LEN];
Now you can use variable as argument of a COUNTER.
It allow to create more sophisticated algorithms in LD.
...
(no subject) (by Ziggy)
Hello Ihor,
Thanks for Your advice.
Sadly just like my original efforts it simulates perfectly however when hex is loaded into the micro the selection of counter preloads does not happen.
I have written a small program to check the pins are corectly identified and do in fact respond.
I shall try to mock it up using another processor chip ( 28 pin DIP ) to check the hardware more thoroughly.
Will come back to cry some more I am sure.
(no subject) (by Ihor Nehrutsa)
I will try simulate in Proteus.
(no subject) (by Ziggy)
This is the ladder diagram I have tried to run on both package styles of ATmega8.
The 32 pin device was on a PCB, the 28pin device on STK500 board.
Accounting for STK500 inverted switch and LED functioning no difference and no joy.
I can only conclude I must be making some cardinal mistake in my application of LDmicro.
(no subject) (by Ziggy)
Apologies... did not attach the file
(no subject) (by Ihor Nehrutsa)
Please show the technical specification, algorithm of work.
I dont understand what you mean.
(no subject) (by Ihor Nehrutsa)
You can delete elements after an 'OPEN-Circuit' element.
Post a reply to this comment:
|