Searching \ for ' F872 woes still...' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/index.htm?key=f872+woes+still
Search entire site for: 'F872 woes still...'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] F872 woes still...'
2002\02\28@132217 by Pic Dude

flavicon
face
So I read up on bank selection and added it, but still can't get port A to be inputs.  Now, if I try port C as inputs, that also does not work.

This is what I have for port C...

   LIST P=16F872
   INCLUDE "p16f872.inc"
   ERRORLEVEL -224
   __CONFIG _PWRTE_ON & _RC_OSC & _WDT_OFF & _LVP_OFF

   ORG 0

   bcf STATUS,RP0    ; Bank0...
   bcf STATUS,RP1    ;    ...bank0
   clrf PORTC
   bsf STATUS,RP0    ; Bank1
   movlw 0x06
   movwf ADCON1      ; Port A all digital
   movlw 0x0F
   movwf TRISC       ; Port C -- only RC0:RC3 are inputs.

   movlw B'00000000'
   movwf ADCON0      ; Turn off A/D
   movwf TRISA       ; Port A is all outputs
   movwf TRISB       ; Port B is all outputs

loop:
   movf PORTC,0
   movwf PORTB

   goto loop

   end


Inputs are connected to pins 11,12,13,14.  LED's at all 8 RB's.

Possibilities -- I'm missing something fundamental here.
I fried the chip during one of the previous mis-configurations.  However, I tried
downloading walk.asm again and it works (though only outputs).  Is it possible
to fry only part of a PIC?

Thanks,
-Neil.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\02\28@132843 by Martin Peach

flavicon
face
You are still in bank 1 when you hit the main loop, so you end up copying
tristate registers instead of ports.
/\/\/\/*=Martin

{Original Message removed}

2002\02\28@133212 by Byron A Jeff

face picon face
On Thu, Feb 28, 2002 at 12:28:47PM -0600, Pic Dude wrote:
{Quote hidden}

Yup. You forgot to switch back to bank 0 after doing your moves to the TRIS
registers. So your loop is operating in Bank 1.

> I fried the chip during one of the previous mis-configurations.

>  However, I tried
> downloading walk.asm again and it works (though only outputs).  Is it possible
> to fry only part of a PIC?

Yes. But that isn't your problem. Bank management is a PITA with PICs. But
the bookkeeping must be done.

BAJ
>
> Thanks,
> -Neil.
>
> --
> http://www.piclist.com hint: The PICList is archived three different
> ways.  See http://www.piclist.com/#archives for details.
>

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\02\28@185026 by Pic Dude

flavicon
face
Woo-hoo!  This solved my problem.
Much thanks everyone!



----- Original Message ----- From: "Martin Peach" <spam_OUTmartinrpTakeThisOuTspamVAX2.CONCORDIA.CA>
To: <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU>
Sent: Thursday, February 28, 2002 12:27 PM
Subject: Re: F872 woes still...


{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


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