cicle time (by Mauro Luis Rudnicki)
Hello.
I would like to know if there is a possibility to work with a cicle time minor than 10ms. I had a project that I need generate a frecuency of more or less 40 kHz. is it possible? I'm using build 4.4.2.0.
Thanks
(no subject) (by Ziggy)
At 40 kHz period is 25micro seconds.
To be able to generate the two halves of one period You are looking at a time sub period of 12.5 micro seconds.
This is Your longest loop time that might be sufficient to generate 40 kHz periodic signal.
Anything shorter than 12.5 microseconds loop time will do the job although the real requirement is that the loop time needs to be such that 12.5 divided by loop time gives integer number .
You can also try runing the ladder with loop time set to zero and actually measuring the signal frequency and may be padding it with delays for a better value.
And yes if zYou run a ATmega micro at 16 MHz you will have all of 200 processor clock cycles to do it in. It may be time for assembler to squeeze every clock cycle.
cicle time (and high frequency output) (by DanielH)
I agree with MGP approach.
Using PWM in a PIC16F887 with 20 MHz crystal, I habitually set 1.25 MHz as the base frecuency for my analog output circuitry, 0-10 V or 0(4)-20 mA.
It works fine, with a PWM 10 bit resolution (thanks you, Igor!). I only see slight errors due 1% tolerances in TH resistors.
1.25 MHz is the max. frequency achievable using 20 MHz Xtal (20,000,000/16).
I'm using this developing an Open Hardware + Free Software PLC for educative purposes, based on that PIC.
I'm using LDmicro as IDE, and TinyBootLoader as asociated transferring option (PIC burner not needed to daily use).
(no subject) (by Ihor Nehrutsa)
to DanielH
Do you use TinyBootloader.exe with command-line arguments?
Do you use TinyBootloader.exe in ldmicro\flashMCU.bat to write the HEX into MCU from the LDmicro menu or by pressing F6 key?
If yes, please publish your flashMCU.bat and I add it to LDmicro release.