Need help with programming MightyHat

Started by loseymark, April 22, 2016, 09:42:56 AM

loseymark

Having trouble programming mighty hat.
Have a Mac and can't get FTDI drivers working.
Tried avrdude from my pi and get:
   avrdude-original: stk500_recv(): programmer is not responding
   avrdude-original: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00[/size]

Finally used arduino on raspberry pi and after finally getting the serial port available, I get the same  "programmer not responding" and "not in sync" errors

I need to know where I may be going wrong and how to determine if I have a problem with the board itself.

How can I troubleshoot this? I've done the google thing for several days now and I'm out of options.  :o

Step by step instructions would be nice with rpi 2 as my gateway pi where I run avrdude or rpi 3 desktop for running arduino 

OK, why is it that just after you get desparate and create a support topic you try one option you missed and it solves your problem.

When using avrdude I had to disable serial port use on the pi 2 with systemctl and boot with no serial console use and then avrdude worked.

Except now the problem is I can upload the mightyhat sketch without bootloader, but with the bootloader it fails to verify. From another post it may be that the bootloader is too big. Here's my next discovery project. But, I'm learning.

Felix

Did you see the MHat programming page?
Basically you just program it like any other Moteino, via the FTDI header.
Some cheap/fake adapter boards have issues and may produce the errors you are getting. You will need a compatible FTDIAdapter like the one offered in the LPL store.
You can program it via a modified avrdude variant directly from the Pi itself if it's mated with the Pi, also explained at the page above.
On the Pi3 the serial port has been disabled and is used by the bluetooth they added, so you first have to re-enable the GPIO (dev/ttyAMA0) serial port - I explained how to do that here.
All boards are tested for programming via FTDI as well as the GPIO and all other functions of the board to ensure it's not a faulty board.

loseymark

I've been going through all of that. My problem has been my MAC version OS X el capitan doesn't like the FTDI drivers.

I did get avrdude to work from the mated pi 2 after disabling all use of the serial port.

My remaining question there is a bootloader, which I don't find mentioned on the programming page. Do I need one? Arduino creates a hex file with_bootloader, but that file won't load with avrdude. Some posts I've read suggest the file is too big.


Felix

The atmega328p on the MHat is running DualOptiboot, same as all the Moteinos. You can treat the MHat as a Moteino, or you can load the core that includes Moteino,MoteinoMEGA,MightyHat. All of that is posted on the Moteino page.
You should generate a HEX that only contains your sketch code, not any bootloader.