More...

A cute acute triangle.

Posts from: October '08


PIC


Week and a half ago I ordered the PICkit 2 Starter Kit. It includes a PIC microcontroller, a demo board, a PIC programmer and two CDs with development software. The embedded programming has been a field I wanted to try in since a long time, and this gadget offers an easy and convenient path to introduce one into the matter.

Image
the demo board...

Image
...with the programmer

It was yesterday when I finally found some free time to open the package and install the software. The processor is really simple - no more than one straight sitting to learn the instruction set, the same goes for the hardware on the board. The "Hello, world!" in the realm of microcontrollers - blinking a LED - seemed far too trivial for a first program, so I came up with something a little more interesting - blinking a LED with pulse-width modulation :)

Here it is in action: youtube
In fact, the whole thing is a little more complex than it looks like. PWM with PIC is easy, however the interesting part is how do you change the width of the pulses. It turns out that if you change them linearly, the end result doesn't look very convincing - the LED feels bright for the most part of the time, dimming abruptly only for a short moment and brightening again immediately. I discovered that an exponential pulse width scheme offers a much better effect. With the help of some 128-element lookup table (since the PIC doesn't have any floating-point hardware) and my first program was ready.

Now I have to buy some more electronics so I can start building The Thing. Beware. It is coming :D


Posted in category Hardware -- clock 24 Oct 2008, 18:36, 1 comment

Language:

bgБългарски
enEnglish


Categories:

Meta
Hardware
Technology
Fun
Open source
Interesting
Hiking/Trips
Stuff
Programming
Music
Images
Photography
All


Archive:

+ 2008 (9)
March '08 (2)
April '08 (2)
May '08 (2)
October '08 (1)
December '08 (2)
+ 2009 (8)
January '09 (2)
March '09 (1)
August '09 (2)
September '09 (1)
November '09 (1)
December '09 (1)
+ 2010 (9)
January '10 (1)
April '10 (2)
June '10 (1)
July '10 (1)
September '10 (1)
November '10 (1)
December '10 (2)
+ 2011 (10)
January '11 (3)
February '11 (1)
August '11 (2)
September '11 (2)
October '11 (2)
+ 2012 (14)
January '12 (3)
March '12 (1)
April '12 (2)
May '12 (3)
August '12 (1)
September '12 (1)
November '12 (1)
December '12 (2)
+ 2013 (1)
March '13 (1)
+ 2014 (3)
September '14 (3)
+ 2015 (5)
January '15 (1)
March '15 (3)
May '15 (1)
+ 2016 (4)
June '16 (1)
July '16 (1)
November '16 (1)
December '16 (1)


Last comments:

30 May 2017, 02:02 by anrieff
26 May 2017, 01:00 by Mathew
30 Mar 2017, 13:59 by antfarmer
26 Dec 2016, 17:52 by Private
19 Dec 2016, 23:01 by ицаци
16 Dec 2016, 19:50 by Антон


Valid XHTML 1.0 Strict

Blogroll:

linkJoel on Software
linkRidiculous Fish
linkXKCD blag