After bootloading a 16f877a how can i get back rx tx ?


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Once you enable the USART, like the Bootloader do, you can't use RX/TX pin with serout. Use HSEROUT instead... OR get rid of all DEFINES, and disable SPEN bit....

    Your program shouldn't finish like that... use STOP of do a loop.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Hi ive used HSEROUT in my code but dont work, im new at this for other person my be very simple but not for

    Please can you explain me in a beginer mode?

    Is how i used the HSEROUT


    Code:

    DEFINE LOADER_USED 1
    @ device hs_osc
    define osc 20
    Include "modedefs.bas" ' Include serial modes

    DEFINE HSER_BAUD 9600 'Hser baud rate
    DEFINE HSER_SPBRG 129 'Hser spbrg init
    DEFINE HSER_RCSTA 90h 'Hser receive status init
    DEFINE HSER_TXSTA 24h 'Hser transmit status init
    DEFINE HSER_CLROERR 1

    TrisB.5=0
    TrisC.6=0
    TrisC.7=1
    B0 var byte

    High portb.5
    Pause 500
    Low portb.5
    Pause 500
    High portb.5
    Pause 500
    Low portb.5
    Pause 500




    serout2 portc.6, 32, ["AT", 13]
    serout2 portc.6, 84, ["AT+CMGF=1", 13]
    serout2 portc.6, 84, ["AT+CSCA=+351xxxxx000", 13]
    serout2 portc.6, 84, ["AT+CSCA=+3xxxxxxxxx0", 13]
    serout2 portc.6, 84, ["ola", 13]
    end



    Thanks,


    By By

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Code:
            DEFINE LOADER_USED 1
            define OSC 20     ' Check the spelling of OSC, must be in capital letter
            
            Include "modedefs.bas" ' Include serial modes
            
            DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
            DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
            DEFINE HSER_SPBRG 129 ' 9600 Baud @ 20MHz, 0.16%
            DEFINE HSER_CLROERR 1 ' Clear overflow automatically
            
            TrisB.5=0
            TrisC.6=0
            TrisC.7=1
            B0 var byte
            
            High portb.5
            Pause 500
            Low portb.5
            Pause 500
            High portb.5
            Pause 500
            Low portb.5
            Pause 500
            
            HSEROUT ["AT", 13]
            HSEROUT ["AT+CMGF=1", 13]
            HSEROUT ["AT+CSCA=+351xxxxx000", 13]
            HSEROUT ["AT+CSCA=+3xxxxxxxxx0", 13]
            HSEROUT ["ola", 13]
            STOP
            end
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Steve it works very well, thanks a lot for the patience to teach a beginer like me.I will learn this one more lesson.
    Sory abouht the box of the code next time i will put it there.

    p.s. If you need same thing from Portugal let me now.

    By BY

Similar Threads

  1. Replies: 67
    Last Post: - 8th December 2009, 02:27
  2. RX TX modules - intermitent communication
    By ruijc in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 11th June 2009, 00:13
  3. RX - TX timming
    By ruijc in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th February 2009, 00:06
  4. TX RX Buffer Question
    By shawn in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th January 2005, 01:49
  5. Tx and Rx of Single Pin PIC's
    By Dwayne in forum Code Examples
    Replies: 0
    Last Post: - 26th May 2004, 14:55

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