As IT practitioner, I was thinking that I was used to technical and mostly boring documents (worked in a bank after all...). That was true until the moment I have opened a datasheet in electronic!
286 pages of schematics, technical details and code example just for a very small Microntroller.
A Microcontroller, here an ATtiny44 with 4K Bytes In-System Programmable Flash and 256 Bytes of In-System Programmable EEPROM, is basically a computer on a chip. It differs form normal desktop or laptop computers in that a microcontroller is an application specific to computer that usually runs a single program performing dedicated task(s) while the later two are general purpose computers that can run numerous programs depending on a users needs. A microcontroller contains on chip CPU, input/output interface, memory, clock, timer, and an assortment of of other peripherals.
I have try to read it all and let's be honest, I didn't make it :) Some of this stuff is just way over my head. Instead of that, I have tried to focus on the main informations. I'm sure that after other assignments, more of this datasheet will make sense.
The pin configuration is capital to understand how to use the Microcontroller. It shows you where you have to connect the 5V, the ground, the I/O, the interrupt,...
A more complete description of the pins, we can see how the reset is working by example
When digging in the datasheet, you can find even more information on the pins, here the PortA print
And the Pins PortB, here the PB0, PB1 and PB2 are interesting for several reasons : PB0 and PB1 are used by the crystal (if any). PB2 can be used for interruption and that's why we have put the button of the HelloBoard on it. The reading of the datasheet is boring as hell but really important when you have to plan your schematic or simply doing anything at all with a microship
Programming the Board
I have connected my FabISP to my computer and then linked it to my hello board
I need to use zadig to install the right USB driver needed for the TinyISP
After that, The FabISP is recognized correctly so no issues on that side!
I will now used the Arduino IDE to make a simple programm.
First thing first, I have to tell the IDE that I'm using an USBTinyISP as programmer and for the board, It seems that the library for the ATTiny is missing, I have found them on this website. After that, I have easily add via file, preferences and the field additional Boards Managers URLs.
Now when I go in the board manager,located in the tools tab, I can add the ATTiny family, I'm set to go with these parameter
Once I have set the right settings with USBTiny as programmer, the board as ATTiny 24/44/84, the processor as ATtiny 44, the clock is let as default and no port defined as I'm using USB. I will now load the easiest of all examples, the BLink, to test the connection and programmation via the upload button, who made the compilation and then the upload via the TinyISP and then to my HelloBoard
And it's blinking! We are set to go!
I will now programm my HelloBoard to do some Morse. I have made a first try with a more complex sketch based on this sketch but the ATtiny doesn't have enough memory with the complete software. I will have to test with something else to reduce the memory footprint. Error message : Arduino: 1.8.1 (Windows 10), Board: "ATtiny24/44/84, ATtiny44, Internal 1 MHz"Sketch uses 2950 bytes (72%) of program storage space. Maximum is 4096 bytes. Global variables use 332 bytes (129%) of dynamic memory, leaving -76 bytes for local variables. Maximum is 256 bytes. Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint. Error compiling for board ATtiny24/44/84. This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
So I have made a more 'stupid' code to do almost the same thing, here It says "SMS" in Morse. I have made few fonctions such as "dat" and "dot" and I have played with the delays