Thread View: be.science.electronics
3 messages
3 total messages
Started by Georges Konstantinidis
Sun, 27 Apr 2003 16:46
HELP with PIC16F628 programming problem
Author: Georges Konstantinidis
Date: Sun, 27 Apr 2003 16:46
Date: Sun, 27 Apr 2003 16:46
10 lines
1743 bytes
1743 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
Re: HELP with PIC16F628 programming problem
Author: 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.
Re: HELP with PIC16F628 programming problem
Author: Georges Konstantinidis
Date: Thu, 01 May 2003 18:57
Date: Thu, 01 May 2003 18:57
54 lines
3288 bytes
3288 bytes
Thanks for the info "The Butcher" <thebutcher1f*ckspam@pandora.be> a οΏ½crit dans le message de news:3NXqa.4191$5Y6.727321699@hestia.telenet-ops.be... > > > 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. > >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads