Hi, i have been recently given a old computer which came with some programming tools. a pickit 2 and a 44 pin demo board PIC16f887 -i/pt.
i loaded up the lessons hex files for the board which were made in asm and had a little muck about with the leds, switch and dial.
from lesson one i manged to change which led lit up buy changing the values of the TRISD,0 PORTD,0 from the lesson below
#include <p16F887.inc>
__CONFIG _CONFIG1, _LVP_OFF & _FCMEN_OFF & _IESO_OFF & _BOR_OFF & _CPD_OFF & _CP_OFF & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_OSC_NOCLKOUT
__CONFIG _CONFIG2, _WRT_OFF & _BOR21V
org 0
Start:
bsf STATUS,RP0 ; select Register Bank 1
bcf TRISD,0 ; make IO Pin RD0 an output
bcf STATUS,RP0 ; back to Register Bank 0
bsf PORTD,0 ; turn on LED RD0 (DS0)
goto $ ; wait here
end
the person who gave me the computer told me to use microcode studio with the picbasic language as it will be a easy place to start.
i found this blink guide on this forum
define osc 4
OSCCON = %01100001
PORTD = 0
TRISD = 0
loop: PORTD.0 = 1 ' Turn on LED connected to PORTD.0
Pause 500 ' Delay for .5 seconds
PORTD.0 = 0 ' Turn off LED connected to PORTD.0
Pause 500 ' Delay for .5 seconds
Goto loop ' Go back to loop and blink LED forever
End
so i pasted it into microcode studio and built the hex but when loading it into pickit2 programmer it gives a warning about some configuration words not being in the hex, i still pressed write and it seems to work =)
i was wandering where i should begin all the information i found on the net seems to be for older PICs and im a bit lost. assembly seems confusing and i was wondering if anyone knows where a good place to start picbasic would be considering the only programming i have done was on a C64 print goto run etc. =/
well thats all i can think of now hehe but i guess i can read the info i was given.
all help will be apricatied
thank you![]()
Bookmarks