CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

RC7 on PIC16F876(A)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
iw2nzm
Guest







RC7 on PIC16F876(A)
PostPosted: Sat Dec 30, 2006 4:36 pm     Reply with quote

Hi to all,

I can't use the RC7 pin as output. I know it's multiplexed with serial RX but when the SPEN is 0 it should work as output.

Here is the code:

Code:

#include <16f876a.h>
#fuses HS, NOWDT, PUT,NOPROTECT,BROWNOUT,NOLVP,NOCPD,NOWRT,NODEBUG
#use delay(clock = 16000000, RESTART_WDT)
#use fast_io(c)
#byte  rcsta = 0x18

void main() {
set_tris_c(0x00);
rcsta = 0x00;

output_high(PIN_C7);
for (;;) {}


There is no hardware connected to the PIC. Other pins works fine and the oscillator runs.

May anyone help me?

Marco / iw2nzm
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Dec 31, 2006 1:47 am     Reply with quote

Normally the Rx pin on the PIC is connected to the output of a
MAX232-type chip. The output of the MAX232's receive section
may conflict with the using pin C7 as an output.
What external circuit or chip is connected to pin C7 ?

Also, did you post your complete test program ? It's missing the
closing brace of main(). Is there more ? Is there a #use rs232()
statement in your program ?

What is your compiler version ?
Guest








PostPosted: Sun Dec 31, 2006 2:33 am     Reply with quote

PCM programmer wrote:
Normally the Rx pin on the PIC is connected to the output of a
MAX232-type chip. The output of the MAX232's receive section
may conflict with the using pin C7 as an output.
What external circuit or chip is connected to pin C7 ?

Also, did you post your complete test program ? It's missing the
closing brace of main(). Is there more ? Is there a #use rs232()
statement in your program ?

What is your compiler version ?


Hi,

I forgot the closing brace when I did copy&paste. There are no other code and on the board there are only the PIC, the oscillator section (16 MHz crystal and two 22pF capacitor) and a 100 nF bypass capacitor on power supply.

I don't need any serial communication, just digital output on Port C.
My compiler version is: 3.6.0.99

I wish you a happy new year Smile

Marco / iw2nzm
iw2nzm
Guest







PostPosted: Sun Dec 31, 2006 2:49 am     Reply with quote

I solved! There was a short on the board Evil or Very Mad

I'm sorry for the useless thread Embarassed

However, thanks for the support

Marco / iw2nzm
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group