Arduino nano runs 4 times slower

Hi guys
For some reason my "Arduino Alpha Nano V3.1 LGT8F328P LQFP32" runs 4 times slower than it must run and I don't know why :frowning: pls help

  1. I must run serial monitor at 2400 baud when it's 9600 in the program (31250->125000 etc.). This is the only way I don't have encoding issues
  2. Making some things (for example, sending messages) on arduino with delay of 1000 works with ~4050 delay

I saw the encoding problem solving here, but I believe it shouldn't work that way

See post 12 here:

Just add:

cli();  // This next section of code is timing critical, so interrupts are disabled  
// Start the timed Sequence for configuring the clock prescaler
CLKPR = 0x80;
CLKPR = 0x01;
sei();        // Enable interrupts

To your setup() code

1 Like

Indeed. The LGT8F328P is a "near-clone" of the ATmega328P chip normally found on the original "classic" Nano and most Nano clones.
That is, it is not exactly the same. In fact, it is better specified than the ATmega328P. However, these are not really suitable for beginners because you have to follow a set of additional instructions to get these to function correctly with the Arduino IDE.

1 Like

Thanks 6v6gt. I wouldn't class myself as a beginner. This thread has been very helpful. I think it shows on the thread that those engaging, particularly jim-p, has pointed me to the clock pre-scale register, so I have got to understand what's going on. My Arduino IDE thinks I'm talking to a normal nano, and there have been a few anomalies to do with time that I haven't totally resolved; but it's working adequately for me to get my job done. I think there's a mechanism for me to install an LGT8F328P personality which would sort out the inconsistencies. I have figured out that the gizmos supplied start up at 1/4 native clock speed, and tweaking the clock pre-scale register can modify that. The issues come down to the consequential changes to things like the UART baud rate, functions like millis(), micros() and the delays, and the knock on effects on the Servo library. The old "round tuit" syndrome has set in - in that I can work with what I've got now that I understand what's happening, but I fancy I wouldn't need the workarounds if I were to give the Arduino IDE the right board personality.

thanks, @jim-p! That works with described problem of quaterspeed, but also I had some issues with additional devices and libs so @6v6gt was right about "not exactly the same".

The problem was I flashed my arduino clone like standart arduino nano, but as a beginner I didn't even know there are different devices and different ways to flash them.
Finally i found materials about exactly my chip: GitHub - dbuezas/lgt8fx: Board Package for Logic Green LGT8F328P LGT8F328D and LGT8F88D
and the manual about flashing exactly my device: Nano 328P-LGFP32 V3.1 · Issue #210 · dbuezas/lgt8fx · GitHub

Arduino IDE settings for Arduino Alpha Nano V3.1 LGT8F328P LQFP32

image

now clock goes how they should and i don't see any additional issues

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.