Searching \ for '[PIC] PIC16F877A PortD ?' 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/ios.htm?key=port
Search entire site for: 'PIC16F877A PortD ?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] PIC16F877A PortD ?'
2006\04\18@122124 by Bob Axtell

face picon face
This is embarassing. I have used this part in the past and
never had a problem with portD, but I have 4 PCBs showing
that PortD, with pins set as inputs, never seems to pass data
into w. I know that portD uses the "Parallel Port" feature, but
I think I have turned it off.

I guess I am missing something. . Any ideas?

--Bob

2006\04\18@123022 by Mike Hord

picon face
Are there analog input options on those pins?  I think I
remember some parts having analog on PORTD, but that
could just be my imagination...

Mike H.

On 4/18/06, Bob Axtell <spam_OUTengineerTakeThisOuTspamcotse.net> wrote:
> This is embarassing. I have used this part in the past and
> never had a problem with portD, but I have 4 PCBs showing
> that PortD, with pins set as inputs, never seems to pass data
> into w. I know that portD uses the "Parallel Port" feature, but
> I think I have turned it off.
>
> I guess I am missing something. . Any ideas?
>
> --Bob
> -

2006\04\18@124310 by Steve Smith

flavicon
face
This setup uses portd as a bi-directional 8 bit bus check it against your
initialisation I know it works (in my app)the A-D is set for part and part
but port D is all digital

Rgds
Steve
;----------------------- INITALISATION
ROUTIENE-------------------------------
       bcf                STATUS,RP0                ; first do page 0 stuff.
yep, page 0
       Gie_off                                                        ; turn off
int and test its off
       clrf                STATUS                ; force bank zero
       clrf                INTCON                ; disable ints ect
       clrf                PIR1                        ; clear all flag bits
PORT_SETUP
       clrf                PORTA
       clrf                PORTB
       movlw                b'00100000'                ; OE off on outputs

       movwf                PORTC
       clrf                PORTD
       clrf                PORTE                
       BANK1
       movlw                b'00111111'                ; IO for port
       movwf                TRISA
       movlw                b'11111111'
       movwf                TRISB
       movlw                b'11011000'
       movwf                TRISC
       movlw                b'11111111'
       movfw                TRISD
       clrf                TRISE                        
WDT_SETUP
       movlw          B'00001111'            ; SET WDT TIMER TIMEOUT
PULLUP Off
       movwf          OPTION_REG      
ADCON_SETUP
       movlw                B'11000011'                ; LITERAL FOR ADCON1
     movwf                ADCON1                  ; LOAD ADCON1
INT_SETUP
       movlw                B'01000001'                ; SET UP TMR1 FOR OVERFLOW
and ADIE
       movwf                PIE1
   BANK0                                        ; RETURN TO BANK_0
       movlw          B'11000000'            ; INTERRUPT CONTROL ENABLE GIE AND
PIE1
       movwf                INTCON                ; ENABLE INT'S


{Original Message removed}

2006\04\18@131840 by Bob Axtell

face picon face
No, I have ADCON1 set properly...

Mike Hord wrote:
> Are there analog input options on those pins?  I think I
> remember some parts having analog on PORTD, but that
> could just be my imagination...
>
> Mike H.
>
> On 4/18/06, Bob Axtell <.....engineerKILLspamspam@spam@cotse.net> wrote:
>  
>> This is embarassing. I have used this part in the past and
>> never had a problem with portD, but I have 4 PCBs showing
>> that PortD, with pins set as inputs, never seems to pass data
>> into w. I know that portD uses the "Parallel Port" feature, but
>> I think I have turned it off.
>>
>> I guess I am missing something. . Any ideas?
>>
>> --Bob
>> --

2006\04\18@132632 by Bob Axtell

face picon face
Do I need a movfw TRISD ? I have a MOVWF TRISD, course it isn't working..
- - -

BTW, ICD2 is showing TRISD as having a value of 00, whereas I loaded it
with 0F.. go figure.
LOOKS like I am overwriting it someplace.

--Bob

Steve Smith wrote:
{Quote hidden}

> {Original Message removed}

2006\04\18@134200 by Paul James E.

picon face

you have to set RP0 bit in the STATUS register to write to the TRISD
register.   then reset it wheen youre done.

                                           regards,

                                             jim




{Quote hidden}

>> {Original Message removed}

2006\04\18@140022 by Bob Axtell

face picon face
Thanks steve. Exactly like  mine.

--Bob

Steve Smith wrote:
{Quote hidden}

> {Original Message removed}

2006\04\18@142752 by Bob Axtell

face picon face
Its fixed, I was overwriting it in a routine via indirect.

--Bob

Paul James E. wrote:
{Quote hidden}

>>> {Original Message removed}

2006\04\18@174333 by Steve Smith

flavicon
face
Typo copied and bastardised should be movwf..
Are you in the correct bank??

Steve

-----Original Message-----
From: piclist-bouncesspamKILLspammit.edu [.....piclist-bouncesKILLspamspam.....mit.edu] On Behalf Of
Bob Axtell
Sent: 18 April 2006 18:26
To: Microcontroller discussion list - Public.
Subject: Re: [PIC] PIC16F877A PortD ?

Do I need a movfw TRISD ? I have a MOVWF TRISD, course it isn't working..
- - -

BTW, ICD2 is showing TRISD as having a value of 00, whereas I loaded it
with 0F.. go figure.
LOOKS like I am overwriting it someplace.

--Bob

Steve Smith wrote:
{Quote hidden}

Of
{Quote hidden}

>> --

2006\04\18@175648 by Bob Axtell

face picon face
Steve Smith wrote:
> Typo copied and bastardised should be movwf..
> Are you in the correct bank??
>  
Yes, I found the problem. My code was overwriting TRISD using indirect
means.
I'm embarrassed. Pretty simple error to make....

--Bob

> Steve
>
> {Original Message removed}

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