SEROUT2 on PIC18F2620


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2011
    Posts
    4

    Default SEROUT2 on PIC18F2620

    I have just spent 2 days trying to get a very simple program to run, to no avail.
    I have modified the sample program BLINK to include a SEROUT2 instruction.
    At first it runs ok.
    If I then put an ARRAYWRITE before it, the program crashes.
    I remove the ARRAYWRITE and the program runs, but there is no serial output. The LED pin toggles ok "around the SEROUT2 instruction", but the serout data pin does not change state.
    The SEROUT2 takes up about 1mS (measured with a 'scope on the LED pin).
    This is about right for 9600 baud. So it looks like the SEROUT2 code is running round its loops but not driving the data pin.

    I am using the internal osc, set to 32MHz.

    I have tried completely re-installing PBP and all files from the original installation disk, in case I had corrupted something. But still the problem persists.

    Any ideas, please?
    Thanks
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default

    Try turning _XINST_ON_4L to _XINST_OFF_4L

    _XINST_OFF_4L EQU H'BF' ; Instruction set extension and Indexed Addressing mode disabled (Legacy mode)

    We have to use "legacy" for PBP, it cannot use the extended instruction set (yet).
    http://www.scalerobotics.com

  3. #3
    Join Date
    Jan 2011
    Posts
    4

    Smile It now works

    Many thanks scalerobotics

    I did as you suggest and also had to remove the line Define USE_LFSR 1
    I now get serial output on my chosen pin.
    I can do ARRAYWRITE and everything works.

    Regards

    MisterT

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