Hello I got my PIC programmer in today and it's the iCP01 PIC Programmer and I've got the MPLABs installed and the PICKit 2 Software installed to compile code into my chip.
I'm currently using a 18F2550 and when I was reading through some of the tutorials, I'm already lost on the code. They use a different PIC then me and all of them don't explain how to code for different other PICs or explain what your looking for when your coding on different platforms unless they explain this somewhere in a more later tutorial.
I'm sorta new to assembly, but any other languages such as C or C++ aren't new to me and these tutorials suspect you may have a good understanding of Assembly which in my case is a little bit of a problem from what it looks.
Here is a hello world for my PIC18F2550 I'm working on to simply turn a LED on as a hello world.
As you can see I marked out function tris on line 10, because every time I run that line in a 12F508 simulator it doesn't have a problem, but if I do uncomment that line in the 18F2550 I get the "Illegal opcode (RB0)".
Can someone tell me a little more information about how to know what your looking for when programming a PIC you never compiled for and how do I know if a specific PIN would be wanting input or is doing an output in the simulator exactly? Did I maybe choose the wrong PIC for a beginner in the first place and should have gone for a 12F or a 16F series?
I'm currently using a 18F2550 and when I was reading through some of the tutorials, I'm already lost on the code. They use a different PIC then me and all of them don't explain how to code for different other PICs or explain what your looking for when your coding on different platforms unless they explain this somewhere in a more later tutorial.
I'm sorta new to assembly, but any other languages such as C or C++ aren't new to me and these tutorials suspect you may have a good understanding of Assembly which in my case is a little bit of a problem from what it looks.
Here is a hello world for my PIC18F2550 I'm working on to simply turn a LED on as a hello world.
Rich (BB code):
processor 18F2550
include <p18F2550.inc>
WDT = 0
org 0x0
clrf RB0 ; all outputs := 0
movlw b'11111110'
;tris RB0 ; lowest bit of GPIO becomes an output
bsf RB0,0 ; bring GPIO bit 0 high
x goto x ; endless loop
end
Can someone tell me a little more information about how to know what your looking for when programming a PIC you never compiled for and how do I know if a specific PIN would be wanting input or is doing an output in the simulator exactly? Did I maybe choose the wrong PIC for a beginner in the first place and should have gone for a 12F or a 16F series?
Last edited: