Author Topic: 1k microcontroller contest?  (Read 15744 times)

0 Members and 1 Guest are viewing this topic.

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
1k microcontroller contest?
« on: February 21, 2015, 02:29:07 pm »
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.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline matseng

  • Frequent Contributor
  • **
  • Posts: 563
  • Country: se
    • My Github
Re: 1k microcontroller contest?
« Reply #1 on: February 21, 2015, 02:38:09 pm »
Hmmm... That sounds like it could be a fun contest.  I'm in.
 

Offline jimon

  • Regular Contributor
  • *
  • Posts: 159
  • Country: se
Re: 1k microcontroller contest?
« Reply #2 on: February 22, 2015, 09:58:41 am »
Sounds nice, I'll try it :scared:
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 37664
  • Country: au
    • EEVblog
Re: 1k microcontroller contest?
« Reply #3 on: February 22, 2015, 10:55:06 am »
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.
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: 1k microcontroller contest?
« Reply #4 on: February 22, 2015, 06:10:37 pm »
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? :)
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1626
  • Country: nl
Re: 1k microcontroller contest?
« Reply #5 on: February 28, 2015, 04:22:08 pm »
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.
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: 1k microcontroller contest?
« Reply #6 on: February 28, 2015, 07:45:39 pm »
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.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8240
Re: 1k microcontroller contest?
« Reply #7 on: March 07, 2015, 03:47:29 pm »
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.
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: 1k microcontroller contest?
« Reply #8 on: March 07, 2015, 03:52:45 pm »
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 :)
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26757
  • Country: nl
    • NCT Developments
Re: 1k microcontroller contest?
« Reply #9 on: March 16, 2015, 09:05:57 pm »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Riotpack

  • Regular Contributor
  • *
  • Posts: 113
  • Country: au
Re: 1k microcontroller contest?
« Reply #10 on: May 01, 2015, 04:57:43 am »
You can fly to the moon on 1K
 

Offline atferrari

  • Frequent Contributor
  • **
  • Posts: 314
  • Country: ar
Re: 1k microcontroller contest?
« Reply #11 on: May 01, 2015, 08:56:20 am »
You can fly to the moon on 1K
Do  the rules allow another K to come back?  ?
Agustín Tomás
In theory, there is no difference between theory and practice. In practice, however, there is.
 

Offline calexanian

  • Super Contributor
  • ***
  • Posts: 1881
  • Country: us
    • Alex-Tronix
Re: 1k microcontroller contest?
« Reply #12 on: June 11, 2015, 06:04:24 am »
Cool!
Charles Alexanian
Alex-Tronix Control Systems
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: 1k microcontroller contest?
« Reply #13 on: November 21, 2016, 12:52:08 pm »
There is an 1k contest now:

https://hackaday.io/contest/18215-the-1kb-challenge

1k 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=66431

My 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 :)
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline AlxDroidDev

  • Frequent Contributor
  • **
  • Posts: 471
  • Country: br
    • Arduino Web Brasil
Re: 1k microcontroller contest?
« Reply #14 on: November 21, 2016, 02:12:13 pm »
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.
"The nice thing about standards is that you have so many to choose from." (Andrew S. Tanenbaum)
 

Offline nuno

  • Frequent Contributor
  • **
  • Posts: 606
  • Country: pt
Re: 1k microcontroller contest?
« Reply #15 on: November 21, 2016, 02:20:57 pm »
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.
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: 1k microcontroller contest?
« Reply #16 on: November 21, 2016, 03:38:32 pm »
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.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: 1k microcontroller contest?
« Reply #17 on: January 13, 2017, 09:08:09 pm »
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 :)
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline jaromir

  • Supporter
  • ****
  • Posts: 337
  • Country: sk
Re: 1k microcontroller contest?
« Reply #18 on: January 16, 2017, 12:11:00 am »
...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.
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: 1k microcontroller contest?
« Reply #19 on: January 16, 2017, 01:15:19 am »
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.html

This is the right language as a beginner language for students, we would have less average programmers >:D

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/
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline jaromir

  • Supporter
  • ****
  • Posts: 337
  • Country: sk
Re: 1k microcontroller contest?
« Reply #20 on: January 16, 2017, 01:40:30 am »
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  :D

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.
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: 1k microcontroller contest?
« Reply #21 on: January 16, 2017, 03:06:59 am »
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.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Online Alex Eisenhut

  • Super Contributor
  • ***
  • Posts: 3330
  • Country: ca
  • Place text here.
Re: 1k microcontroller contest?
« Reply #22 on: January 23, 2017, 03:56:32 am »
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.

Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4068
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: 1k microcontroller contest?
« Reply #23 on: January 23, 2017, 06:36:16 am »
Weren't there many 1k's spread over the thing going to the moon?
 

Offline jartza

  • Newbie
  • Posts: 1
  • Country: fi
Re: 1k microcontroller contest?
« Reply #24 on: February 18, 2017, 07:49:19 pm »
Now I'm just waiting for the 512 bytes competition...  ;)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf