Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Arduino MICRO

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

Bascom Member



Joined: 02 Jan 2017
Posts: 81

poland.gif
PostPosted: Fri Jun 25, 2021 11:35 am    Post subject: Arduino MICRO Reply with quote

Hi,

It touches barely to Bascom (exept that hex filke is done there) but need to port my project from Uno to Micro. As I've already found out from 'internet' that to upload hex file is to use avrdude. Micro is connected to windows 7 with usb cable, com port is 47 and in my directory where hex file is I put avrdude.exe as well. Then written:
Code:
C:\kody\Bascom\Arduino\ARDUINO MICRO\test1>avrdude.exe  -p atmega32u4 -c avrispmkII -P COM47 -b 115200 -V -D -U flash:w:"test1.hex":i

I tried to use programator avrispmkII because I noticed that in Arduino IDE is that checked. But then I got "avrdude.exe: stk500v2_receivemessage(): timeout". So tried to use avr109 as -c parameter. Then I see "connecting to programmer:." and then
"Connecting to programmer: .avrdude.exe: butterfly_recv(): programmer is not responding

avrdude.exe: butterfly_recv(): programmer is not responding".

Hmm, some hints?

Regards,
Back to top
View user's profile
krolikbest

Bascom Member



Joined: 02 Jan 2017
Posts: 81

poland.gif
PostPosted: Fri Jun 25, 2021 12:11 pm    Post subject: Reply with quote

A little progres, (this link: https://forum.arduino.cc/t/avrdude-cant-find-com/626194/3) :
Quote:
The Arduino IDE does a special process when uploading to the Leonardo that doesn't happen when you are uploading using avrdude directly.

The bootloader on the ATmega32U4 runs for several seconds after the microcontroller is reset. The bootloader must be running for avrdude to to the upload. In order to make uploading easy, the Arduino IDE automates this reset process. That is done by opening a serial connection to the COM port of the board at 1200 baud. The Leonardo has code that runs in the background of your sketch and sees that 1200 baud connection as a signal to reset the microcontroller. The Arduino IDE then watches for the first COM port to be enumerated on the system, then runs the avrdude command to upload to that port.

So in order to upload using avrdude directly, you need to manually reset the Leonardo by pressing the reset button before running the avrdude command. But you also need to figure out what the correct COM port is to use in your avrdude command. The Leonardo will likely have a different COM port number when the bootloader is running than when the bootloader is running. So do a reset and then quickly check the com port before the bootloader times out and exits to the sketch.


the bas file looks like"
Code:
'******** MICRO
$regfile = "m32u4def.dat"
$crystal = 8000000
$hwstack=40
$swstack=16
$framesize = 32
$baud = 9600


Do
 Wait 1
 print "ala ma kota"
Loop
End


but now I don't see a com port (47 nor 44). This is weird Micro..
Back to top
View user's profile
krolikbest

Bascom Member



Joined: 02 Jan 2017
Posts: 81

poland.gif
PostPosted: Fri Jun 25, 2021 6:32 pm    Post subject: Reply with quote

Oh, I simply mixed coms up. My expectation was that after uploading I'd see in terminal emulator incomig data via Micro usb data. wrong way. I had simply to connect to RX/TX pins of Micro to usb converter and that did the trick.

Regards,
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