Flowcode with AtMEGA 2560

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Flowcode with AtMEGA 2560

Post by billduck »

I am trying to program an Arduino MEGA 2560 R3 with Flowcode 6.

I have a very simple program, attached, which is just supposed to be toggling one I/O pin on and off. When I do this with pin D0 of an Arduino UNO, it works as expected. When I try this with the Arduino MEGA 2560, the pin remains tri-stated.

I'm guessing that the data direction register isn't getting configured. Is this a known problem on the MEGA? Is there something else I need to do?
Attachments
Hello World_Mega_No work.fcfx
(10.7 KiB) Downloaded 228 times

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Flowcode with AtMEGA 2560

Post by jgu1 »

Hi Billuck!

I have removed your unused component from the dashboard, the display and a potentiometer. After this I am able to compile to hex. :D

I think you are able to program the Mega now.

Best regard

Jorgen
Attachments
Hello World_Mega_ work_NOW.fcfx
(8.35 KiB) Downloaded 227 times

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: Flowcode with AtMEGA 2560

Post by billduck »

I know it is something simple. I tried it on a new MEGA r3. no success.
I tried your corrected? code, even deleted the subroutine and POT. no success
Hooked up a LED. Blinks as commanded on an UNO. No success on a MEGA.
Checked the orientation of the AVRISP programmer on the header.
I tried the 6 variants for Mega 2530.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Flowcode with AtMEGA 2560

Post by jgu1 »

Ok, I Will try to program a Mega with your program later today and see what happen. Maybe it is something with your driver.

Have you tryed to program with Xloader?

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: Flowcode with AtMEGA 2560

Post by billduck »

You have brought up a very good point. It was a setting within the downloader. Thanks for swatting my brain.

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: Flowcode with AtMEGA 2560

Post by billduck »

BTW, can FC compile and transfer to chip, as indicated by one of the buttons?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Flowcode with AtMEGA 2560

Post by Benj »

Hello,

Yes Flowcode can program an Arduino via it's USB connection as long as the bootloader is present on the Arduino. The only Arduino we cannot program correctly is the Mega2560 without the R3 marking, for this we recommend the Xloader tool.

Flowcode can also program the AVR devices using a number of programmers. The default is the AVRISP mkII but we also support the TinyISP and a number of other programming tools supported by the AVRdude programming software.

The programming is done using batchfiles which all reside in this folder "Flowcode 6\compilers\avr\batchfiles".

avrc_*** are the programming batch files.

The batch file being called is fixed for Arduino but can be edited for other AVR targets by clicking Build -> Compiler Options -> Programmer Tab.

billduck
Posts: 159
Joined: Thu Jul 01, 2010 1:57 am
Has thanked: 23 times
Been thanked: 16 times
Contact:

Re: Flowcode with AtMEGA 2560

Post by billduck »

When using the AVRISP mk2, I have been erasing the device. I assume that this includes the boot loader. Can I reinstall the boot loader? If so, where can i get it?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Flowcode with AtMEGA 2560

Post by Benj »

Hello,

Yes if you've programmed using the AVRISP then the bootloader will have been overwritten. Bootloaders and instructions to reflash can be found on the Arduino website.

Post Reply