The following lines solved the (first) problem:
CMCON7=0
ECCP1CON=%00000000
TRISE.4=0
TRISD=%0001111
Amazing that a simple "INPUT PORTD.2" doesn't do it.
I will study the datasheet on the CMCON stuff.
thanks
The following lines solved the (first) problem:
CMCON7=0
ECCP1CON=%00000000
TRISE.4=0
TRISD=%0001111
Amazing that a simple "INPUT PORTD.2" doesn't do it.
I will study the datasheet on the CMCON stuff.
thanks
Melanie,
I followed your register tutorial and ran into the following snag:
I use HSEROUT on port C6 (the hardware Tx pin) and all works fine.
However when I issue a SEROUT2 command on that pin, the pin remains silent (no activity on that pin using the oscilloscope). The very same SEROUT2 command on port A1 gives activity on the scope screen.
I assume the same applies to the SERIN2 on port C7.
What am I missing here?
Hi,
I thought about that. I removed the hardware serial defines at the start of the program, and the problem remains.
Or is there another way to disable HW serial?
Btw I tried the same with a 16F877 and also there the same issue exists.
Try this;
You should get this;Code:DEFINE HSER_BAUD 9600 Main: HSEROUT ["HSER",13,10] PAUSE 500 SEROUT2 PORTC.6,84,["WITH RCSTA.7=1",13,10] PAUSE 500 RCSTA.7=0 SEROUT2 PORTC.6,84,["WITH RCSTA.7=0",13,10] PAUSE 500 RCSTA.7=1 GOTO Main
HSER
WITH RCSTA.7=0
HSER
WITH RCSTA.7=0
With RCSTA.7 set the USART takes over these pins.
Bookmarks