Please help a new guy get going with a PIC10F222
Hello all!
I'm new to programming and that means that the least clearly documented area in programming (setting up the registers) has stopped me cold. I'm coding a 10f222 and I can get my program compiled, but it will not run. I strongly suspect that I don't understand what registers I need to set up. So I ripped down the program and I'm simply asking for GPIO.2 to pulse on and off (get the LED to light). Still nothing.
What would be great is if someone would post a listing that DID work and I then could compile and run it. That would confirm that everything over here is working correctly, and who knows, I might even learn something!
Thanks,
Q
Manual - Section 4.4 Aliases
Not 100% sure what you are after but ...
Your software guy probably likes code that is well documented and easy to read – don't we all. I do the following all the time when in your situation. I set up a variable that I plan to use locally and then set up an alias to that variable.
Example:
AppleCount var BYTE ; define variable in RAM
OrangeCount var AppleCount ; alias to AppleCount
; early in the program
For AppleCount =1 to 10
Do Something
Next AppleCount
.
.
.
;Latter in the program
OrangeCount = PORTB
Select Case OrangeCount
Case 1
Do something
Case Else
Do something else
End Select
As you can see, the variable is reused and readability is maintained.
Paul Borgmeier
Salt lake City, Utah
USA