18f14k22 portb.5 always high using hserout


Results 1 to 5 of 5

Threaded View

  1. #1

    Question 18f14k22 portb.5 always high using hserout

    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.





    Code:
               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 . . . .
    Last edited by ozarkshermit; - 4th March 2015 at 18:43. Reason: wrong title

Similar Threads

  1. Problem reading 24FC1025 EEPROM with 18f14k22
    By JimAvanti in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 31st May 2013, 19:55
  2. High byte lost in HSEROUT a Word variable
    By Demon in forum General
    Replies: 2
    Last Post: - 7th October 2012, 21:30
  3. Replies: 6
    Last Post: - 12th March 2011, 13:11
  4. PortB pins will not initialize LOW, only HIGH?
    By ronbowalker in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th December 2009, 19:27
  5. 18F14k22 eTouch
    By warrier in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 28th July 2009, 05:20

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts