Help to change Mhz in minipro processor

For general Flowcode discussion that does not belong in the other sections.
Post Reply
solozerouno
Posts: 113
http://meble-kuchenne.info.pl
Joined: Tue Dec 08, 2020 4:36 am
Has thanked: 2 times
Been thanked: 2 times

Help to change Mhz in minipro processor

Post by solozerouno »

As you told me to change the delay time of Arduino mini pro I changed the atmel 328p chip to 2Mhz ..... The delay frequency is exact ..... but these micro should run at 16/20 Mhz, main reality does not happen and if I set the frequency of 16 Mhz the flashing of the led connected to ap pin 13 no longer stops turning off or on ..... Something is wrong, I saw that it is possible to set a myriad of settings with different frequencies, dividers and other parameters ..... assuming you can set the chip with the correct frequency of 16/20 Mhz in that way and in the frequencies available on the right always select 16/20 Mhz as I have to set the data on the left (where if you select the line comes out an infinite number of settings of which I do not know the settings and it is not explained anywhere) ..... what do I do to make the mini pro run at the maximum frequency, I have to choose a precise line, but which one. In Arduino correct delay= correct led d13 link....... Please answer me !! ??
Thanks solozerouno.

medelec35
Matrix Staff
Posts: 1463
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 513 times
Been thanked: 473 times

Re: Help to change Mhz in minipro processor

Post by medelec35 »

Hi
solozerouno wrote:
Mon Apr 04, 2022 12:41 am
but these micro should run at 16/20 Mhz,
That depends on the designed hardware.
If you the 3.3v i.e. the voltage regulator is KB33 the the frequency will be at 8MHz.
The 5V version with a KB50 regulator will run at 16MHz.
That is why you have a choice of two Arduino Pro mini versions.
I would suggest checking what volte regulator you have on board and set the target device for the correct version.
Set up a 1 sec flasher
If you have a Iogic analyser or a scope, then measure the exact on/off duration, and let us know the results.
If not got scope then use a stopwatch and time as accurately as possible using the onboard LED.
All Flowcode does for the devices with boot loaders is set the delay times up.
The hardware clock speed is determined by the onboard resonator and divide by 8 within the boot loader settings.
Therefore you could have an issues with your hardware since they are only designed to run at 8 (3.3V) or 16MHz (5V).
I have not got a pro mini, but does the ceramic oscillator have any marking on it.
Or if you have scope, can you measure the clock frequency?
Martin

solozerouno
Posts: 113
Joined: Tue Dec 08, 2020 4:36 am
Has thanked: 2 times
Been thanked: 2 times

Re: Help to change Mhz in minipro processor

Post by solozerouno »

to have a delay of 1 second I have to set the chip 328 with the avr pack that I bought at 2 Mhz .... you said that the clock is divided by 8 and therefore if I have not misunderstood 16 Mhz divided by 8 is 2Mhz .. .. note that I compile in hex file and load the program with the TL866A II PLUS programmer ..... but I don't know how to solve the problem as I delete the arduino bootloader and load the flowcode 9 program in " pure "maybe the problem is that flowcode divides x 8 thinking that there is the original Arduino bootloader, is it possible to stem this defect if that is the problem? Let me know what to do ...... thanks solozerouno

solozerouno
Posts: 113
Joined: Tue Dec 08, 2020 4:36 am
Has thanked: 2 times
Been thanked: 2 times

Re: Help to change Mhz in minipro processor

Post by solozerouno »

the strange thing is that I also program arduino with icsp and everything runs right with the clock at 16Mhz, .... but I don't understand all the settings of the 328 chip in the avr pack with the various Mhz and other parameters ..... which one I choose for a correct delay? and then if it is enough to use the fixed parameters such as 16, 8, 4Mhz what are the settings on the left that say for example from 3 to 8Mhz, etcetera ..... Thanks solozerouno

solozerouno
Posts: 113
Joined: Tue Dec 08, 2020 4:36 am
Has thanked: 2 times
Been thanked: 2 times

Re: Help to change Mhz in minipro processor

Post by solozerouno »

AVR hardware has a divide by 8 configuration setting which can often be enabled by default, e.g. if your 1 second delay is lasting 8 seconds.

Do not disable the SPI clock in the AVR configuration as this will effectively disable the serial programming interface used by the AVRISP mkII and TinyISP etc.

Arduino devices should come pre-programmed with the right configuration settings and bootloader. The serial interface is required to re-program the bootloader if required.

I think the problem is just what is written here in your guide, how I solve this problem if I write the chip with icsp and obviously without Arduino bootloader ...... thanks solozerouno

solozerouno
Posts: 113
Joined: Tue Dec 08, 2020 4:36 am
Has thanked: 2 times
Been thanked: 2 times

Re: Help to change Mhz in minipro processor

Post by solozerouno »

I don't use tinyisp or avrisp II to program but I use the TL866A II PLUS and therefore I don't need compatibility with these programmers so I shouldn't have this compatibility with them but have disabled this divider by 8 as it gets around the problem as using a clock of 16 Mhz my 1 second delay really lasts 8 seconds and hence the clock setting divided to 8 and is precisely 2 Mhz ........ thanks solozerouno

medelec35
Matrix Staff
Posts: 1463
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 513 times
Been thanked: 473 times

Re: Help to change Mhz in minipro processor

Post by medelec35 »

Ahh
solozerouno wrote:
Mon Apr 04, 2022 11:13 am
I use the TL866A II PLUS
Ah, that is your problem.
What you should have done from the beginning is to use the PC USB cable plugged in to the PC and to a suitable UART to USB converter.
The converter is then connected to the mini Pro.
Here is an example on how to do it.
The only difference is you are using Flowcode instead of Arduino to make the programming a lot easier.
Then select the correct mini pro version via project options, not the atmega328p.
Finally use compile to target as a separate programmer is not required.
What you have ended up doing is overwriting the bootloader code, that's why its running at the wrong speed!.
You will need to use your programmer to load the boot loader back on to your mini pro.
This is not a bug of Flowcode so I have moved the topic to the general section.
Martin

solozerouno
Posts: 113
Joined: Tue Dec 08, 2020 4:36 am
Has thanked: 2 times
Been thanked: 2 times

Re: Help to change Mhz in minipro processor

Post by solozerouno »

i don't understand a thing having the avr pack if i wanted to program a 328p chip without bootloader i could do it and load the hex code on the chip without putting the arduino bootloader first? in the case of my minipro I can not use the icsp without bootloader? I can pretend that the minipro is programmable as if it were the virgin 328p chip (not with the bootloader) ..... if so what setting right? I had read that the 328p chip has an internal 8Mhz oscillator, do you think? as if you can settle it? at worst I can use this trick to avoid loading the bootloader? or I put my soul in peace and reprogram all the minipros with the bootloader and use the serial from flowcode 9 and program everything at 16Mhz ... please help me ...... thanks solozerouno

medelec35
Matrix Staff
Posts: 1463
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 513 times
Been thanked: 473 times

Re: Help to change Mhz in minipro processor

Post by medelec35 »

solozerouno wrote:
Mon Apr 04, 2022 10:04 pm
i don't understand a thing having the avr pack if i wanted to program a 328p chip without bootloader i could do it and load the hex code on the chip without putting the arduino bootloader first?
As you referred to an Arduino mini pro, which implies you wish to use it as an Arduino mini pro i.e. via boot loader.
If you do not then it would have been better to mention Atmega328p as the target device instead along with the crystal/resonator value.
As you got an external crystal or resonator, that would be better than the internal oscillator.
As it's your project it's your choice of course.
You will need to remember that whatever choice you make, unlike the PIC, the AVR has to be running correctly for it to be programmed.
For example, if the configuration is for the external osc, which is removed from the board, then the AVR will fail to program.
Would you like help with external osc or still want to use the internal osc?
Can you post your project file as well, please?
Martin

Post Reply