Can I use HSERIN/HSEROUT to talk to a PC and the MicroCode Loader bootloader?


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    96

    Default Can I use HSERIN/HSEROUT to talk to a PC and the MicroCode Loader bootloader?

    I've been trying to get my 877a to talk to the PC using a code snippet I found on this site from Mister_E. I am using MicroCode Studio Plus 2.46 and MicroLoader. Do I need to use software serial communications instead of hardware when using the bootloader?

    Here is the code from Mister E I have been messing with:

    ' Serial data echo test
    ' =====================
    '
    ' File name : Serial_echo_test.bas
    ' Company : Mister E
    ' Programmer : Steve Monfette
    ' Date : 16/01/2005
    ' Device : PIC16F877

    ' PIC setting & Programming mode
    ' -------------------------------
    '
    ;@ __config _HS_OSC & _WDT_ON & _PWRTE_ON & _BODEN_ON & _LVP_OFF
    ' HS(20Mhz) oscillator
    ' Enable watch dog timer
    ' Enable power up timer
    ' Enable brown out detect
    ' Disable low voltage programming
    DEFINE OSC 20 ' Use 20 MHZ oscillator

    ' Usart Settings
    ' --------------
    '
    ' refer to datasheet section 10 for the following settings
    '
    DEFINE HSER_RCSTA 90h ' Enable Serial PORT
    ' Enable continuous receive
    '
    DEFINE HSER_TXSTA 24h ' Enable transmit
    ' High baud rate (BRGH=1)
    '
    DEFINE HSER_SPBRG 129 ' set USART to 9600 baud (when BRGH=1)
    DEFINE HSER_CLROERR 1 ' Enable automatic overrun error

    ' Variable Definition
    ' -------------------
    SerData var byte
    testvar var byte

    Start:
    ' Program begining/Main Loop
    ' ==========================
    '
    HSERIN [serdata]
    hserout [serdata]
    goto start

  2. #2
    Join Date
    Apr 2005
    Posts
    96


    Did you find this post helpful? Yes | No

    Default got it

    Never mind I got it to work

    I forgot to add:

    DEFINE LOADER_USED 1

    to the top of the code

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