PIC Microcontrollers

Hello. I'm just making my entrance into the world of microcontrollers. But as I self learning everything I have a few questions. I recently purchased 2 PICS (16F648A) and a programming board. The board works fine and I got it to connect to the computer and reconize the PIC. I guess my first question is, Is all hex code PIC specific? Meaning would I be able to use this code "http://www.voti.nl/blink/index_1.html#16F630" for my PIC? The models are very similar but not exact. If not, I would like to do the standard "Blink an LED" as my first project. How would I write my code for this PIC and what materials would I need? Thanks!

sort by: active | newest | oldest
Hussam6 years ago
Well there is only a chance that the code will work .. it all depends whether they have same addresses as frank said .. I would recommend microchips MPLAB IDE .. it is a comprehensive software and it supports kits like Microchip ICD3 etc ... the program for blinking an led is really simple ... all you'll need is :

MOVLW 55H
CLRF TRISB
LOOP_1
MOVWF PORTB
CALL DELAY
COMF PORTB
BRA LOOP_1

This is just a rough code .. there's some headers and other things you'll need to set and you'll need to create a delay by running a loop and be careful that the delay u are creating is detectable to human eye.
Glowdark Mark10 years ago
I am trying to self learn about PIC's myself, and have found many sources of interest, since I am endeavoring to build a set of Triklit's. Utube demonstration video by jptokash http://www.youtube.com/watch?v=-8zmgBIiB2I
I have found that I will need MPLAB with a c18 compiler, available at microchip.com. Download instruction for free programs: http://www.pyroelectro.com/tutorials/pic_microcontroller/index.html Schematics, board layouts and code samples with driver boards at: http://www.petesworld.demon.co.uk/homebrew/PIC/rgb/index.htm Another source for stuff is more obscure, but can be found at: http://www.emanator.demon.co.uk/bigclive/rgbcont.htm
For an instructable project using the above controllers and drivers (they are almost interchangable) see RGB moodlight by peterrus:
https://www.instructables.com/id/RGB-Moodlight/
If anyone can give me any pointers for building a synchronized string of these lites, please contact me! Hope this helps.
hi there i am trying to get started with PIC's i have used "Chip Factory" before, its really simple to use and has its own on screen user interface, but its stupidly expensive I recently treated myself to a kit PIC programmer from maplins which is great! it was about £25 and is pretty simple to assemble if you have a half decent knowledge of the components and how to solder the hardest part I found of assembling to was having to make your own RS-232 cable for it which was a bit fiddly to assemble as as soon as you soldered one wire another broke off its all done now and is working a treat, I would recommend this to anyone trying to get started all I need to do now is learn how to write my own code!
Goodhart10 years ago
frank2608011510 years ago
I think all PICs have the same command set, but the register addresses might be different. For code to be compatible with different chips, the register addresses and command set must be identical (or identical for the ones you need to use).

Use BoostC compiler from http://www.sourceboost.com/ so you can write and compile C code