Serout/Serout2 on pin RC6


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170

    Default

    Yes. This is the problem. When there is a Hserout command inside the program (no matter where, even at the end), the TX pin is engaged by the UART and cannot be controlled.

    Now I have to find out how to release it from the UART control.

    TXSTA=2 and RCSTA=0 did not help.

    What I really want to do is to emulate a 1200 baud trasnmission of one zero (0), like this:

    LOW PORTC.6
    PAUSEUS 7500
    HIGH PORTC.6

    That way there is no need to deal with BAUD rate change. If it only worked...

    Ioannis
    Last edited by Ioannis; - 11th December 2008 at 13:57.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Maybe
    Code:
    TXSTA = %00000000
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170

    Default

    It really does not make any difference. I tried that too.

    Ioannis

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166

    Default

    Ioannis, Obviously none of you are reading the data sheets for the processors you are trying to program... Set RCSTA.7 to 0 and the port is all yours...

    Dave Purola,
    N8NTA

  5. #5
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by Dave View Post
    Ioannis, Obviously none of you are reading the data sheets for the processors you are trying to program... Set RCSTA.7 to 0 and the port is all yours...
    Dave Purola,
    N8NTA
    Or are they?
    Post #6 above...
    TXSTA=2 and RCSTA=0 did not help.

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170

    Default

    Thanks all. It is weird that it will not work setting the SPEN to 0. I did try it and did not get any positive result. If anyone can try it on its own I'd be obliged.

    Ioannis

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Quote Originally Posted by Dave View Post
    Ioannis, Obviously none of you are reading the data sheets for the processors you are trying to program... Set RCSTA.7 to 0 and the port is all yours...
    What!!! Read the data sheet!!! That is just asking tooo much

    Anywho, that is why I suggested
    TXSTA = %00000000

    being we are dealing with the transmit part/pin..

    bit 5 is all that, I thought, needed set to zero.

    Ioannis,
    When I get home this weekend I am going to play with this.
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170

    Default

    Thanks Dave. It is not in TXSTA but in RCSTA, bit 7 where the UART is enabled/disaled. But as I stated before, once it is enebled and there are even 1 Hserout command somewhere in the program, I cannot gain control of the port pin. May be I got a defective chip, maybe there is a ghost around. I cannot explain it.

    Before posting usually the manual/data sheet is really dusted good. In vein...

    I will try tomorrow with different system (MCU/PC/Programs).

    Ioannis

  9. #9
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170

    Default

    I am a little embarrased. I feel like Goofy. Anyway. The problem was the Decimal/Hexadeciml numbers I got confussed.

    Mister-e has involved to this! His utility shows the numbers in Decimal, while the copy variables has a mix of decimal/hex numbers.

    All is working OK now. Sorry for the lost time.

    Ioannis

    P.S. I Attache the test code for On the fly Baud Rate changing.
    Attached Files Attached Files

Similar Threads

  1. Is this a K Type sensor?
    By jessey in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 21st November 2009, 13:55
  2. DS1820 with 16f688
    By jessey in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 23rd May 2009, 05:07
  3. Serout/Serout2 and PIC18F97J60 (100 pin)
    By mikebar in forum Serial
    Replies: 10
    Last Post: - 20th May 2008, 04:16
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 17:07

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