Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

USB programming won't work after using ICSP. Arduino Mega 2

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

Bascom Member



Joined: 14 Oct 2006
Posts: 69

usa.gif
PostPosted: Thu Feb 26, 2015 1:49 am    Post subject: USB programming won't work after using ICSP. Arduino Mega 2 Reply with quote

I programmed my Arduino Mega 2560 a few times using the USB connection and BASCOM. For programmer, I selected STK500V2. Worked fine but I noticed I can't program fuse bits using USB connection.

Then I programmed the same with ICSP using USB-ISP that I have used for years on ATMEGA chips on boards I build. Worked fine on Arduino.

Then I tried to program again using USB connection and STK500V2. No good. Still works as serial port, but not for programming.

I assume that I have inadvertently set one of the fuses when programming with the ICSP which is now preventing the USB programming to work.

Any suggestions?
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5920
Location: Holland

blank.gif
PostPosted: Thu Feb 26, 2015 9:48 am    Post subject: Reply with quote

you need to understand that arduino uses a bootloader. this is a piece of code running in the bootloader section (top of the flash) memory.
when you use ISP programming, you are erasing flash, including the bootloader. so now there is no bootloader.
it is simple however : get the arduino bootloader code used in your chip and program the chip with that code.

_________________
Mark
Back to top
View user's profile Visit poster's website
teccs

Bascom Member



Joined: 14 Oct 2006
Posts: 69

usa.gif
PostPosted: Thu Feb 26, 2015 10:46 am    Post subject: Bootloader code Reply with quote

Hi Mark,

Thank you for the reply.

Where do I get the bootloader code? How do I put my code with the bootloader code in the programming of the ATMEGA 2560 in BASCOM?
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5920
Location: Holland

blank.gif
PostPosted: Thu Feb 26, 2015 1:16 pm    Post subject: Reply with quote

you can best check the arduino forum. they can inform you how to put the boot loader back into the chip. and where to find the code. there are many different versions.
_________________
Mark
Back to top
View user's profile Visit poster's website
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sun Mar 01, 2015 8:57 pm    Post subject: Burning bootloader Reply with quote

Today I burned a new bootloader in an Arduino Uno. In Arduino-IDE there is an option to burn a bootloader. Select the right chip. Have used the AVRISP MKII and it worked right away. You can select the right programmer in the IDE.

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1161
Location: France

france.gif
PostPosted: Tue Mar 03, 2015 10:52 am    Post subject: Reply with quote

hello,
once you've solved your problem, and the bootloader is one of the most recurring problems, can you explain, step by step, your approach?

many thanks
JP Wink
Back to top
View user's profile Visit poster's website
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