Arduino R3 Timing and first time programming confusion

For general Flowcode discussion that does not belong in the other sections.
Post Reply
User avatar
p.erasmus
Posts: 434
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Arduino R3 Timing and first time programming confusion

Post by p.erasmus »

Hi Team

I have now installed the AVR tools and I am trying to program the UNO(first time in my life working with an ATMEGA)
as you suggested Ben I am using Xloader to program the hex file that is working however from FC I cannot program as FC is looking it seems for AVR programmer(AVRdude not sure) ,where do I download the programmer SW that FC is looking for ,I looked for Avrdude but find a lot of things I will not trust(russian sites :D )

Then Creating a simple chart that toggle led at pin13 on the UNO it is working fine but the timing is out by factor 3 (set 10mSec delay actually 30mSec9,Please help me to setup the UNO correctly Ben ,as the I2C debugging I want to do at the end of knowing the UNO is running correctly wili not work now.
I have the impression the mcu is running on a internal 4Mhz Clock ,can this be I do not know this micro

(It is a chinease clone Wavgat they are actually a good company for these clone stuff :? the board has a 16mHz Xtal on boards)

P2.jpg
P2.jpg (23.32 KiB) Viewed 4670 times
P1.jpg
P1.jpg (46.79 KiB) Viewed 4670 times
P3.jpg
P3.jpg (107.87 KiB) Viewed 4668 times
Regards Peter - QME Electronics

BenR
Matrix Staff
Posts: 1924
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 684 times

Re: Arduino R3 Timing and first time programming confusion

Post by BenR »

Hi Peter,

Flowcode comes with Avrdude, you should just need to set the COM port in the project options to allow program to chip to work. Note it may look selected but make sure you go in and actually click on the setting as there is a known bug where it's not actually selected.

Strange about the timings. There is an internal oscillator but it's set to 8MHz not 4Mhz so that's very odd. The chip should come programmed with the correct config settings to allow it to run at 16MHz so it's strange.

Are you using the ATMEGA328P or the Arduino Uno R3 target device in Flowcode?

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: Arduino R3 Timing and first time programming confusion

Post by p.erasmus »

Hi Ben.

Yes you are right it look as if avrdude is selected and the reason Iwas thinking I miss the tool :D I will try to set it up ,

I am using the UNO R3 as here ,What should I use Ben ?
P6.jpg
P6.jpg (61.49 KiB) Viewed 4656 times
I just programmed the board from the Arduino IDE and the timing is running fine then ,
this is the fuse settings that is defined in the HW profile wavgat made for the board that the Aruino can see this board and make it available in the IDE as a WAVGAT UNO R3 sketch,I think there is asetting/fuse different with the Chinease boards not sure my knowledge not enough for these issues :oops:

Code: Select all


lardu_328p.name= WAVGAT UNO R3
lardu_328p.upload.tool=avrdude
lardu_328p.upload.protocol=arduino
lardu_328p.upload.maximum_size=29696
lardu_328p.upload.speed=57600
lardu_328p.bootloader.tool=avrdude
lardu_328p.bootloader.high_fuses=0xff
lardu_328p.bootloader.low_fuses=0xff
lardu_328p.bootloader.extended_fuses=0x07
lardu_328p.bootloader.path=lgt8fx8p
lardu_328p.bootloader.file=lgt8fx8p\optiboot_lgt8f328p.hex
lardu_328p.bootloader.unlock_bits=0x3f
lardu_328p.bootloader.lock_bits=0x3f
lardu_328p.build.mcu=atmega328p
lardu_328p.build.f_cpu=16000000L
lardu_328p.build.core=lgt8f
lardu_328p.build.variant=lgt8fx8p
lardu_328p.build.board=AVR_LARDU_328E

EDIT[]
Seems I can not change or make the programmer settings active Ben,I try to brows or click on the tabs with no effect :oops:
P3.jpg
P3.jpg (49.87 KiB) Viewed 4652 times
Regards Peter - QME Electronics

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: Arduino R3 Timing and first time programming confusion

Post by p.erasmus »

Hi Ben ,

Thanks for your help ,I think we should stop this it is wasting time for nothing, :D

I noticed the Following the Board Bootloader is set to a baud rate of 57600 and flowcode do 115200 this is the first issue why Flowcode do not connect I think.
Secondly this is the main reason I have avoided AVR and STM's over the yeasr the datasheet just make no sense to me it does not show the registers and bit as clear a Microchip ,again I will never work with AVR or the other I am too stupid for the datasheets :D simple fuse setting in MCP takes 5 minutes to see what and how they work,in the ATmega datasheet I found after 1 hour only the prescaler table :oops: .

I flashed the UNO scada Firmware from the wiki and will try to get the UART or I2C working if not then I order ECIO28 that I work with a chip I understand :D

I want to ask if it would be possible for you to make me a UNO SCADA Firmware that flash the pin13(at a specific time/rate that I can see if the timing is correct) on my board and that I can see the board is running when working with the scada thats all I want to ask and we wave this UNO programming with the Chinese board. it is "bullshit"

Thanks Ben I appreciate all your effort to help me but this is going to far
Regards Peter - QME Electronics

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: Arduino R3 Timing and first time programming confusion

Post by p.erasmus »

Hi Ben,

I ordered a genuine Arduino Uno R3 will see if that goes better :D
Regards Peter - QME Electronics

Post Reply