Jinx wrote: > Dear Clueless ;-) > > >> ;see the .inc file for futher details on notation. Below are a few >> examples. >> (I don't know where to find this 'inc' file mentioned) >> > > .inc files should be in the MPASM folder, probably > > Program Files/Microchip/MPASM Suite > > >> CONFIG OSC=LP ;I'll use a 20MHz crystal at OSC1 & OSC2 >> > > CONFIG OSC = HS then > > >> start >> CLRF PORTB ;initialize port B >> MOVLW b'11111110' ;configure RB0 as output >> MOVWF TRISB >> MOVLW b'00000001' ;set RB0 high >> MOVWF TRISB >> >> goto $ >> > > >> MOVLW b'11111110' ;configure RB0 as output >> MOVWF TRISB >> > > Having all those floating inputs would probably cause problems in > practice. If you're looking at experimenting with just one pin then > CLRF TRISB to set them all as outputs > > The other problem with that code is > > >> MOVLW b'00000001' ;set RB0 high >> MOVWF TRISB >> > > doesn't set the output high. You should be working on LATB. Note > that 18F have two registers per port. PORT is the input, LAT is the > output > > >> Executable code and data must be defined in an appropriate section >> > > (152) When generating a linkable object file, all executable code and > data declarations must be placed within appropriate sections > > Not an error I've had. Does the MPLAB explanation help ? > > Assuming you have MP:AB installed in the default location on your computer, take a look at this file: C:\Program Files\Microchip\MPASM Suite\Template\Code\18F2620TEMP.ASM. It will give you a starting point for the structure your code needs to follow. You will see that there is a reset vector (ORG 0x0000) and then (GOTO MAIN). When the PIC resets, it goes there then is sent to main (at the bottom of the template where you actual code will be. Hope this helps! -- Regards, Stephen D. Barnes ========================================================= = Banking establishments are more dangerous than standing armies. = = Thomas Jefferson = ========================================================= -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist