Jon Wilder
Active Member
If you already have a decent understanding of the PIC, either in assembler, or just the hardware itself, then there's no problem using C at all - if you like C
But the problem comes with people starting on the PIC (or other processors) just in C, they don't have a clue about the hardware and what's required, and as most application notes are in assembler it means they struggle finding how to do things.
Historically programmers at University weren't allowed to use HLL's until they had a sound grounding in assembler, and I think that is really as important now as it was then.
Exactly! Most of the example routines in the PIC data sheets (such as the required routine for writing to EEPROM) are written in assembly, and without knowing assembly first this would confuse the n00b first learning PIC programming.
Back in 2005 when I first started using a MIDI rig for guitar, I had a MIDI foot controller that featured 2 expression pedals. I used one to control a Digitech Whammy II and thought it would be super cool to modify my wah pedal to respond to MIDI so that I could make use of the 2nd expression pedal. So I went in search of and learned that I'd have to learn how to program microcontrollers. Not being a programmer I quickly said "Forget that" and nixed the idea.
Fast forward to September of last year I was working for Voodoo Lab. When I learned that the owner wrote most of the MIDI code for their devices it inspired me to give the PIC another shot (although they were using the 8031 since most of their stuff was designed 16 years ago when the 8031 was the hottest thing on the market at the time). I checked out the Cybot page at **broken link removed**, which had a PIC tutorial. After a few times of reading through the tutorial (which teaches assembly), I started to somewhat grasp the material. Shortly after that I found an old DIY kit from Ramsey Electronics for the PICPro programmer (their kit for the NoPPP programmer) at my local electronics surplus store and decided to give it a go and build it. Built it, and it didn't work at first (I learned shortly after that it hadn't been tested on PCs with over a 500MHz CPU, which really dated the kit lol), but as it turned out I had Enhanced Parallel Port enabled in the bios on my PC and had to change it to Standard Parallel Port to make it work. Loaded in the example program and it worked. That gave me a platform to experiment with coding on.
After a month or two of experimentation, reading every PIC book I could get my hands on and debugging my own code, I began to understand how to code in assembly and take advantage of the full instruction set of the 16F series of PIC's.
Assembly language itself is not hard to learn. It has a very simple syntax (3 columns - label, instruction and operand) and it always follows that syntax. I think the most difficult thing about it is that you have to learn the hardware itself and you as the programmer are in charge of most of the housekeeping. I think it was probably simple for me because I've always been a hardware guy having dabbled in analog electronics for most of my electronics days so I'm one who needs to know what's happening electrically on every wire in the circuit rather than being able to look at the wires as an 8 bit group and focusing on the "data" being transmitted on all 8 wires at once.
Last edited: