Searching \ for '[PIC:] Trouble with GP3 on 12F675' 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=pic
Search entire site for: 'Trouble with GP3 on 12F675'.

Exact match. Not showing close matches.
PICList Thread
'[PIC:] Trouble with GP3 on 12F675'
2005\08\03@031016 by laura capaldi

picon face
I've been struggling to figure out why I can set GP1, GP2, GP4 and GP5 without trouble but I can't get GP3 to set. Set meaning I can't get it to go high and turn on an LED. I'm using a 12F675. I suspect it has something to do with my config bits because MCLR is on GP3. Here's the simple program I wrote. I'm hoping someone can help me spot my bug. Thanks.

; test1
list      p=12F675      
#include <p12f675.inc>
__CONFIG  _CP_OFF & _WDT_OFF & _BODEN_ON & _PWRTE_ON & _INTRC_OSC_NOCLKOUT & _MCLRE_OFF & _CPD_OFF
#define Bank0  0x00
#define Bank1  0x80
cblock 0x20
ncount
mcount
ocount
endc
ORG     0x000
nop  
goto    Init          
ORG 0x004
return  
Init
banksel Bank1  
movwf   OSCCAL
movlw B'00000001' ; set direction so all pins except GP0 are output pins
movwf TRISIO  ; so GP0 is input pin
movlw b'00010001'
movwf ANSEL  ; make GP0 (AN0) be analog input and Fosc/8 for A/D conversion clock
banksel Bank0
movlw b'111'
movwf CMCON  ; disable comparator
movlw b'00000001' ;  
movwf ADCON0   ; Select AN0 as a2d channel, Left justified & enables A/D
NOP      ; Give 4 uS delay before starting A/D
NOP
NOP
NOP
bsf ADCON0,GO   ; Start A/D
Main
call NOon
call delay
call GP1on
call delay
call NOon
call delay
call GP2on
call delay
call NOon
call delay
call GP3on
call delay
call NOon
call delay
call GP4on
call delay
call NOon
call delay
call GP5on
call delay
goto Main
NOon
movlw b'00000000'
movwf GPIO
return

GP1on
movlw b'00000010'
movwf GPIO
return
GP2on
movlw b'00000100'
movwf GPIO
return
GP3on
movlw b'00001000'
movwf GPIO
return
GP4on
movlw b'00010000'
movwf GPIO
return
GP5on
movlw b'00100000'
movwf GPIO
return
delay
movlw 0x10
movwf mcount
loadn
movlw 0xFF
movwf ncount
loado
movlw 0xFF
movwf ocount
repeat
decfsz ocount,f
goto repeat
decfsz ncount,f
goto loado
decfsz mcount,f
goto loadn
return

END  

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

2005\08\03@031657 by Michael Rigby-Jones

picon face


>-----Original Message-----
>From: spam_OUTpiclist-bouncesTakeThisOuTspammit.edu [.....piclist-bouncesKILLspamspam@spam@mit.edu]
>Sent: 03 August 2005 08:10
>To: piclistspamKILLspammit.edu
>Subject: [PIC:] Trouble with GP3 on 12F675
>
>
>I've been struggling to figure out why I can set GP1, GP2, GP4
>and GP5 without trouble but I can't get GP3 to set. Set
>meaning I can't get it to go high and turn on an LED. I'm
>using a 12F675. I suspect it has something to do with my
>config bits because MCLR is on GP3. Here's the simple program
>I wrote. I'm hoping someone can help me spot my bug. Thanks.

The bug is that you didn't read page 22 of the datasheet!  GP3 is an input pin only.

Regards

Mike

=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================

2005\08\03@033241 by Dmitriy Kiryashov

picon face
I suspect that is input only type of pin.
You still can try manipulate it by switching
pull ups on and off.



laura capaldi wrote:
{Quote hidden}

> -

2005\08\03@040258 by Chen Xiao Fan

face
flavicon
face
This behavior is common to the PICs with both internal RC
oscillator and internal MCLR pin options. In this case, the
MCLR pin can be an input only pin if internal MCLR option is
used, but not an ouput pin.

Examples:  10F20x, 12F508/509, 16F505, 12F629/675/683/635,
          16F630/676/684/688/636, 16F631/677/685/687/689/785,
          PIC16F91x, etc

Recently Microchip is more careful about the description of
the I/O pins. For example, in the PIC16F785 datasheet, it is
written in Page 1 that it has "17 I/O pins and 1 input-only pin".

Regards,
Xiaofan

----------------------------------------------
Xiaofan Chen
R&D Engineer, Photoelectric Sensor Development
Pepperl+Fuchs Singapore
http://www.pepperl-fuchs.com
Signals for the world of automation
--------------------------------------------

{Original Message removed}

2005\08\03@061607 by Vasile Surducan
face picon face
On 8/3/05, Dmitriy Kiryashov <.....vze27bymKILLspamspam.....verizon.net> wrote:
> I suspect that is input only type of pin.
> You still can try manipulate it by switching
> pull ups on and off.

 Nice !

Vasile


{Quote hidden}

2005\08\03@073411 by Jinx

face picon face

> How can you do this?
> Datasheet says, that ALL inputs have pull ups except GPIO3?!?!?
> Any tricks?

Same as RA4 (or I2C "drive") on other PICs. External pull-up

2005\08\03@082657 by Michael Rigby-Jones

picon face


>> How can you do this?
>> Datasheet says, that ALL inputs have pull ups except GPIO3?!?!?
>> Any tricks?

>{Original Message removed}

2005\08\03@085308 by Michael Hagen

flavicon
face
GP3 may be input ONLY!  It just can't be an output.
Read the GPIO pin descriptions carefully.  I have done exactly the same
thing.

{Original Message removed}

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