Searching \ for '[EE]: Numbers :-)' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=
Search entire site for: 'Numbers :-)'.

Exact match. Not showing close matches.
PICList Thread
'[EE]: Numbers :-)'
2001\05\27@165310 by Thomas Graf

flavicon
face
Hi!
Sorry, but the conversion from http://www.jennaron.com.au/pics/bcd2a.html
(the zip-file) still doesn't work, or i understand something wrong please
help me.
When i debug the code the macro "loadd" makes from the number 123456789
"01 05 A8 F5" (in hex).
I thought it should generate "07 5B CD 15". !?
Ok now comes all the conversion and the result is:
"35 32 38 34  36 33 33 35 39 39"
And that would be printed as "5284633599".
What am i doing wrong?
I'm using the MPLAB and a 16c67 PIC...
I thought it should work because it is written for the 16f84...
All i'm doing is just using exactly the excample beginning at "#define".

thx! ciao!

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\05\27@180855 by Spehro Pefhany

picon face
At 08:51 PM 5/27/01 +0000, you wrote:
>Hi!
>Sorry, but the conversion from http://www.jennaron.com.au/pics/bcd2a.html
>(the zip-file) still doesn't work, or i understand something wrong please
>help me.

Hey, Thomas, when you changed the processor, you did change both the
list & include lines in the source code and the simulation? Or are you just
ignoring a warning about a processor mismatch?

If you look at the memory map of the '66 you'll find that the GP
registers start at 0x20H, not 0x0C on the PIC16x84....
that means you are trying to use a bunch of SFRs and some unimplemented
memory as GP registers. It won't work very well, and fortunately the
simulator tells you this.

Best regards,
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spam_OUTspeffTakeThisOuTspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\05\28@001746 by Douglas Wood

picon face
First of all, use this version of the Load32 macro:

load32  macro  arg1,arg2

 movlw  high ((arg1 >> 16) & 0xFFFF)
 movwf  arg2
 movlw  low ((arg1 >> 16) & 0xFFFF)
 movwf  arg2+1
 movlw  high (arg1 & 0xFFFF)
 movwf  arg2+2
 movlw  low (arg1 & 0xFFFF)
 movwf  arg2+3

 endm

Secondly, MPASM uses a default radix of hex. Try adding "list r=dec" to the
top of your program. That should fix it...

Douglas Wood
Software Engineer
.....dbwoodKILLspamspam@spam@kc.rr.com

Home of the EPICIS Development System for the PIC and SX
http://epicis.piclist.com

{Original Message removed}

2001\05\28@021418 by Thomas Graf

flavicon
face
On Sun, 27 May 2001, Douglas Wood wrote:

> First of all, use this version of the Load32 macro:
>
> load32  macro  arg1,arg2
>
>   movlw  high ((arg1 >> 16) & 0xFFFF)
>   movwf  arg2
>   movlw  low ((arg1 >> 16) & 0xFFFF)
>   movwf  arg2+1
>   movlw  high (arg1 & 0xFFFF)
>   movwf  arg2+2
>   movlw  low (arg1 & 0xFFFF)
>   movwf  arg2+3
>
>   endm
>
> Secondly, MPASM uses a default radix of hex. Try adding "list r=dec" to the
> top of your program. That should fix it...
>

yes that was it :-)
hmmmm and i thought that doesn't matter what whas written at the list...
Thanx very much to everyone!

ciao

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics



'[EE]: Numbers :-)'
2001\06\01@231341 by James Newton
face picon face
have you been able to get this working?

Is there not an applicable routine at
http://www.piclist.com/techref/microchip/radix.htm

James Newton (PICList Admin #3) jamesnewtonspamKILLspampiclist.com 1-619-652-0593

Thomas Graf wrote on 01-5-27 13:59:

Hi!
Sorry, but the conversion from http://www.jennaron.com.au/pics/bcd2a.html (the zip-file) still doesn't work, or i understand something wrong please help me.
When i debug the code the macro "loadd" makes from the number 123456789
"01 05 A8 F5" (in hex).
I thought it should generate "07 5B CD 15". !? Ok now comes all the conversion and the result is:
"35 32 38 34  36 33 33 35 39 39"
And that would be printed as "5284633599". What am i doing wrong?
I'm using the MPLAB and a 16c67 PIC...
I thought it should work because it is written for the 16f84... All i'm doing is just using exactly the excample beginning at "#define".

thx! ciao!

--
http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\06\01@234153 by James Newton. Admin 3

face picon face
Oops. I meant to refer to
www.piclist.com/techref/microchip/math/radix/index.htm
if you don't see it there, it needs to be written and put there.

James Newton, PICList Admin #3
.....jamesnewtonKILLspamspam.....piclist.com
1-619-652-0593 phone
http://www.piclist.com

{Original Message removed}

2001\06\02@010233 by Douglas Wood

picon face
James,

Yes. I looked into the problem when he reported it. MPASM default to a radix
of hex and the macro "LOAD32" uses compile-time shift operators with what
appear to decimal numbers (e.g., 24, 16, etc.). However, when that code is
used in MPASM's default mode, MPASM thinks the number are really hex, not
decimal. The fix for this routine is to place periods (.) in front of the
numbers, forcing them to be interpreted as decimal.

Douglas Wood
Software Engineer
EraseMEdbwoodspam_OUTspamTakeThisOuTkc.rr.com

Home of the EPICIS Development System for the PIC and SX
http://epicis.piclist.com

{Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...