¿ Reality ? PIC Microcontollers

People's opinions are mixed on the use of Assembly to program the PIC. I like it and find it nicer than the higher level languages. The trick to assembly is to think in small steps and in patterns.

Some while ago, back in Grad School, I discovered the PIC microcontroller. This line of chips, made by Microchip allow for projects to have that little bit of needed digital smarts in a fairly small package and cheap. They're effectively a disposable computer, the cheapest ones going for $0.50 each in bulk from online suppliers, while modestly powered ones can be had for a few bucks or less.

Now, unfortunately, other things put the interest on hold for a while, but recently I've return and am starting to make progress. So I figured I'd do some documenting. I did pick up the book Programming and Customizing PICmicro Microcontrollers (I've got the second edition) and it has a bunch of useful material.

The main chip I've been using is the pic16f777. This is a low to mid range chip with enough features to do a bunch of interesting things. It sports a bunch of I/O pins and a USART.



SPBRG for BRGH=0
Baud 500 KHz1 MHz2 MHz 4 MHz8 MHz 10 MHz 12 MHz16 MHz20 MHz
300 2551103 207---- ------
600 122551 103207-- ------
1,200 --1225 51103130 155207--
2,400 ----12 255164 77103129
4,800 ------ 1225-- 385164
9,600 ------ --12-- --25--
14,400 ------ ------ 12----
19,200 ------ ------ --12--

SPBRG for BRGH=1
Baud 500 KHz1 MHz2 MHz 4 MHz 8 MHz 10 MHz 12 MHz 16 MHz20 MHz
1,200 2551103 207---- ------
2,400 122551 103207-- ------
4,800 --1225 51103129 155207--
9,600 ----12 255164 77103129
14,400 ------ --3442 516886
19,200 ------ 1225-- 385164
28,800 ------ ------ 253442
38,400 ------ --1215 --2531
57,600 ------ ------ 12----

To make it on the above charts, the computed baud rate had to be within 1% of the desired value. If one doesn't wish to bother with interoperating with other off-the-shelf devices, then the available baud rates will vary between 1,220 to 1,250,000 baud for the 20MHz device.