Problems with mpasm


Closed Thread
Results 1 to 34 of 34

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by iw2fvo View Post
    Hi,
    I am happy because I understand that you have read the basic program but I am really interested in knowing how can my program be wtitten without using the F P.
    Could you please inform how it can be done ? It will be a very interesting solution.
    Nothing interesting about it.
    Where is the program using numbers between 0 and 1? Or fractions for that matter?
    All I see is numbers that go above 16 bit. If that's the case, and you are using an 18Fxxx part, then you can use LONG variables to handle 32 bit (large) numbers.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    MeLabs has a nice intro to longs here: http://www.microengineeringlabs.com/...cles/longs.pdf
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default mpasm and Melabs F P

    Ok , Thanks Bruce I will have a look to longs as suggested.
    I am writing a program in order to control the Analog Device AD9912 DDS: this device will be used as a RF signal generator for radio ham use. The point is that I have to multiply a number as like as
    2^48/1000000000 ( 281474.976711) by another number that is the readout of the real output frequency ( from 1 Hz to 400 MHz ) . At the moment the Melabs FP works well and gives me the correct output frequency.
    Unfortunately i can not put the " DDS" piece of program in a subroutine : in this case i do have no errors after compiling but the 16F877 does not work.
    And, if I recall the "DDS" piece of program more than three times in my program i do have the same result.

    >> question: how can i set the HS oscillator using the Mpasm and pic16f877 with no problem ?

    Thanks a lot.
    Ambrogio
    IW2FVO




    Quote Originally Posted by Bruce View Post
    MeLabs has a nice intro to longs here: http://www.microengineeringlabs.com/...cles/longs.pdf

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by iw2fvo View Post
    I am writing a program in order to control the Analog Device AD9912 DDS
    Would've been a lot handier to have that information awhile back ya think?
    Now I see what you're trying to do. I suppose it's a matter of how you look at it. You need the ability to handle large numbers more than you need floating point specifically...and to be able to handle those numbers with some precision. If I remember right, PBP can handle some 48 bit math (more specifically, I think you can retrieve some of the overflow from a 32x32 multiply). I don't have the manual handy, so I don't want to comment on it at the moment.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default mpasm

    I want to set up the HS oscillator mode for the pic 16f877 using Mpasm.

    I did use the following for the PM:

    @ device PIC16F877,HS_OSC,LVP_OFF, PROTECT_OFF ' use for PM only

    What shoul I write for the Mpasm use without having the overwrite error message?
    What .INC file should I have to modify ? ( pbp or mpasm ? ), if any.

    Thanks a lot
    Bye
    Ambrogio
    IW2FVO

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

  8. #8
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default mpasm long ... /... fp

    Hi,
    is the picbasic pro manual " 3 / 04" applicable to the 2.50 version of PBP ?
    Tnks
    Bye
    Ambrogio
    IW2FVO

    Quote Originally Posted by skimask View Post
    Would've been a lot handier to have that information awhile back ya think?
    Now I see what you're trying to do. I suppose it's a matter of how you look at it. You need the ability to handle large numbers more than you need floating point specifically...and to be able to handle those numbers with some precision. If I remember right, PBP can handle some 48 bit math (more specifically, I think you can retrieve some of the overflow from a 32x32 multiply). I don't have the manual handy, so I don't want to comment on it at the moment.

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by iw2fvo View Post
    Hi,
    is the picbasic pro manual " 3 / 04" applicable to the 2.50 version of PBP ?
    Tnks
    Bye
    Ambrogio
    IW2FVO
    No...
    You should've gotten a new version of the manual when you BOUGHT (and/or upgraded to) PicBasicPro 2.50
    So...I guess we know where you stand...

  10. #10
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default mpasm

    I bought the earlier versione named 2.46 years ago and i do have the manual. If you are so interested this version did cost to me around 230 € here.
    A German radio ham gave me a recent version that is the 2.50 but without any manual.
    I am waiting to receive manual or instruction from him soon.

    Speaking from a more actractive point of view, I am interest in implementing the program using the new "long" capability of the basic. I will try to modify the program.
    I stand here!
    Any help is appreciated.
    Regards,
    Ambro



    Quote Originally Posted by skimask View Post
    No...
    You should've gotten a new version of the manual when you BOUGHT (and/or upgraded to) PicBasicPro 2.50
    So...I guess we know where you stand...

  11. #11
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default mpasm and melabs F P

    Hi,
    thanks for the interest:
    this is the peace of program that in my opinion needs a fp:

    'DDS: '------------------------------------------------------------------------

    AARGB0=f0
    AARGB1=f1
    AARGB2=f2
    AARGB3=f3

    ASM
    CALL flo3232
    ENDASM

    debug HEX2 f0," ", HEX2 f1," ", HEX2 f2, " " , HEX2 f3, 13,10




    ' CALCOLO DELLA FTW DA INVIARE AL DDS
    ' 2^48/1.000.000.000= 281474,976710656
    ' USARE IL PROGRAMMA FREP.EXE DELLE ROUTINES FP PER CONVERTIRLO DIRETTAMENTE
    ' ATTENZIONE: USARE $81 INVECE DI 91 PERCHE' I 2 BYTE MENO SIGNUFICATIVI LI LASCIO
    ' A ZERO ( VEDERE MAIL DI i0cg )


    BEXP=$81
    BARGB0=$09
    BARGB1=$70
    BARGB2=$5F

    GOSUB FPMUL

    ASM
    CALL INT3232
    ENDASM

    'debug " start ",dec aargb0," ",dec aargb1," ", dec aargb2," ",dec aargb3,13,10

    LOW DDSCSB
    'SHIFTOUT DDSDAT,DDSCLK,1,[%01100001,%10101011,aargb0,aargb1,aargb2,aargb3,$0 0,$00]
    HIGH DDSCSB
    HIGH DDSUPDT
    LOW DDSUPDT

    -------------------------------------------------------------------------------------
    Have you some differents indication for me ?
    ( I am sorry for my bad English .. I am Italian )
    Sometimes is very hard for me to understand the real meaning of the things !

    Thanks again
    Ambrogio
    IW2FVO






    Quote Originally Posted by skimask View Post
    Nothing interesting about it.
    Where is the program using numbers between 0 and 1? Or fractions for that matter?
    All I see is numbers that go above 16 bit. If that's the case, and you are using an 18Fxxx part, then you can use LONG variables to handle 32 bit (large) numbers.

  12. #12
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by iw2fvo View Post
    Hi,
    thanks for the interest:
    this is the peace of program that in my opinion needs a fp:
    Why does it need floating point?
    Just because the program has it there, doesn't mean it has to be there.
    Rewrite the program to NOT use floating point.
    Again, I don't see any decimals points needed here. At most, a 32 bit variable.

Similar Threads

  1. Moved from PM to MPASM and have fuse definition problems
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 26th November 2008, 22:27
  2. 12F675 MCLR directive MPASM
    By OLDSCHOOL in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th May 2008, 01:29
  3. MPASM 18F4550 getting started
    By BrianT in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 4th September 2007, 23:59
  4. MPASM problems
    By BrianT in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 31st August 2007, 01:29
  5. Converting to MPASM
    By btaylor in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2005, 01:35

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