Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Bootloader in bascom for Arduino UNO R3

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-ARDUINO
View previous topic :: View next topic  
Author Message
autoguider

Bascom Member



Joined: 24 Sep 2007
Posts: 62
Location: Aachen

germany.gif
PostPosted: Mon Aug 26, 2019 10:44 pm    Post subject: Bootloader in bascom for Arduino UNO R3 Reply with quote

Dear all.
I made my first experience with Arduino and Bascom.
Uploading of the program went well for 6 times. There was an alert message that the loader could not write the fuses. To my opinion this is o.k.
Now, for some reason, the uploading process stucks and I have to shut down Bascom.

I am using a short USB cable for conneting to the notebook. Power supply is the USB port.
It should be enough as I have no further hardware connected to the Arduino.

Speed setting in the programmers ws 115200.
The communication with from the Arduino to the notebook runs at 19200.
From the communication traffic I have the feeling that the Arduino is rebooting again and again until it reaches the main loop.
Are the speed settings o.k. ?
With the Bascom bootloader I made the expereince that the bootloader has to be compiled with the speed for later operation in the main program.
Are the bootloader for the Arduino provided with bascom different ?

I consider to install the MCS Bootloader on the Arduino Hardware.
Will this work or are there some restrictions ?
My Bascom version is 2.0.8.1

BR
Christian.
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 692

poland.gif
PostPosted: Tue Aug 27, 2019 12:11 am    Post subject: Reply with quote

I`m using Arduino hardware for some time now with Bascom ofcourse and have some tips for you.

Baudrate in the main application dont need to be same as baud of the bootloader but there is a first catch.
There is one bit in the USART register that double the speed. Depending on the chosen baudrate this bit is set or not.
After reset uC have this bit cleared but bootloader set it for 115200 so even after jump to the application code Bascom not alter U2X if not needed for your application baudrate.
Look at this short topic https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13681
But this will not be the case here I think.

Second tip is about those short blue USB cables - they are junk Very Happy
My Arduino Mega never wants to program correctly from this cables where "proper" cable from my printer, even 1,8m, never disappoint me.

Third tip Razz
If you start STK500v2 Arduino programmer from Bascom and something hang, because you dont close terminal window for example or plug USB into another port so this that was set in config dont match - dont try to close programmer window. Stay calm and after good minute program will start responding again Very Happy
If you touch X -close button then you know what happen - Bascom will must be restarted Very Happy

I advice you to run Arduino IDE, connect some ISP programmer (USBasp, AVR ISP mkII) and use option "Burn Bootloader". This will also set fuses.
In some cases, after burn bootloader you have also "Blink" application so yelow LED will flash.

Then next step will be write your own blink code in Bascom and upload it into device Wink

I also often use MCS Bootloader on this Arduino boards and works great, but in your case you should be sure first that your hardware/cables work.
Back to top
View user's profile Visit poster's website
autoguider

Bascom Member



Joined: 24 Sep 2007
Posts: 62
Location: Aachen

germany.gif
PostPosted: Mon Sep 02, 2019 10:56 pm    Post subject: Reply with quote

I decided to install the MCS bootloader on a 328p on my programming board and then put this 328p on the Arduino board.
Bootloader did not run.

I programmed it with a 16 MHz crystal.
For the MCS bootloader I set the fuses to following values:
&HFF,
&HC7, Clock divide by 8 disabled, clock output disabled, Ext. Full swing crystal
&HDA, PinC6 is reset, debugWire disabled, SPI enabled, WDT enabled, erase eeprom enabled,bootsize 1024 words, select boot vector
&HFF Brown out disabled.
Do this values fit to the Arduino Hardware ?

In the program code I set $ crystal to 16000000 and $baud = 19200

On the Arduino board I can see that the PC is sending to the Arduino.
No response from the Arduino to the PC even after pressing the reset button.

What settings did you use ?
Have the baud setting on compiling have to match those of the UART ?

What are the fuse setting for programs to upload to the MCU ?

please be so kind to let me know.

BR
Christian
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-ARDUINO All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum