PIC 18f4680 DIGITAL INPUTS


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Posts
    8


    Did you find this post helpful? Yes | No

    Default HSEROUT vs SEROUT2

    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?

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by MadAl View Post
    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?
    If the port is still set up to use the hardware serial port, SERIN/SEROUT won't work. The port has to be set up for normal, general purpose I/O to work with SERIN/SEROUT.

  3. #3
    Join Date
    Mar 2008
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    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.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Try 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
    You should get this;

    HSER
    WITH RCSTA.7=0
    HSER
    WITH RCSTA.7=0

    With RCSTA.7 set the USART takes over these pins.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Mar 2008
    Posts
    8


    Did you find this post helpful? Yes | No

    Smile

    Excellent, will try that.
    I'm convinced it'll work.
    thanks

Similar Threads

  1. Setting up digital inputs
    By quester in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd March 2008, 22:14
  2. Pic driven digital audio delay
    By skimask in forum Off Topic
    Replies: 12
    Last Post: - 19th April 2007, 20:42
  3. inputs on 12F675 (or for that matter any PIC)
    By muddy0409 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th April 2007, 19:43
  4. Using portb as inputs PIC goes crazy
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th November 2005, 14:15
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 0

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