Greetings. I am completely new to PlatformIO so apologies if this is a dumb question.
I’ve purchased several cheap Arduino clones which are called “WAVGAT UNO R3”. I believe these use the ATmega328P chip. I found software for the Arduino IDE, installed it, and tested there and it seems to work OK. I tested with your garden-variety blink code: LED on, delay 1 second, LED off, delay 1 second.
Anyway, I’ve (tried to) set up a VSCode/PlatformIO environment for this board (the Arduino IDE leaves much to be desired, at least for me.) I’ve already used this IDE to load firmware into my 3D printer, so I think my environment setup isn’t too far off.
I’m now trying to use that same IDE to program the WAVGAT. I couldn’t find much for platformio for this board, so I decided to try to copy one of the other boards that use the same cpu.
I can now compile and upload to a WAVGAT using the VSCode/PlatformIO IDE - however, the timing I get seems way off. By that I mean a “delay(1000)” in the code produces delays that are far longer than 1 second (more like 3 or 4). In the Arduino IDE, uploading the same code seems to yield accurate timing.
The “specs” on the WAVGAT suggest that it runs at 16MHz. That is what I originally put in the platformio board definition. When I saw that the timing was way off, I tried playing with the board speed just to see what would happen. I seem to get “better” results if I decrease the CPU speed in the board definition. I’ve tried setting it all the way down to 4MHz, and got faster blinking, but I’m puzzled about why the 16MHz seems so far off, and what I should be using instead (or what else I probably have missed.)
Thanks for any help!