Love UECIDE? Why not consider supporting the development?

User registrations are now disabled on this site.

We have a new forum system

>> Click here to try it out. <<

mcp2200 serial & upload

mcp2200 serial & upload

Postby deladriere » Sun Aug 23, 2015 6:52 pm

Hi Matt
I have developed some boards using the MCP2200 chip as serial interface.
Uploading code with UECIDE or Arduino works fine on the MAC
The serial port is recognized on both Windows and Mac and can be used to communicate

But there is another issue : I cannot upload code under Windows unless I play with the mode command in the command prompt to toggle the RTS line that is used to reset the ATmega328p. I have to manually do "mode comxx: rts=on" and "mode comxx: rts=off" to be able to upload code

My question is the following : could you be so kind to write a plugin where we can play/toggle the RTS line to have the ATmega328 resetting before uploading ?

Zillion thx
Using UECIDE on Mac OSX 10.10.1 with : Digispark - Colorduino - Leonardo - Uno - Yun - Mega - Pinguino OTG - Calunium - Launchpad -
deladriere
 
Posts: 189
Joined: Mon Mar 17, 2014 10:16 am
 

Re: mcp2200 serial & upload

Postby matt » Sun Aug 23, 2015 7:15 pm

It should be doing the RTS line automatically, as long as the upload command is set up right. You have to make sure that it has
Code: Select all
upload.<whatever>.using = serial
upload.<whatever>.rts = yes
upload.<whatever>.dtr = yes


The default avrdude uploader should have that set, but it looks like it may have got lost - I'll add it right now and upload a new package. For now edit the arduino's core.txt file and add:

Code: Select all
upload.arduino.rts = yes
upload.arduino.dtr = yes


And that should fix it.

As an aside, you can always write a script to do the uploading, as I have done for the Yun:

Code: Select all
upload.yunssh.name=Upload to remote Yun at ${ip}
upload.yunssh.quiet=-qq
upload.yunssh.using=script
upload.yunssh.script.0=__builtin_bullet::Uploading through the network to IP adress ${ip}
upload.yunssh.script.1=__builtin_scp::${build.path}/${filename}.hex::${board.user}@${ip}:/tmp/${filename}.hex
upload.yunssh.script.2=__builtin_bullet::Programming target
upload.yunssh.script.3=__builtin_ssh::${board.user}@${ip}::run-avrdude /tmp/${filename}.hex ${verbose}
upload.yunssh.script.4=__builtin_bullet::Upload complete

You can use any system command or other executable instead of __builtin_* commands, so you could do something like:
Code: Select all
upload.foo.script.0.windows=mode::${port}::rts=on
upload.foo.script.0=__builtin_echo::Uploading...
upload.foo.script.1.freebsd=${core.root}/tools/freebsd/avrdude::${if:${board.erase}=yes,,-D}::-V::-p${build.mcu}::-P${port}::-b${upload.speed}::-C${core.root}/tools/freebsd/avrdude.conf::-c${upload.protocol}::-Uflash:w:${build.path}/${filename}.hex:i::${verbose}
upload.foo.script.1.linux_arm=${core.root}/tools/linux_pi/avrdude::${if:${board.erase}=yes,,-D}::-V::-p${build.mcu}::-P${port}::-b${upload.speed}::-C${core.root}/tools/linux_pi/avrdude.conf::-c${upload.protocol}::-Uflash:w:${build.path}/${filename}.hex:i::${verbose}
upload.foo.script.1.linux_amd64=${core.root}/tools/linux64/avrdude::${if:${board.erase}=yes,,-D}::-V::-p${build.mcu}::-P${port}::-b${upload.speed}::-C${core.root}/tools/linux64/avrdude.conf::-c${upload.protocol}::-Uflash:w:${build.path}/${filename}.hex:i::${verbose}
upload.foo.script.1.linux_i386=${core.root}/tools/linux32/avrdude::${if:${board.erase}=yes,,-D}::-V::-p${build.mcu}::-P${port}::-b${upload.speed}::-C${core.root}/tools/linux32/avrdude.conf::-c${upload.protocol}::-Uflash:w:${build.path}/${filename}.hex:i::${verbose}
upload.foo.script.1.macosx=${core.root}/tools/macosx/avrdude::${if:${board.erase}=yes,,-D}::-V::-p${build.mcu}::-P${port}::-b${upload.speed}::-C${core.root}/tools/macosx/avrdude.conf::-c${upload.protocol}::-Uflash:w:${build.path}/${filename}.hex:i::${verbose}
upload.foo.script.1.windows=${core.root}/tools/windows/avrdude::${if:${board.erase}=yes,,-D}::-V::-p${build.mcu}::-P${port}::-b${upload.speed}::-C${core.root}/tools/windows/avrdude.conf::-c${upload.protocol}::-Uflash:w:${build.path}/${filename}.hex:i::${verbose}
upload.foo.script.2.windows=mode::${port}::rts=off
upload.foo.script.2=__builtin_echo::Done


The trick there is to note that a) the numbers are sequential, and b) a line with a suffix of an OS and optionally an architecture, that line is picked instead of the one without a suffix, when executed on that OS.

So on Windows it will run mode, then do the upload, then run mode again. On all the other OSes it will do an echo, do the upload, and do another echo. That way you keep the strict numbering sequence regardless of which OS it's on and what lines get chosen to execute.

In the pipeline as well I have the ability to run embedded Javascript functions, which opens up a huge number of other options of what to do.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".
matt
Site Admin
 
Posts: 1318
Joined: Sun Jul 07, 2013 11:37 am
I use UECIDE on: Linux
 

Re: mcp2200 serial & upload

Postby deladriere » Sun Aug 23, 2015 9:10 pm

thx a lot
I will try tomorrow
Using UECIDE on Mac OSX 10.10.1 with : Digispark - Colorduino - Leonardo - Uno - Yun - Mega - Pinguino OTG - Calunium - Launchpad -
deladriere
 
Posts: 189
Joined: Mon Mar 17, 2014 10:16 am
 

Re: mcp2200 serial & upload

Postby deladriere » Mon Aug 24, 2015 7:44 pm

Still not luck : I have updated all plugins and I can see the board resetting when I press program (my board has a led on digital 13 so I see the Optiboot flashing 3 times) but still have this error :

(Using the same version of Uecide and the same code on both Mac & PC (Parallels Desktop on the same machine)
On windows 10 preview :
Code: Select all
avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Users\jldeladriere\AppData\Local\UECIDE\cores\arduino-16x/tools/windows/avrdude.conf"

         Using Port                    : \\.\COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done.  Thank you.

• Resetting board...
Upload Failed


Same code same on Mac OSX 10.0.5

Code: Select all
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: reading input file "/var/folders/v5/zmn08th96gz7w0g4sb04v4wc0000gn/T/build-8e7b059b-fc23-4aa3-a703-2a922f447487/Talko_1.hex"
avrdude: writing flash (28824 bytes):

Writing | ################################################## | 100% 3.85s

avrdude: 28824 bytes of flash written

avrdude done.  Thank you.
• Resetting board...
• Upload Complete


I just made 2 videos :
On the MAC we can see the 3 flashes just after pressing upload AND when the Avrdude comes to play AND at the end of the upload
https://instagram.com/p/6xqN-9uDdR/
On Windows I see only 3 flashes just after pressing upload and NOT when Avrdude comes to play
https://instagram.com/p/6xq8q3uDek/
Could it be the reason ?
Using UECIDE on Mac OSX 10.10.1 with : Digispark - Colorduino - Leonardo - Uno - Yun - Mega - Pinguino OTG - Calunium - Launchpad -
deladriere
 
Posts: 189
Joined: Mon Mar 17, 2014 10:16 am
 

Re: mcp2200 serial & upload

Postby matt » Mon Aug 24, 2015 7:55 pm

Are you on the release or the beta?
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".
matt
Site Admin
 
Posts: 1318
Joined: Sun Jul 07, 2013 11:37 am
I use UECIDE on: Linux
 

Re: mcp2200 serial & upload

Postby deladriere » Mon Aug 24, 2015 8:32 pm

beta
Using UECIDE on Mac OSX 10.10.1 with : Digispark - Colorduino - Leonardo - Uno - Yun - Mega - Pinguino OTG - Calunium - Launchpad -
deladriere
 
Posts: 189
Joined: Mon Mar 17, 2014 10:16 am
 

Re: mcp2200 serial & upload

Postby deladriere » Mon Aug 24, 2015 8:32 pm

I mean : Version 0.8.8alpha18
Using UECIDE on Mac OSX 10.10.1 with : Digispark - Colorduino - Leonardo - Uno - Yun - Mega - Pinguino OTG - Calunium - Launchpad -
deladriere
 
Posts: 189
Joined: Mon Mar 17, 2014 10:16 am
 

Re: mcp2200 serial & upload

Postby matt » Mon Aug 24, 2015 8:35 pm

That should be fine then. You should have received the right version of the core.txt file for Arduino. Just check that it has the rts=yes and dtr=yes lines in there for the arduino upload.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".
matt
Site Admin
 
Posts: 1318
Joined: Sun Jul 07, 2013 11:37 am
I use UECIDE on: Linux
 

Re: mcp2200 serial & upload

Postby deladriere » Mon Aug 24, 2015 9:04 pm

As said on my post from 7:44 pm : I have updated the plugin and the yes core has upload.arduino.rts=yes
upload.arduino.dtr=yes
both in Mac and Windows
Using UECIDE on Mac OSX 10.10.1 with : Digispark - Colorduino - Leonardo - Uno - Yun - Mega - Pinguino OTG - Calunium - Launchpad -
deladriere
 
Posts: 189
Joined: Mon Mar 17, 2014 10:16 am
 

Re: mcp2200 serial & upload

Postby deladriere » Tue Aug 25, 2015 6:02 am

It seems that avrdude on Windows is not toggling the rts line
Could UECIDE do it just before sending to avrdude command to overcome this issue ?
Using UECIDE on Mac OSX 10.10.1 with : Digispark - Colorduino - Leonardo - Uno - Yun - Mega - Pinguino OTG - Calunium - Launchpad -
deladriere
 
Posts: 189
Joined: Mon Mar 17, 2014 10:16 am
 
 
Next

Return to Arduino / AVR

Who is online

Users browsing this forum: No registered users and 1 guest

cron