Searching \ for '[PIC] [EE] real stupid pic16f88 problem' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: '[EE] real stupid pic16f88 problem'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] [EE] real stupid pic16f88 problem'
2007\02\25@134411 by picnoob

flavicon
face

ok, i wont laugh, it just seems like you have read a load of tutorials, and
everything is slightly different


try this code(this is all there is):

__CONFIG b'11111101100100' ;using internal oscillator btw(see datasheet for
info on configuration word)

PORTA equ 0x05
PORTB equ 0x06


;set up ports:
movlw b'11111111'
tris PORTA ;set all lines in PORTA to IN
movlw b'00000000'
tris PORTB ;set all lines in PORTB to OUT

movlw b'11111111'
movwf PORTB ;set all lines of PORTB to ON


main ;start of main routine
btfsc PORTA,4 ;if button is pressed(skip next instruction if not pressed):
clrf PORTB ;turn PORTB lines off.---- if not pressed:
goto main ;go back to main routine and check again


end

hope this helps
--
View this message in context: www.nabble.com/real-stupid-pic16f88-problem-tf3287122.html#a9146616
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2007\02\25@135000 by picnoob

flavicon
face

ok, i wont laugh, it just seems like you have read a load of tutorials, and
everything is slightly different


try this code(this is all there is):


----------------------------------------------------------------------------
__CONFIG b'11111101100100' ;using internal oscillator btw(see datasheet for
info on configuration word)

PORTA equ 0x05
PORTB equ 0x06


;set up ports:
movlw b'11111111'
tris PORTA ;set all lines in PORTA to IN
movlw b'00000000'
tris PORTB ;set all lines in PORTB to OUT

movlw b'11111111'
movwf PORTB ;set all lines of PORTB to ON


main ;start of main routine
btfsc PORTA,4 ;if button is pressed(skip next instruction if not pressed):
clrf PORTB ;turn PORTB lines off.---- if not pressed:
goto main ;go back to main routine and check again


end

----------------------------------------------------------------------------
hope this helps

also, if you want to make it so it alternates(toggles on/off with button),
replace the main routine with this:

---------------------------------------------------------------------------------------------
main ;start of main routine
btfsc PORTA,4 ;if button is pressed(skip next instruction if not pressed):
call switch
goto main ;go back to main routine and check again

switch ;new switch subroutine
check btfsc PORTA,4
goto check ;stay in a loop whilst button is still pressed
comf PORTB,f ;switch all 1ns to 0s vice versa
return

---------------------------------------------------------------------------------------------
--
View this message in context: www.nabble.com/real-stupid-pic16f88-problem-tf3287122.html#a9146616
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2007\02\25@135231 by picnoob

flavicon
face

ok, i wont laugh, it just seems like you have read a load of tutorials, and
everything is slightly different


try this code(this is all there is):


----------------------------------------------------------------------------
__CONFIG b'11111101100100' ;using internal oscillator btw(see datasheet for
info on configuration word)

PORTA equ 0x05
PORTB equ 0x06


;set up ports:
movlw b'11111111'
tris PORTA ;set all lines in PORTA to IN
movlw b'00000000'
tris PORTB ;set all lines in PORTB to OUT

movlw b'11111111'
movwf PORTB ;set all lines of PORTB to ON


main ;start of main routine
btfsc PORTA,4 ;if button is pressed(skip next instruction if not pressed):
clrf PORTB ;turn PORTB lines off.---- if not pressed:
goto main ;go back to main routine and check again


end

----------------------------------------------------------------------------
hope this helps

also, if you want to make it so it alternates(toggles on/off with button),
replace the main routine with this:

---------------------------------------------------------------------------------------------
main ;start of main routine
btfsc PORTA,4 ;if button is pressed(skip next instruction if not pressed):
call switch
goto main ;go back to main routine and check again

switch ;new switch subroutine
check btfsc PORTA,4
goto check ;stay in a loop whilst button is still pressed
comf PORTB,f ;switch all 1ns to 0s vice versa
return

---------------------------------------------------------------------------------------------


here are all pic instructions:
www.dcc.unicamp.br/~celio/mc404/pic/pic_instructionset_summary.html
Instruction set
--
View this message in context: www.nabble.com/real-stupid-pic16f88-problem-tf3287122.html#a9146616
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2007\02\25@141101 by Jan-Erik Söderholm

face picon face
Is this an question about something !?

Jan-Erik.


picnoob skrev:
{Quote hidden}

2007\02\25@150922 by Andy Tuthill

picon face
part 1 2692 bytes content-type:text/plain; format=flowed (decoded quoted-printable)

If you're having problems getting this to work try checking the ANSEL register.  Mulitplexing functions on pins means that many default to analog inputs despite the TRISx register and there are a few other registers which need to be changed.  This is true on just about every PIC so get used to it.

Regards,
Andy




{Quote hidden}

>

2007\02\25@161545 by blueseidboy

picon face



Andy Tuthill wrote:
{Quote hidden}

brilliant, that was the problem
so easy when you know how! :o)
--
View this message in context: www.nabble.com/real-stupid-pic16f88-problem-tf3287122.html#a9149484
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

More... (looser matching)
- Last day of these posts
- In 2007 , 2008 only
- Today
- New search...