Self Bootloading Mod-Chip

I’ll put the chip on there with the purpose of flashing the bootloader, and of course the user is welcome to change the operation of the attiny after to be a sound co-processor.

Even doing this is gonna be a challange for space constraints within the back case, I think it is possible.

Let me have a think and try to make sure that the attiny can also be re-programmed by the Arduboy without an external programmer. ( I think I just have to tie the reset pin of the attiny to an “open” gpio, of which I think there is only 2 choices now)

Maybe need to upgrade the attiny85 to attiny84 (or any atmega) with more GPIO pins then.

Finally back on this a bit, looking at datasheets.

I’m looking at the attiny 84 in the qfn package to carry the bootloader flashing instructions.

So now the next step is to order one up, and write the code to flash the bootloader.

@Mr.Blinky it has been some time do you want to join forces on this?

This will be like a dev kit 2.0 I guess?

1 Like

Was wondering when you’d ask :smiley:

lately i’ve been looking at AVR-AY and wondered if that could be built into the mod chip as well :slight_smile:

I guess for the reason that It has more GPIO pins then the 85. Did you choose it for a specific other reason? There’s also the 1634 which comes in the same/similar package and looks to be cheaper and has a bit more flash (more flash means more possibilities)

Send me one now! :stuck_out_tongue:

2 Likes

Well, actually, origonally yes, but I just realized the QFN package of the 85 is the same size.

But now I just found this:

http://www.technoblogy.com/show?2OCH

Those all could be options.

AND they are cheaper! Looking at the ATtiny816 now!

https://www.microchip.com/wwwproducts/en/ATTINY816

…if cost is the deciding factor, then get one of these ($0.20 - $0.40 USD each, and it would be like having a dual-core Arduboy):

Haha that would be funny.

I don’t see a QFN package though, which is necessary for the thickness. :frowning:

Now I just gotta figure out the schematic on how everything can talk to each other on the SPI bus.

New generation of attinies and comes in tiny 3x3mm. for the 4cents extra I’d go for the 1616. so theres 8K extra for possible ‘info sketch’

Too bad they don’t come in smaller packages

This is what I had sofar:

MODCHIP      ARDUBOY
GPIO*  <->    ATMEGA32U4_RESET
SCK    <->    SCK  (PROGRAMMING CLOCK INPUT)
MISO   <->    MISO (PROGRAMMING DATA OUTPUT)
MOSI   <->    MOSI (PROGRAMING DATA INPUT)
GPIO   <P     RX/FLASH_CS (INTERNAL PULLUP RESISTOR)
RESET  <-     TX (for ISP MOD CHIP UPDATE)
* GPIO supporting pin change interrupt

But the newer attinies use the new UPDI programming interface that uses a single pin for programming. so it would probably be something more like:

MODCHIP      ARDUBOY
GPIO*      <->    ATMEGA32U4_RESET
SCK        <->    SCK  (PROGRAMMING CLOCK INPUT)
MISO       <--    MISO (PROGRAMMING DATA OUTPUT)
MOSI       -->    MOSI (PROGRAMING DATA INPUT)
GPIO       <P     RX/FLASH_CS (INTERNAL PULLUP RESISTOR)
UPDI/RESET <-     TX (for ISP MOD CHIP UPDATE)
* GPIO supporting pin change interrupt

The idea here is that the GPIO pin will wake up the mod chip from sleep when arduboy reset is pressed then measure the duration of reset being pressed if it’s longer then the threshold it will do it’s ISP thing and otherwise goes back to sleep.

Tx pin of Arduboy is connected to UPDI to be able to update the mod chip. The Arduino IDE doesn’t configure the Tx pin normally so it should be fine.

Oh snap, might it be better to stick with the attiny84/5 to keep the SPI programming?

Well there are some UPDI projects out there for reference so that shouldn’t be an issue. but when sticking with SPI the programmer code could both be used for the mod chip as for arduboy (Arduboy updating the MOD chip).

I looked a bit more into the new attinies. the idea of adding AVR-AY wont work as they do not seem to have the same PWM capabilities as atmega. so that idea goes down the drain.

I think the price should decide to keep the flexboard low.

Digikey lists atmega85 at 71cents and attiny45 @ 55 cents

Attiny45 it is!

Here’s your wiring help then :slight_smile:

And I’ve got a challenge to write the flasher in 1K :grin:


Hows that look?

(I’m using the wrong part number for the flash chip, but it’s the same package and pinout)

And I don’t know if I need that series resistor for the reset line I realized?

Tomorrow I will buy some parts from china and buit / test it. I can give a help (at least) testing it.

@Mr.Blinky Curious, with this configuration how do you plan on triggering the bootloader code?

Will the Attiny be looking for a certain condition when it boots up?

And then the 32u4 will reset the attiny and? I guess wait for a certain string on the spi bus? I see we havent actually set a chip select for the attiny itself but i guess we can set it to be opposite whatever the signal is for the flash chip?

Here is what I’m thinking for the shape of the flex board (extremely rough draft)

image

It’s designed so you can just place it down on top of the battery and speaker and sorta “stretch” it to fit a little bit if you have to.

The flash chip will sit right above where the USB connector is and the attiny will be over to the right.

The hope is you can place it right on top of the speaker wires and everything will still fit.

The dimensions will take some fine tuning to get quite right.

I also think we probably have to switch to SCL and SDA so that it’s easier to reach without having to move the battery.

Thoughts?

2 Likes

When Power is switched on or the reset button is pressed. The attiny will measure how long Arduboy reset is active. When it is active longer then the threshold value (2 seconds) it will start the bootloader update mode.

When reset is not active long enough the attiny will go into sleep mode. The attiny will be able to wakeup from sleep using pin change interrupt on the gpio pin that monitors the arduboy reset pin.

there is no need for chip select pins. Arduboy reset, sck,miso,mosi are used for ISP programming Arduboy. Tx,sck,miso,mosi are used for ISP programming the attiny. (makes it possible to ship the flexboard with blank chips)

I recommend to use round corners on the flexboard so the risk of tearing is reduced. the attiny part is sitting right at the edge of battery area you might wont to lower that part a bit more.

Don’t know if it’s possible but if you rotate the flash 90 degrees you could maybe put the attiny next to it in which case you have less tracks running to the pads. Also recommend to make the tracks as wide as possible and make them narrow where they have to be

Shouldn’t be a problem as long as you pick SDA for flash chipselect

1 Like

I’m with @Keyboard_Camper. Why not just respin the Arduboy board with the footprints for the flash chip and bootloader/co-processor chip instead of trying the “bandaid” approach with the flex pcb? You’re in the business of selling Ardubboys, not DIY mod chips to things you have source files too.

1 Like

Doesn’t need to be mutually exclusive though… If there was KS to purchase the flex foil mods AND an Arduboy FX - I’d pickup both! :slight_smile:
I hate the idea of shelving the OG Arduboys I have (esp. from an environmental perspective)… plus I enjoy soldering. I’d also grab a new snazzy unit in a heartbeat if it had snazzy colours.

From a business perspective it’s important to analyse the market reception.
Is there any open space for a new arduboy spin?
The investment of a flexcable will be much lower of a new spin, does it justify to make the full investment on a new version?

Personally, I would prefer to see a new arduboy version, with better specs, but its important to be aware of the sales perspectives.

I still have more than a thousand Arduboys in stock, and people already have Arduboys that could be easily upgraded for a few dollars instead of buying new ones. The plan is to sell both the upgrade mod chip and pre-modded versions. The pre-modded versions will get laser engraved with “Arduboy FX” and a unique serial number.

I’d much rather just spin up new production like you suggest but can’t really do that without moving through the rest of the current inventory.

So your suggestion is that if you hold the reset button for 2 seconds it will automatically flash the bootloader?

I was planning on having the chips already programmed and including the bootloader.

Actually the method I was thinking for activating the bootloader, was that you would upload a “special” sketch to the Arduboy that would send some kind of “secret” signal to the attiny which would then start the bootloader. I figure you could do this by configuring the attiny to be “selected” opposite of whatever the flash is. (I can’t actually remember if active is low or high) but if the flash is active and lets say that is set to high that whenever that chip select line is brought low actually the attiny becomes active on the bus.

Then you could just issue an SPI command to begin the bootloading.

Maybe we could implement both options.

I’m not super keen on requiring people to use the reset button for 2 reasons, 1 is that I’d really need to include a sim-eject tool or similar with the package. 2 is that it’s also quite fragile and people break it somewhat often, I don’t want to tell everyone to do it on purpose.

1 Like