Pro mini 3.3v trouble

Having trouble with a pro-mini (knockoff) 3.3v 8mhz.

If I upload using a cpu Freq of 16 mhz(default pro mini board settings) it works as expected, except the serial monitor has to be set to half the baud rate. As one would expect.

But when I upload a sketch using the expected 8mhz settings, nothing else changed, I get gibberish out the serial monitor no matter what baud rate it's set to.

Any ideas on what's going on?

Thanks!

Are you aware of this

Which IDE version?

Same behavior in 1.8.19 and using visual micro in visual studio (not surprised since it's the same compiler).

Same behavior in 2.3.2

I'm starting to wonder if it's a bootloader problem.

Yup, even went so far as to look at boards.txt

The cpu clock speed has little to do with the baud rate. simply match the baud rate in the sketch to the ide.
Obviously also pick the correct CPU and clock as I showed it post #2
I have similar boards and have no problems.

Just set the Tools selector to match what is written on the chip in terms of CPU and clock. Set serial monitor baud rate to match sketch baud rate.
I have done this many times.

The clock & pre-scaler settings are calculated using the F_CPU macro which is defined at compile time by the core.

Mine works and yours does not.

I think you have the pro mini with the LGT8F328 processor which runs at 32MHz
Do you have a link to the website where you purchased it?

1 Like

whatever gave you that idea. Your statement is incorrect. The actually clock-speed in combination with the register settings defines the actual baud-rate. At runtime, a calculation is done to achieve the settings for the registers that matches the requested baud-rate as close as possible and this calculation is done with the clock-speed setting that is provided at compile time. If the Clock speed and the defined macro that hold the clock speed don't match, a calculation will be made based on incorrect input..

It could be that the bootloader has the wrong fuse settings.

I am assuming that the Crystal actually is 8MHz, but the fuses could be set to the internal resonator maybe.

does that run at 3.3v ?

Yes

@wafuru
So if you provide a link to the webpage we might be able to tell if it's a LGT8F328P

Hmm interesting, but doesn't that require a 32MHz crystal in that case ?
and

Which would mean that the registers are set going from a F_CP of 16MHz while it is actually running at 8MHz. If it was running at 32MHz it would require the Serial monitor to be set at double speed.

No.

1 Like

No again

1 Like

eh because ? You will have to elaborate there. Are you saying that the clock-speed of the CPU is 32MHz, but the registers need to be set since there is an 8 MHz Crystal (there isn't a 16MHz one in there obviously) controlling the UART. A simple Yes & No is just not enough unless you are Mika Hakkinen.

First let's see if it is a LGT, then we can go from there.

Ok but even if it isn't i would still the explanation. I suppose i can study the datasheet.

Rather than testing serial with F_CPU set to 8 MHz, try the "blink" example, set to blink the LED at 1 Hz, and tell us the actual blink rate.

Incidentally, if the CPU is running from the internal 8 MHz RC oscillator, the frequency can be far enough off to explain gibberish on the serial monitor. But why serial seems to work (at half Baud rate) if F_CPU is set to 16 MHz is not clear.