Author Topic: new design proposition  (Read 10291 times)

Jhereg228

  • Newbie
  • *
  • Posts: 1
new design proposition
« on: July 17, 2013, 02:47:54 pm »
Any chance we could get a digispark with an 8 pin header instead of a surface mount attiny85?  This would make a nice, inexpensive programmer with only a slightly larger board on the digispark.

germ

  • Jr. Member
  • **
  • Posts: 53
Re: new design proposition
« Reply #1 on: July 17, 2013, 02:58:32 pm »
Or why not a programming shield, kind of like the one dmcinnes built with a proto board: http://digistump.com/board/index.php?topic=160.0
That would work too right? That shouldn't be expensive.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: new design proposition
« Reply #2 on: July 17, 2013, 06:27:08 pm »
You'd still need to load the bootloader on to the tiny85 somehow.. why is this useful? You still need a programmer to initialise all your chips. :S

germ

  • Jr. Member
  • **
  • Posts: 53
Re: new design proposition
« Reply #3 on: July 18, 2013, 08:21:35 am »
So... you can't program anything with the digispark unless you have a programmer? =/ (or was that just a reply to the first suggestion?)

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: new design proposition
« Reply #4 on: July 18, 2013, 08:47:00 am »
As far, as I understand Jhereg228, his idea was, to have instead the smd-version of the attiny85 an 8-pin socket on the pcb.  His further idea (which i read between the lines) is, that he can plugin PDIP-8 versions of the  attiny and use the pcb as a programmer.
However that is a chicken-egg problem: Before the dumb attiny can be used via USB, it needs to get an boot-loader stored. For that you need an programmer.

The factory stored boot-loader is one of the key-features of the digisparc, which allows to program this device without additional hardware. 



germ

  • Jr. Member
  • **
  • Posts: 53
Re: new design proposition
« Reply #5 on: July 25, 2013, 03:28:25 pm »
But as such, couldn't digistump just make a programming shield, and then sell pre-loaded Attiny85 DIP8 on the page?
Maybe that wouldn't be of much profit, or maybe it would be hard to offer them much cheaper than the digispark itself.
But wouldn't that be the other option?


gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: new design proposition
« Reply #6 on: July 26, 2013, 01:36:34 am »
All possible:
Just read this article: http://digistump.com/board/index.php/topic,160.0.html

In short words: 
  • Use the micronucleus-binary to upload the littlewire hex-file as an application to your digispark
  • If you are under 32-bit Windows, install the littlewire-usb-driver
  • In case you are under Windows x64, install instead the most current driver from http://sourceforge.net/apps/trac/libusb-win32/wiki. The enclosed INF-wizard will do all whats needed to do.
After that:  connect the attiny85 dip to the digispark, load your sketch in the the arduino-IDe and choose as programmer  "USBtinyISP"
you are done.

If you now decide, to install an digispark-bootloader, it will work over this was as well! However:  After that, Pin5 is used as IN/OUT and not longer as RESET and therefore you can't program this chip any longer via ISP.
You can now connect the chip similar to the digispark-layout to an USB port and choose the digispark-programmer. Or you need an HV-programmer or at least an fuse-resetter (both working with different signaling and 12V on pin5)


germ

  • Jr. Member
  • **
  • Posts: 53
Re: new design proposition
« Reply #7 on: July 26, 2013, 11:11:08 am »
Thanks gogol. Sorry that I'm a bit thick, but does this mean that I could just program a clean attiny85 with nothing but my digispark and a computer?
Does it mean that I can use all 6 I/Os if I do not install the bootloader?
Do I even need the bootloader unless I want to make a new "digispark"? (and why would I if I could just program it with my current one)
And lastly, what other attinys would this work on?

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: new design proposition
« Reply #8 on: July 26, 2013, 07:29:49 pm »
Yes, you can program 8-bit avr's with the digispark via the littlewire firmware.


No, you can't use the reset pin as IO if you're programming via an ISP programmer like the littlewire. For this, you need a bootloader or a HVSP device which costs about $50.


You don't need a bootloader, it is just one of several ways to gain access to the reset pin for IO. You could also use a serial bootloader instead and install the littlewire cdc232 firmware for similar effect, or use a usb-ttl serial adapter. Doing it this way would be more like an arduino, in that you could open the attiny in the serial monitor and talk to it over serial when not programming, however if you disable the reset pin you still need to reset the AVR to accept a new program somehow, like unplugging it and plugging it back in. If you leave the reset function in tact you can connect it to a specific pin on usb serial ttl adaptors which automatically resets it.


You can use an ISP programmer for nearly any attiny or atmega chip. There are a few extremely simple attiny devices which are not compatible - they have their own special even simpler protocol, and many of them do not have memory and cannot run C programs - only assembler. The digispark software only knows how to compile programs for ATTiny85 chips, but you can download and install extra attiny support files for arduino, which enable it to compile for many other chips like the bizarrely popular attiny13.


You can also use a littlewire/digispark isp to program atmega chips like the one on the arduino - these chips tend to cost about $5 and have many more pins, and do not require extra libraries to be installed - arduino software of course already knows how to program chips like atmega328 that they use on the official arduino boards.

germ

  • Jr. Member
  • **
  • Posts: 53
Re: new design proposition
« Reply #9 on: July 27, 2013, 01:21:22 am »
Thanks Bluebie for the clarification.
I always feel like I get mixed messages on how exactly it would work programming with a digispark.
Still:
Quote
If you now decide, to install an digispark-bootloader, it will work over this was as well! However:  After that, Pin5 is used as IN/OUT and not longer as RESET and therefore you can't program this chip any longer via ISP.
vs
Quote
No, you can't use the reset pin as IO if you're programming via an ISP programmer like the littlewire. For this, you need a bootloader or a HVSP device which costs about $50.

That's confusing to me. So if I want to use all 6 I/Os... I need to install a bootloader (which can still be done via digispark?) And then I can still program it via the digispark with 6I/Os?

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: new design proposition
« Reply #10 on: July 27, 2013, 06:25:54 pm »
ISP protocol is built in to the AVR chips as a way to upload programs. HVSP is another protocol built in to the chips. With ISP protocol, the reset pin is used to put the chip in to the ISP mode where the other pins (d0, d1, d2 iirc) are then used as an SPI connection to upload the program. LittleWire is an ISP programmer. AVR chips come by default configured with the reset pin as entering ISP mode.


HVSP mode works similarly, but the programmer needs to apply 12v to the reset pin. This means the reset pin can be used as IO after changing the settings in the chip to disable the reset pin functionality via any kind of programmer (even ISP). HVSP programmers are unpopular and cannot be made using a digispark alone because of that 12v requirement - you need some sort of 12v power supply and something to switch it - a transistor or mosfet or something like that. With a HVSP programmer you can upload programs regardless of the chip settings, or you can use it to enable the reset pin functionality again so you can then use an ISP programmer on it (this is what tiny fuse resetter circuits do)


A bootloader is a piece of software you can install on the chip which runs before any uploaded programs, which accepts program uploads in one way or another and uses the flash self programming features of the avr chip to install the program in to a different part of memory. Because a bootloader is software on the chip, it takes up some flash memory. USB is a fairly complex protocol so micronucleus (the usb bootloader) takes up about 2kb. You can get other bootloaders which accept uploads using different protocols, like serial or spi or even special single wire versions of serial. There are bootloaders for atmega which accept program uploads via light sensors from a computer screen (like a webpage or animated gif!) and others which accept upload via sound, by plugging it in to an audio jack on a computer or phone, so you can save the program as a wav and email it to someone you made a device for! Many of these other bootloaders are more compact than 2kb because their protocols can be made simpler than USB.


With a bootloader installed, you can disable the reset pin functionality if you feel okay about removing ISP programmer capability and just using the bootloader. This is how digispark works and how the chip is configured using the Burn Bootloader function. Notably the digispark burn bootloader function actually does not upload the bootloader, but a bootloader installer, which installs the bootloader when the chip runs after upload - this is because it can also be used to replace the bootloader on a chip using the already installed bootloader, but a bootloader cannot write over itself without breaking itself, so it happens in two steps. When making the installer program I have installed it on chips with ISP enabled and downloaded the resulting firmwares and verified by hand that the 'upgrade' installer does in fact install the bootloader to be exactly the same as if uploaded directly.


This installer is neat because it lets me make other bootloaders like the button bootloader where you connect reset to ground while plugging in the digispark and that makes it enter bootloader, but after that it can be used as IO by the program with no problems. Without the 'upgrade' installer people wouldn't be able to change the bootloader on their digispark without a HVSP/ISP as the reset pin is disabled so it can be used as a general IO pin and analog input.


I believe an attiny85 can be used to make a simple attiny fuse resetter, so if you have a few extra components like transistor, resistor, 12v power source like a 12v camera battery, you can use a digispark in theory to reset an avr or even another digispark so it can be programmed with an ISP. You can use an ISP to disable the ISP function and regain the pin's use as IO, as it does not take effect until the chip restarts after programming is finished.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: new design proposition
« Reply #11 on: July 27, 2013, 06:30:00 pm »
Oh and the other thing - if you installed a serial bootloader on a digispark or a raw avr chip, you would need a serial adaptor to talk to it from a computer. rs232 serial ports operate at an incompatible voltage, but USB ttl cables work well. You can remove the atmega from the socket on some Arduinos and use them as a serial adaptor, or you can install the cdc232 firmware included with littlewire downloads to use the Digispark as a usb -> serial ttl converter which would be able to connect these serial bootloaders to a computer.

germ

  • Jr. Member
  • **
  • Posts: 53
Re: new design proposition
« Reply #12 on: July 27, 2013, 07:03:01 pm »
Thanks a lot for the clarifications Bluebie!
I will have to re-read all that a few times to clearly understand it, but it sounds as there aren't that many limitations to what you can do.
And 12v, transistors and resistors aren't a problem to get my hands on.

Now I just have to figure out how to do all this stuff and start building :D
Sounds like making a programming shield for DIP8 AVRs and then either just upload the sketch, or first upload the button bootloader for 6 I/Os would be the easiest options, but I really don't have a clue yet.

Mark

  • Full Member
  • ***
  • Posts: 196
Re: new design proposition
« Reply #13 on: July 27, 2013, 10:31:00 pm »
Terry King has these ISP programmers for USD$11.50.
http://yourduino.com/sunshop2/index.php?l=product_detail&p=114

No details unfortunately, but I have query in for something else so I'll ask him.

I also found these
http://www.simpleavr.com/avr/hvsp-fuse-resetter

http://mdiy.pl/attiny-fusebit-hvsp-doctor/?lang=en

mark

CBcracker

  • Jr. Member
  • **
  • Posts: 80
Re: new design proposition
« Reply #14 on: July 29, 2013, 08:19:10 am »
Thanks a lot for the clarifications Bluebie!
I will have to re-read all that a few times to clearly understand it, but it sounds as there aren't that many limitations to what you can do.
And 12v, transistors and resistors aren't a problem to get my hands on.



What she's saying is you should be able to use the littlewire firmware on the digispark to program another tiny85 with a shield you build yourself. It should be quite simple - an 8-pin dip socket wired to the digispark. No 12v required.