1k microcontroller contest? - Page 1
Forum section: electronics / general

author: FrankBuss
author_rank: Unknown
timestamp: February 21, 2015, 02:29:07 pm
content: 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.

author: matseng
author_rank: Frequent Contributor
timestamp: February 21, 2015, 02:38:09 pm
content: Hmmm... That sounds like it could be a fun contest. I'm in.

author: jimon
author_rank: Regular Contributor
timestamp: February 22, 2015, 09:58:41 am
content: Sounds nice, I'll try it

author: EEVblog
author_rank: Unknown
timestamp: February 22, 2015, 10:55:06 am
content: Quote from: FrankBuss on February 21, 2015, 02:29:07 pmWell 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.

author: FrankBuss
author_rank: Unknown
timestamp: February 22, 2015, 06:10:37 pm
content: Quote from: EEVblog on February 22, 2015, 10:55:06 amSounds good, then you don't have to define all allowed exceptions. When do you start the contest?

author: hans
author_rank: Super Contributor
timestamp: February 28, 2015, 04:22:08 pm
content: 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.

author: FrankBuss
author_rank: Unknown
timestamp: February 28, 2015, 07:45:39 pm
content: 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.

author: amyk
author_rank: Super Contributor
timestamp: March 07, 2015, 03:47:29 pm
content: Quote from: FrankBuss on February 28, 2015, 07:45:39 pmIf 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.

author: FrankBuss
author_rank: Unknown
timestamp: March 07, 2015, 03:52:45 pm
content: 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

author: nctnico
author_rank: Super Contributor
timestamp: March 16, 2015, 09:05:57 pm
content: Quote from: EEVblog on February 22, 2015, 10:55:06 amI 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.

author: Riotpack
author_rank: Regular Contributor
timestamp: May 01, 2015, 04:57:43 am
content: You can fly to the moon on 1K

author: atferrari
author_rank: Frequent Contributor
timestamp: May 01, 2015, 08:56:20 am
content: Quote from: Riotpack on May 01, 2015, 04:57:43 amDo the rules allow another K to come back? ?

author: calexanian
author_rank: Super Contributor
timestamp: June 11, 2015, 06:04:24 am
content: Cool!

author: FrankBuss
author_rank: Unknown
timestamp: November 21, 2016, 12:52:08 pm
content: There is an 1k contest now:https://hackaday.io/contest/18215-the-1kb-challenge1k is a lot. For my Arabaske cellular automaton I needed only 181 bytes x86 assembler:But of course, that's still an awful lot of bytes. A better assembler programmer than me re-implemented my CA in only 59 bytes:http://www.pouet.net/prod.php?which=66431My JavaScript version is much longer, but looks nice (click top right "edit in jsfiddle" to see the source code)https://jsfiddle.net/twrqeg2b/embedded/result/With 1k you can really fly to the moon

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: November 21, 2016, 02:12:13 pm
content: I'm all for it!The Hackaday rules are ok, but there's one rule they missed:- thecompiler flagsused 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 ideaInteraction: awarded to the best project that is a HID or do interact with humansAutomation: awarded to the best project that do not require any human interaction other than turning it onBudget: awarded to the best project that uses the least amount of components and runs on the cheapes microcontrollerSponsor: awarded to the best project that uses parts (such as ICs or uCs), interacts with or complements products from the co-sponsorOverall: no explanation necessary!A single project could win in more than one category.

author: nuno
author_rank: Frequent Contributor
timestamp: November 21, 2016, 02:20:57 pm
content: 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.

author: FrankBuss
author_rank: Unknown
timestamp: November 21, 2016, 03:38:32 pm
content: Quote from: AlxDroidDev on November 21, 2016, 02:12:13 pmThey 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.

author: FrankBuss
author_rank: Unknown
timestamp: January 13, 2017, 09:08:09 pm
content: 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

author: jaromir
author_rank: Unknown
timestamp: January 16, 2017, 12:11:00 am
content: Quote from: FrankBuss on January 13, 2017, 09:08:09 pmUsing 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.

author: FrankBuss
author_rank: Unknown
timestamp: January 16, 2017, 01:15:19 am
content: Quote from: jaromir on January 16, 2017, 12:11:00 amSounds fun, the Brainfuck machine was your project? Cool, great project, congratulations to your prize! Some time ago I programmed a JavaScript implementation ofCOW, 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 programmersAnd 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/

author: jaromir
author_rank: Unknown
timestamp: January 16, 2017, 01:40:30 am
content: Thanks, Brainfuck thingy was my project.At first I wanted to implement Falsehttp://strlen.com/false-languageas 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 BrainfuckI 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.

author: FrankBuss
author_rank: Unknown
timestamp: January 16, 2017, 03:06:59 am
content: 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.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: January 23, 2017, 03:56:32 am
content: Quote from: Riotpack on May 01, 2015, 04:57:43 ameeeeeeh 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.

author: Jeroen3
author_rank: Super Contributor
timestamp: January 23, 2017, 06:36:16 am
content: Weren't there many 1k's spread over the thing going to the moon?

author: jartza
author_rank: Newbie
timestamp: February 18, 2017, 07:49:19 pm
content: Now I'm just waiting for the 512 bytes competition...

author: FrankBuss
author_rank: Unknown
timestamp: October 29, 2017, 04:28:45 am
content: Another nice project, which I ported to the latest AtmelStudio 7 version: A chiptune player with an ATTiny9 microcontroller, which costs 28 cent and has 1024 bytes flash and 32 bytes RAM: