PDA

View Full Version : Warning[202]



KVLV
- 16th December 2007, 00:12
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.






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

Darrel Taylor
- 16th December 2007, 01:14
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>

KVLV
- 16th December 2007, 02:05
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.

KVLV
- 16th December 2007, 02:11
i am learning how to use Mister E piccal.

thanks Darrel.

Darrel Taylor
- 16th December 2007, 02:23
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>

KVLV
- 16th December 2007, 03:09
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


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.

KVLV
- 16th December 2007, 03:14
I use USB on board of the pic for transmitting/receiving data.

Darrel Taylor
- 16th December 2007, 03:32
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. http://www.picbasic.co.uk/forum/images/icons/icon14.gif
<br>

KVLV
- 16th December 2007, 04:13
indeed, substitue BAUDCTL.3 = 1 with BAUDCON.3 = 1, when compile produced no error.

mister_e
- 16th December 2007, 09:30
Life it isn't easy then :D