Problem with SEROUT after compiling with PBP3


Results 1 to 20 of 20

Threaded View

  1. #10
    Join Date
    Nov 2005
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: Problem with SEROUT after compiling with PBP3

    AvionicsMaster1 - yes, only changed the CONFIG part.
    Does not matter if I delete the #CONFIG part from the code and set OSC=HS in the programmer... same result.
    I tried indent, just now, with TAB as well with varying number of spaces...same result.
    Contents of the Config line are as per PIC16F876A.INFO... see below.

    Robert - all other aspects work correctly:-
    The code determines the data from the incoming pulse stream and displays correctly on the 3 digit 7 seg display, operates a buzzer with a beep to advise on a new code being displayed etc. All this is based on pulse duration timings via interrupts and using Timer1.
    Except for Serout it all appears to be working correctly.

    My striped down code is as follows:-

    define osc 8
    include "modedefs.bas"

    #CONFIG
    __config _HS_OSC & _WDT_ON & _BODEN_ON & _PWRTE_ON & _CP_OFF & _LVP_OFF
    #ENDCONFIG

    ' Setup Ports
    ADCON0 = $00 'Disable AD ports
    ADCON1 = $07 'Disable AD ports
    Segments Var PORTC 'Data
    LEDdigit Var PORTA 'Control
    TRISC = $80 ' Set segment pins to output
    TRISA = $f0 ' Set digit pins to output
    PortC = $FF
    PortA = $FF
    TRISB = %00000011 ' Set RB0, RB1 i/p rest o/p
    TRISA = %00001000 ' Set RA3 i/p rest o/p
    USBport var PortB.5
    Buzzer var PortB.4
    Buzzer=0
    ModeSw var PortB.1
    Modesw=0

    Once var bit ; added so print only occurs once
    once=0

    pause 1000

    '=========== Print Header ==============

    mainloop:
    if once = 0 then
    serout USBport,T9600,[12,"*** Diagnostic Code Unit v1.4 ***",13,10]

    once = 1
    endif

    goto mainloop


    Note that if I use :-
    __config _HS_OSC & _WDT_OFF & _BODEN_OFF & _PWRTE_OFF & _CP_OFF & _LVP_OFF
    Result is the same.

    ALSO, I noticed in this post that the Indent is missing from the __CONFIG line.
    The editor in this posting system must remove leading spaces.
    It is there in MCSP.
    Last edited by Muzza; - 15th June 2013 at 03:29.

Similar Threads

  1. Problem for compiling SDSF library.
    By Ziko87 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th August 2012, 08:17
  2. PBP3 Compilation problem
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st June 2012, 12:17
  3. TMR0 preset problem, PBP3.0
    By Norbert in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th December 2011, 19:36
  4. Problem compiling EasyHID code
    By mindthomas in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th August 2010, 20:46
  5. Problem with Compiling
    By tarexpanda in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th April 2007, 05:12

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