Maker Pro
Maker Pro

PIC16F690 - RA5 digital input. Cannot change state. Even in Sim. What have'nt I done? Please?

M

Me

Jan 1, 1970
0
Hi All,
I am having a problem switching just RA5 on a 16F690. I have been going through the
docs and the net. I just can't find what it might be.
My prog worked fine until I reset the processor in the Sim and now when I setup porta
as digital input and clrf it I, get 00100000 out .
My config word is _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF &
_MCLRE_OFF & _CPD_OFF & _CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEN_OFF.
As far as I know that should do it, but it does'nt.

Any ideas welcome.

Thanks.
 
Hi All,
I am having a problem switching just RA5 on a 16F690. I have been going through the
docs and the net. I just can't find what it might be.
My prog worked fine until I reset the processor in the Sim and now when I setup porta
as digital input and clrf it I, get 00100000 out .
My config word is _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF &
_MCLRE_OFF & _CPD_OFF & _CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEN_OFF.
As far as I know that should do it, but it does'nt.

Any ideas welcome.

Thanks.

Show the code you're using for setting up TRISA.
 
R

Randy Day

Jan 1, 1970
0
Me said:
Hi All,
I am having a problem switching just RA5 on a 16F690. I have been going through the
docs and the net. I just can't find what it might be.
My prog worked fine until I reset the processor in the Sim and now when I setup porta
as digital input and clrf it I, get 00100000 out .
My config word is _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF &
_MCLRE_OFF & _CPD_OFF & _CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEN_OFF.
As far as I know that should do it, but it does'nt.


RA5 doubles as one of the external clock oscillator
pins. It's probably one of the config codes relating
to that.

Can't be much more help than that, at this point.
Lost my devel 'puter in a break-in recently. :(
 
R

Richard Seriani

Jan 1, 1970
0
Me said:
Hi All,
I am having a problem switching just RA5 on a 16F690. I have been going
through the
docs and the net. I just can't find what it might be.
My prog worked fine until I reset the processor in the Sim and now when I
setup porta
as digital input and clrf it I, get 00100000 out .
My config word is _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF &
_MCLRE_OFF & _CPD_OFF & _CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEN_OFF.
As far as I know that should do it, but it does'nt.

Any ideas welcome.

Thanks.

Since your programming was working until you reset the simulation, you may
have not cleared memory after resetting. This could result in "leftover"
information in the registers not giving you the results you were getting.
You can see if that is the case by single-stepping through the simulation
and observing the registers.

To clear memory, assuming MPLAB: pull down Debugger and Clear Memory, then
select All Memory (or do each individually). You may even want to rebuild
your program, then try re-running it.
Alternatively, get out of MPLAB and then restart.

Hope this helps.
Richard
 
Top