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


Closed Thread
Results 1 to 8 of 8
  1. #1

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

    Hi,

    After bootloading a 16f877a how can i get back rx(c.7) tx(c.6) to use the serin and serout in my code?
    The bootload is the Screamer-v14 .They say "...Bloader will turn off the UART (CREN = 0 and TXEN = 0) upon exiting the boot loader program. If you program uses the UART, you will need to re-initialize the UART with your own settings.... "

    How can i do this?

    Thanks for all the hellp

    byby


    my code:
    Attached Files Attached Files

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by camolas View Post
    After bootloading a 16f877a how can i get back rx(c.7) tx(c.6) to use the serin and serout in my code?
    The bootload is the Screamer-v14 .They say "...Bloader will turn off the UART (CREN = 0 and TXEN = 0) upon exiting the boot loader program. If you program uses the UART, you will need to re-initialize the UART with your own settings.... "
    How can i do this?
    Thanks for all the hellp
    If the bootloader gives you control of the PIC, then you have control of the pins...case closed. Turn off the serial module and set up the pins as you see fit...case closed...
    Unless of course, the bootloader circuitry is holding the pins at a certain logic level and won't release them.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Thanks for the reply, did you see my code? i do not now how can i do that can you or other person onder my code explain how i can do it?

    Thanks to all

    by by

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by camolas View Post
    Hi,
    Thanks for the reply, did you see my code? i do not now how can i do that can you or other person onder my code explain how i can do it?
    Thanks to all
    by by
    You mean the code attached to post #1? Nope, didn't see it...

    Of course I saw it!
    Re-Read post #2.
    I don't know what your problem is. Seems to me like anybody else would be able to manipulate those pins as they see fit...if the hardware allows it...

  5. #5
    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.

  6. #6


    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

  7. #7
    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.

  8. #8


    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