Article View: be.science.electronics
Article #964Re: HELP with PIC16F628 programming problem
From: The Butcher
Date: Sun, 27 Apr 2003 21:16
Date: Sun, 27 Apr 2003 21:16
45 lines
3063 bytes
3063 bytes
> Hello everybody,
> I want to use the complete portA of a PIC16f628 as 8 bit input/output (I
can
> not use the portB because I will need the usart function which is on the
> portB). For the moment, I'm trying to make the 8 pins blinking. Each of
them
> are working except the RA4 and the RA5.
> Is there something special I have to add to my code? Also I am not sure to
> have correctly configure the configuration byte in order to use the
RA5/MCLR
> pin as RA5.
> Does somebody have any advice to solve that?
> Thanks in advance, Georges
>
Hello,
You can solve the ra4 problem by turning off the comparators port Ra4. You
can do this by following code I written (microchip assembler).
Note that Ra4 is an open collector output. Use the port as in the example:
Vdd -------------
|
Resistor
|
Led
Ra4 |
*------------
initport bsf status,RP0 ;Select bank 1
movlw b'11001111' ;Make Ra4,ra5 outputs
movwf TRISA
bcf status,RP0 ;Select bank 0
movlw b'00000111' ;Turn comparators off
movwf CMCON
For your problem with Ra5 you should clear Bit 5 in the configuration word
you can do this in your programming software. And clearing also the bit 5 of
the trisA register.
Grtz The Butcher
You need info about the Phillips RC5 code : 1 link
http://users.pandora.be/davshomepage
!!! Remove f*ckspam in email addressl.
Technical Details
Message-ID:
<3NXqa.4191$5Y6.727321699@hestia.telenet-ops.be>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!ossa.telenet-ops.be!hestia.telenet-ops.be.POSTED!not-for-mailReferences:
<3eac0686$0$23142$ba620e4c@reader0.news.skynet.be>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 112d1e,46021642f70d3b0d X-Google-Attributes: gid112d1e,public X-Google-Thread: f849b,46021642f70d3b0d X-Google-Attributes: gidf849b,public X-Google-Thread: 111d0a,46021642f70d3b0d X-Google-Attributes: gid111d0a,public X-Google-Thread: ff242,46021642f70d3b0d X-Google-Attributes: gidff242,public X-Google-ArrivalTime: 2003-04-27 14:21:56 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!ossa.telenet-ops.be!hestia.telenet-ops.be.POSTED!not-for-mail From: "The Butcher" <thebutcher1f*ckspam@pandora.be> Newsgroups: be.science.electronics,comp.arch.embedded,sci.electronics.basics,sci.electronics.design References: <3eac0686$0$23142$ba620e4c@reader0.news.skynet.be> Subject: Re: HELP with PIC16F628 programming problem Lines: 47 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: <3NXqa.4191$5Y6.727321699@hestia.telenet-ops.be> Date: Sun, 27 Apr 2003 21:16:47 GMT NNTP-Posting-Host: 81.82.29.96 X-Complaints-To: abuse@telenet.be X-Trace: hestia.telenet-ops.be 1051478207 81.82.29.96 (Sun, 27 Apr 2003 23:16:47 CEST) NNTP-Posting-Date: Sun, 27 Apr 2003 23:16:47 CEST Organization: Telenet Internet