PDA

View Full Version : 16F913 RA7 Pin control problem



Wayne
- 26th January 2006, 20:52
I am having a problem making RA7 an I/O and making it go low.

ANSEL = 0
CMCON0 = $07
INTOSCIO set in the 16F913.inc file which will give me general I/O on RA6 and RA7

LOW PORTA.7 'should set pin RA7 to output and low. (not working)

looking at the data sheet @ TABLE 3-1 page 40
SUMMARY OF REGISTERS ASSOCIATED WITH PORTA
the only registers used by RA7 are :
TRISA7
LCDEN
LCDSE0
LCDSE1

Anyone have any ideas

Thanks Wayne

mister_e
- 27th January 2006, 03:50
Is the INTRC is also set when you import your program in the programmer software too?

Is a simple blink elsewhere work?

Wayne
- 28th January 2006, 00:35
Hi Mr. E

I have setup the program in the MPLAB Sim and this is what happens.
I set the config bits to use INTOSCIO in MPLAB.
then compile and run in the sim.
TRISA.6 and TRISA.7 read as "1"
after TRISA.7 = 0
LOW PORTA.7 the port reads "0" but it is in tristate ( on the PCB)
there is a 20K res to vcc going to RA7 always high.
when I write a "0" to PORTA.7
It looks like the 16F913 thinks it is in one of the external modes.
But with no xtal on the PCB how could it run.
All other functions of the program work.
I changed the program to use RB6 and it works, but I need RB6 for other things.


The line below is from the data sheet.
Note: TRISA<7:6> always reads ‘1’ in XT, HS and LP OSC modes.
But it is in INTOSCIO mode

Thanks
Wayne

modifyit
- 8th February 2007, 01:53
Wayne,

Did you happen to find the solution to this issue? I am trying to do the same thing on a 16F690 and porta.4 is not controllable. It just sits there oscillating up and down when I try to set it as an output.

I can control any other pin on portA, just not RA4.