Hi All PICers ! > From: Jean-Francois Joly > Subject: PORTA Question! > Hello everyone! > > I would like to make a little program that sends a high on > the RA0 pin to light up a LED. I think it should be simple > enought, but because this is my first attempt in programming > a PIC, Im not to sure... > > This is the main part of the program. If something is wrong > or missing, please tell me! > > BSF PORTA, RA0 ; Want to put 1 on RA0 pin > BSF TRISA, TRISA0 ; Output a high on RA0 pin ^^^ bcf, at first. What about ROM PAGE selecting ? PORTA is on the 0-page, but TRISA - on 1st once. You must write: bcf porta,ra0 bsf status,RP0 bsf trisa,0 bcf status,RP0. More better - to use macros and defines, for example: ; #define A0_ON bsf porta,0 #define A0_OFF bcf porta,0 #define A0_INP bsf trisa & 0x7f,0 #define A0_OUT bcf trisa & 0x7f,0 ; PAGESET macro pagenum if pagenum == 1 bsf status,RP0 else bcf status,RP0 endif endm ; ;After that your program looks like : ; A0_ON PAGESET 1 A0_OUT PAGESET 0 ; > Would this work? See before :-) > Does it send the signal to the pin at the > same moment that I set in the TRISA register pin RA0 as > output? Yes, of course. Best Wishes, Alex Torres. Kharkov, Ukraine, exUSSR. E-Mail To : altor@cook.kharkov.ua via InterNet or 2:461/28 via FidoNet --- GoldED 2.50.A0531+