Lazarus

Programming => Embedded => Operating Systems => Embedded - AVR => Topic started by: ccrause on October 11, 2020, 08:27:37 pm

Title: Blinky on attiny 10
Post by: ccrause on October 11, 2020, 08:27:37 pm
I thought it would be interesting to use one of the really tiny AVR controllers and program it with FPC.  Quite an experience soldering the tiny chip to a piece of strip board, see picture below (the controller is the little insect-like black rectangle with the six shiny legs).  Links to code (https://github.com/ccrause/fpc-avr/blob/master/src/examples/blinktiny10/blink.lpr) and video (https://youtu.be/ISdfj9Ls7zg)
Title: Re: Blinky on attiny 10
Post by: MarkMLl on October 11, 2020, 10:25:46 pm
That's very impressive for something programmable, but don't forget these as an absolute comparison:

https://www.youtube.com/watch?v=dyL0kIhAOzY
https://hackaday.com/2018/09/23/worlds-smallest-led-blinky/
https://hackaday.com/2019/04/11/an-even-smaller-worlds-smallest-led-blinky/

MarkMLl
Title: Re: Blinky on attiny 10
Post by: ccrause on October 11, 2020, 11:07:05 pm
That's very impressive for something programmable, but don't forget these as an absolute comparison:

https://www.youtube.com/watch?v=dyL0kIhAOzY
https://hackaday.com/2018/09/23/worlds-smallest-led-blinky/
https://hackaday.com/2019/04/11/an-even-smaller-worlds-smallest-led-blinky/

MarkMLl
There are many amazing projects out there, I agree. The interesting thing for me is that FPC is capable of generating code that works in this very constrained environment.
Title: Re: Blinky on attiny 10
Post by: Dimitrios Chr. Ioannidis on October 11, 2020, 11:18:42 pm
Hi !

  Kudos for your  patience soldering this !

(  I prefer to use them, on a SOT-23 to DIP adapter ....  )

regards,


 
Title: Re: Blinky on attiny 10
Post by: MarkMLl on October 12, 2020, 09:31:27 am
There are many amazing projects out there, I agree. The interesting thing for me is that FPC is capable of generating code that works in this very constrained environment.

Yes, I agree. And it was a nice bit of soldering.

MarkMLl
Title: Re: Blinky on attiny 10
Post by: PascalDragon on October 12, 2020, 11:22:25 am
The interesting thing for me is that FPC is capable of generating code that works in this very constrained environment.

Yes, it's definitely amazing how far FPC as come and how much of a range of platforms it can and does cover nowadays. :)
Title: Re: Blinky on attiny 10
Post by: Mathias on October 16, 2020, 02:08:28 pm
I thought it would be interesting to use one of the really tiny AVR controllers and program it with FPC.  Quite an experience soldering the tiny chip to a piece of strip board, see picture below (the controller is the little insect-like black rectangle with the six shiny legs).  Links to code (https://github.com/ccrause/fpc-avr/blob/master/src/examples/blinktiny10/blink.lpr) and video (https://youtu.be/ISdfj9Ls7zg)
I looked at your code. Only me is a mystery how you made the LED blink. I don't see a PORTx command anywhere.
Title: Re: Blinky on attiny 10
Post by: ccrause on October 17, 2020, 08:59:41 pm
I looked at your code. Only me is a mystery how you made the LED blink. I don't see a PORTx command anywhere.
The timer can directly control the output compare pin A (OCOA = PB0). The specific option I use is to let the timer toggle the pin on each compare match. This way, once the timer is configured it will generate a pulse train with no further involvement of the core.  See the description in the attached image.

Kind of like PWM, but simpler since the duty cycle is fixed.
Title: Re: Blinky on attiny 10
Post by: Laksen on October 17, 2020, 09:11:36 pm
Very nice :)

Next try this one :P https://www.digikey.com/short/znm0c0
Title: Re: Blinky on attiny 10
Post by: MarkMLl on October 17, 2020, 09:45:44 pm
Next try this one :P https://www.digikey.com/short/znm0c0

12 solder bumps on a package 1.5mm square... would there be any chance at all of mounting that on a single-sided board, or would it need a multilayer board with properly prepared pads/vias?

MarkMLl
Title: Re: Blinky on attiny 10
Post by: Laksen on October 17, 2020, 10:22:24 pm
You would need tiny trace widths < 2mil, via in pad, or HDI with micro vias for this kind of size sadly :/
They put the GND pad in the middle of the chip meaning you would have to hack one of the outer balls of the package if you wanted a normal PCB
Title: Re: Blinky on attiny 10
Post by: MarkMLl on October 17, 2020, 11:09:12 pm
I've seen (photos of) some pretty impressive work mounting this sort of thing tits-up and soldering wires "dead bug" style but that's well beyond anything I could do. OTOH I've also seen discussion of using lasers for soldering, and at that fairly small scale with very thin wire it should be fairly accessible.

I'd love to know what my watchmaker grandfather would have made of modern stuff. It's amazing what some people could do with a spirit lamp and blowpipe.


Somewhat later: https://www.youtube.com/watch?v=T2h7hagVfnA using a 3W laser, demonstrating that it's got more than enough power and is in fact badly let down by poor temperature control.

MarkMLl
Title: Re: Blinky on attiny 10
Post by: ccrause on October 17, 2020, 11:44:52 pm
You would need tiny trace widths < 2mil, via in pad, or HDI with micro vias for this kind of size sadly :/
They put the GND pad in the middle of the chip meaning you would have to hack one of the outer balls of the package if you wanted a normal PCB
Not what I would call ideal for hand soldering  %)
Title: Re: Blinky on attiny 10
Post by: Mathias on October 19, 2020, 01:53:47 pm
I looked at your code. Only me is a mystery how you made the LED blink. I don't see a PORTx command anywhere.
The timer can directly control the output compare pin A (OCOA = PB0). The specific option I use is to let the timer toggle the pin on each compare match. This way, once the timer is configured it will generate a pulse train with no further involvement of the core.  See the description in the attached image.

Kind of like PWM, but simpler since the duty cycle is fixed.

Solved in a similar way to how I did the tutorial.
https://wiki.freepascal.org/AVR_Embedded_Tutorial_-_Analog_Write/de
Title: Re: Blinky on attiny 10
Post by: devEric69 on October 19, 2020, 05:35:53 pm
Impressive and interesting.

Question from a dummy in electronics: how do you "flash" this kind of chip (i.e. inject inside, the compiled FPC code)? Is an Arduino required with its "EDI", before this kind of electronic "test" board?
Title: Re: Blinky on attiny 10
Post by: MarkMLl on October 19, 2020, 07:14:44 pm
Question from a dummy in electronics: how do you "flash" this kind of chip (i.e. inject inside, the compiled FPC code)? Is an Arduino required with its "EDI", before this kind of electronic "test" board?

I can't speak for that specific chip, but by and large you need something like Avrdude plus a little interface box that costs about a fiver (some of which need a firmware update before they're useful, links if you're interested).

If the chip has been set up ("fuse bits" which are actually rewritable) to ignore that protocol, there's another that uses a special AVR debug mode.

And if that's disabled there's JTAG.

If you've got the Arduino IDE then by default it assumes that there's a loader at the top of Flash which talks 5V serial to a PC. That doesn't stop you from taking the generated .hex file and getting it into Flash some other way.

MarkMLl
Title: Re: Blinky on attiny 10
Post by: Mathias on October 19, 2020, 08:41:29 pm
Impressive and interesting.

Question from a dummy in electronics: how do you "flash" this kind of chip (i.e. inject inside, the compiled FPC code)? Is an Arduino required with its "EDI", before this kind of electronic "test" board?
http://www.technoblogy.com/show?1YQY
Title: Re: Blinky on attiny 10
Post by: ccrause on October 19, 2020, 08:47:25 pm
Question from a dummy in electronics: how do you "flash" this kind of chip (i.e. inject inside, the compiled FPC code)? Is an Arduino required with its "EDI", before this kind of electronic "test" board?

I can't speak for that specific chip, but by and large you need something like Avrdude plus a little interface box that costs about a fiver (some of which need a firmware update before they're useful, links if you're interested).
Indeed, I used avrdude and a cheap USBasp programmer:
Code: Text  [Select][+][-]
  1. avrdude -p t10 -c usbasp -q -U flash:w:blink.hex:i
  2.  
  3. avrdude: AVR device initialized and ready to accept instructions
  4. avrdude: Device signature = 0x1e9003 (probably t10)
  5. avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
  6.          To disable this feature, specify the -D option.
  7. avrdude: erasing chip
  8. avrdude: reading input file "blink.hex"
  9. avrdude: writing flash (102 bytes):
  10. avrdude: 102 bytes of flash written
  11. avrdude: verifying flash memory against blink.hex:
  12. avrdude: load data flash data from input file blink.hex:
  13. avrdude: input file blink.hex contains 102 bytes
  14. avrdude: reading on-chip flash data:
  15. avrdude: verifying ...
  16. avrdude: 102 bytes of flash verified
  17.  
  18. avrdude done.  Thank you.

Also if you want more of the Arduino IDE experience then you can try the Lazarus-Embedded (https://github.com/sechshelme/Lazarus-Embedded) package which gives a GUI to handle some of the common functionality such as configuring fuses and avrdude (I haven't yet tested this package).
Title: Re: Blinky on attiny 10
Post by: MarkMLl on October 19, 2020, 09:24:18 pm
Indeed, I used avrdude and a cheap USBasp programmer:

I've got one labelled AVRISP which has to be reflashed using an Arduino: the firmware in it isn't quite as expected.

I've had a lot of "fun" over the last few months with a 649 board upcycled from a washing machine. it uses the "Butterflycore" loader but I found I had to change that since it was making some bad startup decisions (if there was application code in Flash it wouldn't first check if the user wanted to use the loader to reflash it. Also it has something odd in its reset circuitry which meant that it wanted the wrong sense of DTR and I had to modify Avrdude... learnt a lot, the modified stuff is at https://github.com/MarkMLl Next job is to see if I can get the LCD working, ultimately I hope to have it controlling a produce drier but I've clearly missed that one for this year :-)

MarkMLl
Title: Re: Blinky on attiny 10
Post by: devEric69 on October 20, 2020, 08:38:44 pm
Thank you all for your insights.
TinyPortal © 2005-2018