Warning[202]


Closed Thread
Results 1 to 10 of 10

Thread: Warning[202]

  1. #1
    Join Date
    Oct 2007
    Location
    Vancouver, BC, Canada
    Posts
    33

    Default Warning[202]

    I got this warning when compile my program. The whole message is "Warning[202]\PBP\PBPPIC18.LIB 7588 : argument out of range. least significants bits used. "

    FYI: pic18F4550, MicorCode studio 3.0.0.5. pbp 2.50a.
    The hex file when downloaded to my Pic work fine.

    I really need your help understanding this warning.

    Thanks in advance.



    Code:
                          07567   LIST
    000CF4 0100           07568 DUNN    MOVLB   0               ; 1 Reset banks to 0
                          07569 DUNN5   CLRWDT?NOP              ; 1 Hit Watchdog timer
                              M     IFNDEF NO_CLRWDT
    000CF6 0004               M         CLRWDT
                              M     ELSE
                              M         NOP
                              M     ENDIF
    000CF8 0012           07570         RETURN                  ; 2 Done
                          07583   LIST
    000CFA                07584 INIT
                          07587   LIST
    Warning[202]: Argument out of range.  Least significant bits used.
    000CFA 0E38           07588         MOVLW   HSER_SPBRG
    000CFC 6EAF           07589         MOVWF   SPBRG           ; Set baud rate generator reg
                          07590     IFDEF HSER_SPBRGH
                          07591       IFDEF SPBRGH
                          07592         MOVLW   HSER_SPBRGH
                          07593         MOVWF   SPBRGH          ; Set baud rate generator reg high
    MPASM  5.14                      4550V260.ASM   12-15-2007  16:04:13         PAGE 25
    Last edited by KVLV; - 16th December 2007 at 00:14.
    ________________
    KV

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hmmm, my guess, since it's a 4550.

    It's running at 48mhz.
    And you're trying to use a baud rate of 2400 or less.

    Without using BRG16 of the EUSART, 2400 baud is too slow.

    For the SPBRG/SPBRGH values, you can use mister_e's Pic multi-calc.

    http://mister-e.org/pages/utilitiespag.html

    <br>
    DT

  3. #3
    Join Date
    Oct 2007
    Location
    Vancouver, BC, Canada
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    i remember correctly in my program that i set the baud rate anywhere. I am using CDCDESC.ASM for virtual com port.
    I am using the orgional bootloader from Microchip.
    ________________
    KV

  4. #4
    Join Date
    Oct 2007
    Location
    Vancouver, BC, Canada
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    i am learning how to use Mister E piccal.

    thanks Darrel.
    ________________
    KV

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by KVLV View Post
    i am learning how to use Mister E piccal.
    That's the easy part.

    Start the program
    Click on EUSART calc
    Enter 48 in the OSC field
    Enter the baudrate in the appropriate place.

    Click the "Copy PBP DEFINE's to clipboard" button
    and paste them in your program.

    i remember correctly in my program that i set the baud rate anywhere.
    If you don't set the HSER DEFINE's in your program. PBP defaults to 2400 baud.

    If there is an HSEROUT or HSERIN anywhere in your program (even if it never gets executed), PBP will automatically initialize the USART at the default settings, which are too low for 48Mhz.
    <br>
    DT

  6. #6
    Join Date
    Oct 2007
    Location
    Vancouver, BC, Canada
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Thanks Darrel.

    I searched through my program, there is a "Hserout" command, I commented it out and there is no further warning.

    I did copy
    Code:
     
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    DEFINE HSER_SPBRG 46  ' 256000 Baud @ 48MHz, -0.27%
    SPBRGH = 0
    BAUDCTL.3 = 1         ' Enable 16 bit baudrate generator
    when compiled, i got warning message "error[113] \pbp\pbpic18.lib 580 : symbol not previously define(baudctl)

    But anyway I don't need the those DEFINE lines above so I just commented out, and there is no warning. The program when loaded to the pic work fine.
    ________________
    KV

  7. #7
    Join Date
    Oct 2007
    Location
    Vancouver, BC, Canada
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    I use USB on board of the pic for transmitting/receiving data.
    ________________
    KV

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    There are 2 possible places for the BRG16 bit.

    BAUDCON.3
    - or -
    BAUDCTL.3

    It depends on the chip. And for a 4550 it's BAUDCON.3

    mister_e's calculator has a drop-down box for that.
    But you have to know which one to use.


    But like you said, it's fixed.
    <br>
    DT

  9. #9
    Join Date
    Oct 2007
    Location
    Vancouver, BC, Canada
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    indeed, substitue BAUDCTL.3 = 1 with BAUDCON.3 = 1, when compile produced no error.
    ________________
    KV

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


    Did you find this post helpful? Yes | No

    Default

    Life it isn't easy then
    Steve

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

Similar Threads

  1. Warning[202]
    By Del Tapparo in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 24th October 2008, 17:41

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