• AVR Freaks

Helpful ReplyHot!PIC16F19176 RC6 pin is always high

Author
Idodio
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2020/09/16 04:53:25
  • Location: 0
  • Status: offline
2020/09/23 06:49:34 (permalink)
0

PIC16F19176 RC6 pin is always high

Hello,
I sometimes need to have the RC6 pin be '0' (an hardware requirement), but I am failing to do so.
I believe it's because it is configured as TX.
I want to use RB6 as my TX by using PPS and be able to change RC6 pin from high to low and vice versa.
 
BAUDCON = 0b00001000; // ABDOVF, RCIDL, 0, SCKP, BRG16=1, 0, WUE, ABDEN
TX1STA = 0b00100100; // CSRC=0, TX9=0, TXEN=1, SYNC=0, SENDB=0, BRGH=1, TRMT=0, TX9D=0
RC1STA = 0b10010000; // SPEN=1, RX9=0, SREN=0, CREN=1, ADDEN=0, FERR=0, OERR=0, RX9d=0

 
RB6PPS = 0x0D;
LATCbits.LATC6 = 0;

#1
ric
Super Member
  • Total Posts : 28660
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: PIC16F19176 RC6 pin is always high 2020/09/23 18:54:28 (permalink) ☄ Helpfulby Idodio 2020/09/24 08:08:55
+1 (1)
Idodio
I believe it's because it is configured as TX.

You are wrong.
The default assignment is only as an INPUT (which only has meaning in synchronous mode)
So, you are barking up the wrong tree.
Does your code write anything to RC6PPS?
(It should be left as zero).
That pin is also multiplexed with some LCD functions. I assume you have not enabled the LCD.
It's hard to guess what else could be wrong without seeing all your code.
 
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#2
Idodio
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2020/09/16 04:53:25
  • Location: 0
  • Status: offline
Re: PIC16F19176 RC6 pin is always high 2020/09/24 08:19:28 (permalink)
0
Thanks for the help, I did configure RC6PPS as TX at one point and afterwards set it back at 0, after removing the first part it was fixed.
Is there a way for me to configure RC6 as TX only when I want to transmit data and have the pin low the rest of the time?
#3
Jerry Messina
Super Member
  • Total Posts : 554
  • Reward points : 0
  • Joined: 2003/11/07 12:35:12
  • Status: offline
Re: PIC16F19176 RC6 pin is always high 2020/09/24 08:46:24 (permalink)
+1 (1)
RC6 as TX only when I want to transmit data and have the pin low the rest of the time?

I've never tried this, but what happens if you flip the state of BAUDCON.SCKP?
 
Normally, with SCKP=0 the TX output idles HIGH, and setting SCKP=1 changes it to idle LOW.
The only thing is I don't know if that changes the pin state immediately or if you have to enable/disable the uart for it to take effect.
 
I also don't know how the device you're hooking this up to is going to react since seeing TX=0 is going to look like a serial BREAK condition all the time.
 
 
#4
ric
Super Member
  • Total Posts : 28660
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: PIC16F19176 RC6 pin is always high 2020/09/24 13:06:03 (permalink)
+1 (1)
Idodio
Is there a way for me to configure RC6 as TX only when I want to transmit data and have the pin low the rest of the time?

Setting the PPS value to zero should revert the pin back to control by the LATC register.
Jerry Messina
...
I also don't know how the device you're hooking this up to is going to react since seeing TX=0 is going to look like a serial BREAK condition all the time.

I can take a guess.
The TX pin may be driving a cheap 433 MHz transmitter.
Those devices transmit when the Tx pin is high, and stop transmitting when it is low.
If you let TX idle high, it will use lots of power, and probably stop most car remote door locks in a 100 metre radius from working...
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#5
Jump to:
© 2020 APG vNext Commercial Version 4.5