Dave and Chris talked about a microcontroller contest in The Amp Hour, with the goal to create a cool project with just 1k flash of a small microcontroller, like a speaker independent speech recognition system.
This project demonstrates that you can do some awesome old-school demo scene video and audio synthesis with just one ATtiny15 running at 1.6 MHz, in 1k flash and 32 bytes of RAM:
I know, it is a lot of work to organize such a contest, but I would join it and try to implement something for it. Demonstrating some of the projects could result in some interesting videos for the EEVblog, too.
Ideas for the rules: use any microcontroller you want, which has 1k flash/ROM or less and 1k RAM or less (the native 1k word size should count, like 12-bit 1k for some PICs, and maybe it is useful to allow larger chips, as long as the program and RAM usage is just 1k each, but maybe it is a good challenge to allow only the small chips with less than 1k flash). Only one microcontroller is allowed. Any external parts are allowed, like LEDs, as long as they are less complex (in sum, transistor count etc.) than the microcontroller. Might be useful to define some exceptions for non-programmable function blocks, like a matrix display is allowed, even if the driver chip might be more complex than the microcontroller, or connecting it to a monitor or PS/2 keyboard is allowed.
Hmmm... That sounds like it could be a fun contest. I'm in.
Ideas for the rules: use any microcontroller you want, which has 1k flash/ROM or less and 1k RAM or less (the native 1k word size should count, like 12-bit 1k for some PICs, and maybe it is useful to allow larger chips, as long as the program and RAM usage is just 1k each, but maybe it is a good challenge to allow only the small chips with less than 1k flash). Only one microcontroller is allowed. Any external parts are allowed, like LEDs, as long as they are less complex (in sum, transistor count etc.) than the microcontroller. Might be useful to define some exceptions for non-programmable function blocks, like a matrix display is allowed, even if the driver chip might be more complex than the microcontroller, or connecting it to a monitor or PS/2 keyboard is allowed.
Well that's the trick really, what you can allow outside the chip.
I think last time Chris and I seriously discussed it we wouldn't have external component restrictions. But if all the clever stuff isn't in the 1K code, then you won't stand a chance to win.
i.e. You get a marks for the application idea, and then more marks for how much the micro contributes to that.
I think last time Chris and I seriously discussed it we wouldn't have external component restrictions. But if all the clever stuff isn't in the 1K code, then you won't stand a chance to win.
Sounds good, then you don't have to define all allowed exceptions. When do you start the contest?
This contest sounds like a fun idea.
I would however also limit the compilers and such. Allow assembler and normal C, no more. Otherwise I would foresee someone writing a BASIC interpreter and running the programs of an external EEPROM chip and SRAM chip.
Would everyone be using the same microcontroller? I listened to the show and I guess you could allow bigger microcontrollers when the program is smaller than 1k-words; but a PIC24 with 24-bit words has a lot more powerful instructions (e.g. direct pointer operations with auto increment in 1 instruction) than a PIC12 with a 12 or maybe 14-bit core (that probably needs 5-6 words to do exactly the same thing). Nevertheless it's fun to squeeze the most dense code in such a controller.
Hans, as Dave wrote "if all the clever stuff isn't in the 1K code, then you won't stand a chance to win". No problem with an interpreter, you can do some amazing things with a Forth interpreter, which can be programm very small, if the built-in set of words (commands are called "words" in Forth) are small and most of it is implemented in the dictionary, and 1k is a lot for Forth, but if you store a megabyte program in an external memory, it would be disqualified.
I think everyone should use the microcontroller they want or know, even if it has more than 1k flash, if the contest entry program is not larger. But you are right, for 24 bit words it would be not fair compared to 8 bit microcontrollers. So maybe better to count the number of 8 bit bytes, i.e. for 12 bit architectures, number of words * 12 / 8.
I think everyone should use the microcontroller they want or know, even if it has more than 1k flash, if the contest entry program is not larger.
If you want to do that maybe you should disallow ones that support self-programming, as otherwise you could just decompress into the flash on the first run.
On the other hand, most demos are packed, so perhaps the 1k size limitation should apply to the file being programmed into the (empty) MCU.
If you manage to implement a good uncompressor in 1k, including a big program as data within the 1k limit, and flash on first start to the rest of the flash, this would give some extra points from the judges
Ideas for the rules: use any microcontroller you want, which has 1k flash/ROM or less and 1k RAM or less (the native 1k word size should count, like 12-bit 1k for some PICs, and maybe it is useful to allow larger chips, as long as the program and RAM usage is just 1k each, but maybe it is a good challenge to allow only the small chips with less than 1k flash). Only one microcontroller is allowed. Any external parts are allowed, like LEDs, as long as they are less complex (in sum, transistor count etc.) than the microcontroller. Might be useful to define some exceptions for non-programmable function blocks, like a matrix display is allowed, even if the driver chip might be more complex than the microcontroller, or connecting it to a monitor or PS/2 keyboard is allowed.
Well that's the trick really, what you can allow outside the chip.
I think last time Chris and I seriously discussed it we wouldn't have external component restrictions. But if all the clever stuff isn't in the 1K code, then you won't stand a chance to win.
I recall a programming contest from several decades ago. The person who won basically wrote an interpreter which parsed commands from a huge file. The interpreter met the size restrictions set by the contest rules ofcourse. So write a program for an ARM controller which can read an SPI flash containing audio + video and bit-bang a TFT screen + PWM DAC.
You can fly to the moon on 1K
You can fly to the moon on 1K
Do the rules allow another K to come back? ?
I'm all for it!
The Hackaday rules are ok, but there's one rule they missed:
- the
compiler flags used to get the binary below 1kb must be explicited in the submission (ie. -Os or -O3 and the like for gcc)
Keep in mind that Hackaday's staff (therefore those who'll be judging the entries) is a lot bigger than EEVBlog's staff, so analyzing and judging the submissions might be a lot for Dave to take care of by himself. On the other hand, making a partnership with a company in the EE field, who'll be co-sponsoring the contest would be a great idea: the company could provide the prize(s) and their staff would help in juding the entries. It's a win-win situation for everyone. What do you think, Dave?
I also suggest multiple categories, and they'll all have to fit in the rules:
- Innovation: awarded to the project that presents the most innovative idea
- Interaction: awarded to the best project that is a HID or do interact with humans
- Automation: awarded to the best project that do not require any human interaction other than turning it on
- Budget: awarded to the best project that uses the least amount of components and runs on the cheapes microcontroller
- Sponsor: awarded to the best project that uses parts (such as ICs or uCs), interacts with or complements products from the co-sponsor
- Overall: no explanation necessary!
A single project could win in more than one category.
External components could be limited in type and number (ex.: only up to 3 passives and 1 transistor), and points removed for each component used.
The Hackaday rules are ok, but there's one rule they missed:
- the compiler flags used to get the binary below 1kb must be explicited in the submission (ie. -Os or -O3 and the like for gcc)
They say you have to explain why it is 1k, so e.g. sending a map file output. Together with the requirement that it is open source, everybody could verify it. But if the output is a HEX file, or even a BIN file, it is easy to check the size. I don't know how the rules apply for ELF files with all the overhead in it which is not part of the program, but there are not much microcontrollers or microprocessors which can run ELF files anyway. And I guess there are not many C entries, most will be written in assembly, so should be no problem. But right, always a good idea to document how you created your binary output.
The Hackaday prize is over, cool winners:
http://hackaday.com/2017/01/13/1-kb-challenge-and-the-winners-are/I didn't have time to finish my project. I have a working prototype with my STM32F4 Discovery kit and CubeMX, but could only strip it down to like 2k using C (from like 15k by removing all the bloated CubeMX framework stuff and writing directly to the registers), and no time to learn ARM assembly to reduce it more. Don't want to tell more about it, will submit it to the next 1k contest that will pop up
...and no time to learn ARM assembly...
Using assembly language (no ARM, though) was obvious decision for me. Even then, I had to make every possible measure (from small tricks to save byte here and there to bigger conceptual decisions) to cram everything into 1024 B. Definitely fun contest, I'm curious whether they will repeat the contest or come with something different. HaD prize is "too vague and bloated" for me, their smaller contests are more fun.
Using assembly language (no ARM, though) was obvious decision for me. Even then, I had to make every possible measure (from small tricks to save byte here and there to bigger conceptual decisions) to cram everything into 1024 B. Definitely fun contest, I'm curious whether they will repeat the contest or come with something different. HaD prize is "too vague and bloated" for me, their smaller contests are more fun.
Sounds fun, the Brainfuck machine was your project? Cool, great project, congratulations to your prize! Some time ago I programmed a JavaScript implementation of
COW, a Brainfuck variant designed with Bovinae in mind:
http://www.frank-buss.de/cow.htmlThis is the right language as a beginner language for students, we would have less average programmers
And you are right with the big Hackaday prize, it's bloated and vague, but apparently not difficult to win it:
https://www.eevblog.com/forum/contests/hackaday-prize-2016-a-ripoff-of-a-12-year-old-project/
Thanks, Brainfuck thingy was my project.
At first I wanted to implement False
http://strlen.com/false-language as it looks like quite powerful language, but the interpreter would take too much space, so I opted for the smallest possible language, Brainfuck. Cow looks like fun, too, but it's not that much user-friendly as Brainfuck
I know this particular HaD prize winner is somehow dubious, on the other hand, his implementation is documented and open. But it's hard to judge for me - I'm not particularly robot oriented guy; and HaD prize is not exactly my cup of tea. I don't like the idea of "making something that matters" or whatever is the current slogan, as I'm doing my hobby because it's fun. I'm not going to save kids in Africa, decreasing air pollution nor bring education to third world, at least not today.
Nice, the False language looks really elegant, the functional version of the more procedural Brainfuck. I always missed lambdas when I was programming in Forth (I have some Common Lisp experience), this makes loops very natural. The 68k version of False was 1k, should be possible to do this in ARM assembly, too, but of course, needs a more complex keyboard etc., would be a different project. The 1 k version is a bit cheating, using Amiga workbench libraries.
You can fly to the moon on 1K
eeeeeeh yeah, that and a 2700 ton 300 foot tall canister of kerosene and liquid oxygen with five fireholes at one end and a pointy people holder at the other.
Weren't there many 1k's spread over the thing going to the moon?
Now I'm just waiting for the 512 bytes competition...