ozarkshermit
- 4th March 2015, 18:26
Oops - - Should be 18f14k22
Hi
I cannot figure out why, when using HSEROUT, on PORTB.7, PORTB.5 is high
no matter what I try.
Making PORTB = 0 on the first line has no effect either
Actually, when bit 5 on TRISB is set to an input, the port is not
always high then - - that makes sense. Problem is, I need it as an output.
I need to use HSEROUT for my Serial LCD, since I am using interrupts,
and the data is corrupted otherwise.
I am using PBP 2.60A
The manual states on page 93 that "On devices with two serial ports,
HSEROUT will only use the first port."
My circuit board is etched, assembled, and everything works, but I need
to use PORTB.5 as another output.
Here is a simple program to show the problem. When the HSEROUT line
is enabled, PORTB.5 is always high.
If the HSEROUT line is commented out, PORTB.5 works just fine.
DEFINE OSC 16
OSCCON = %11110110 ' 16 MHZ INTERNAL OSCILLATOR
TRISB = %00000000
DEFINE HSER_BAUD 9600 ' FOR 4 LINE BY 20 CHARACTER LCD
' USES PORTB.7 - - DEDICATED HARDWARE SERIAL PORT
DEFINE HSER_TXSTA 20H
HERE:
PAUSE 100
HSEROUT [254,128,"TEST TEST"]
GOTO HERE
''''''''''Cant get much simpler than this . . . .
Hi
I cannot figure out why, when using HSEROUT, on PORTB.7, PORTB.5 is high
no matter what I try.
Making PORTB = 0 on the first line has no effect either
Actually, when bit 5 on TRISB is set to an input, the port is not
always high then - - that makes sense. Problem is, I need it as an output.
I need to use HSEROUT for my Serial LCD, since I am using interrupts,
and the data is corrupted otherwise.
I am using PBP 2.60A
The manual states on page 93 that "On devices with two serial ports,
HSEROUT will only use the first port."
My circuit board is etched, assembled, and everything works, but I need
to use PORTB.5 as another output.
Here is a simple program to show the problem. When the HSEROUT line
is enabled, PORTB.5 is always high.
If the HSEROUT line is commented out, PORTB.5 works just fine.
DEFINE OSC 16
OSCCON = %11110110 ' 16 MHZ INTERNAL OSCILLATOR
TRISB = %00000000
DEFINE HSER_BAUD 9600 ' FOR 4 LINE BY 20 CHARACTER LCD
' USES PORTB.7 - - DEDICATED HARDWARE SERIAL PORT
DEFINE HSER_TXSTA 20H
HERE:
PAUSE 100
HSEROUT [254,128,"TEST TEST"]
GOTO HERE
''''''''''Cant get much simpler than this . . . .