PDA

View Full Version : 16F819 PortA as Outputs



oswaldus
- 11th August 2010, 14:25
Please Somebody help me!
I need to know:
How to set PORTA.6 and PORTA.7 as outputs in PIC 16F819?
Thanks in advance
Oswaldus

Kamikaze47
- 11th August 2010, 15:56
PORTA.6 and PORTA.7 on the 16F819 are the oscillator pins. I assume therefore that you are using the internal oscillator. If so, you need to make sure the config bits for the oscillator are set to _INTRC_IO (assuming you are using PMASM as your assembler).

oswaldus
- 11th August 2010, 16:52
Greetings Kamikaze47,

Thanks for your reply

Yes I am using internal oscillator.

I don't know How set config bits in _INTRC_IO, Can you let me know, How I make this from PicBasic Pro?

Thanks in advance
Oswaldus

mackrackit
- 11th August 2010, 17:01
http://www.picbasic.co.uk/forum/content.php?r=157-Presetting-Configuration-Fuses-(PIC-Defines)-into-your-Program

Kamikaze47
- 11th August 2010, 17:49
http://www.picbasic.co.uk/forum/content.php?r=157-Presetting-Configuration-Fuses-(PIC-Defines)-into-your-Program

You beat me to it mackrackit. My response was going to be identical :)

oswaldus
- 11th August 2010, 18:37
OK,
I aded @ __config _INTRC_OSC_NOCLKOUT to set the PIC for Internal Oscillator allowing
use of the OSC pins as I/O, but when I compile, the error 44 : symbol not previously defined
appear.

Any suggestion?

thanks,
Oswaldus

mackrackit
- 11th August 2010, 18:49
Try
_INTRC_IO

oswaldus
- 11th August 2010, 19:00
mackrackit,

I Try _INTRC_IO, but I have now: Error 118 Overwriting previous address contents (2007)

thanks,
oswaldus

mackrackit
- 11th August 2010, 19:06
That sounds like you did not comment out the config lines in the chips inc file as described in the link.

Or you could just modify the inc file and not set the config in code space.

oswaldus
- 12th August 2010, 17:19
I comment out the config lines in the chips inc file as described in the link, and Port A works fine.

Thanks for your help, Kamikaze47 and mackrackit

Best regards,
oswaldus