Application starting and butterfly

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi. Is there a simple way to get the application software started without touching the joystick?

Maybe someone has a known-to-work bootloader that starts the application unless something special condition is applied during the power-on. The idea is to keep the programmability for further development, but in actual use it would be directly unreachable ane hidden in a car.

I don't have any special programmers, but I guess that the boot loader can be programmed via a serial cable?

I'm using WinAVR (GCC) / AVR Studio 4.

Debugging is for sissies and delivery for surgeons. Real men do demonstration.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I don't have any special programmers, but I guess that the boot loader can be programmed via a serial cable?

Not exactly, you can program your application via a serial cable using the boot loader that comes with the Butterfly. To program the boot loader itself you need to program with the ISP or JTAG.

Quote:
Maybe someone has a known-to-work bootloader that starts the application unless something special condition is applied during the power-on.

The standard boot loader may already behave this way. I believe the joystick starting of the application may be a function of the application itself, not the boot loader. But Dean (abcminiuser) would know more about this.

Regards,
Steve A.

The Board helps those that help themselves.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No, the joystick up requirement is part of the Butterfly's bootloader. Here's the logic:

main command sequence:
  set up everything
  joystick up?
    yes - reset vectors to flash
      turn off interrupts
      jump to 0
    no - joystick center?
      yes - get char from USART
        ESC?
        yes - turn off interrupts
          loop in command processor (below)
        no - send '?'
        loop
      no - sleep
  loop

If you want some other behavior, you need to kill off the native bootloader by programming the Butterfly using something other than the serial bootloader.

At least this is how it worked one release back. I haven't checked the current release (a few months old now).

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This means: fergetit for now, eh?
Thanks (sob) guys.

Debugging is for sissies and delivery for surgeons. Real men do demonstration.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Or buy/build a programmer. I think the $50 Digikey Dragon/STK500 combo is still on (but I could be wrong) - a great investment in your AVR future. With that capability, you could even tweak the bootloader code to your liking and revert back to the serial programming if you wished.

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you're in the US I'd be willing to modify your bootloader to look for a few signature bytes at a certain location in flash and bypass the joystick check after a few failures if it finds them. That way you can still get to the bootloader via the joystick if you need to, but if you do nothing, and your app has the right signature, it will go ahead and jump to it.

Getting WinAVR to put the signature bytes in the correct place is left as an exercise for the student. Or I suppose I could scan all of flash for a little longer signature string.

I say US only because it makes my returning your Butterfly cheaper and easier (no customs declarations). Of course you'd be without your Butterfly for the time it takes to get here and back.

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Since your application is not using the joystick you can just ground PB6 (which is joystick "up" I belive).
/Lars

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Since your application is not using the joystick you can just ground PB6 (which is joystick "up" I belive).

Just tried it on a fresh-from-the-box Butterfly and it works great. Very nice.

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The pin grounding option sounds good. Is there a need for using a smallish resistor?

Debugging is for sissies and delivery for surgeons. Real men do demonstration.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No, there is no real need for a resistor in this case.
/Lars

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK. Thanks guys.

Debugging is for sissies and delivery for surgeons. Real men do demonstration.