Floating point math

+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2009

    Default Floating point math

    Would be very nice to have floating point math

    Currently I use MikroC from Mikroelektronika for that. What I do not like too much in MikroC is lack of convenient and simple serial input/output functions and formatted output - if you want to output a phrase, you have to output letter by letter which is a pain. Also output of a value as text is not as simple as in PBP. But their signed word and long variables and floating point math are a definite plus (works even on 8 pin PIC12). I use 8 pin PICs in current project and it looks like compilers from Microchip do not have math library for such micros, they also do not have graphic library for PIC18 etc. so MikroC was my choice for this project. I like MikroC because their libraries (includung graphic) can work on any small PICs as long as hardware (pin count, etc) is sufficient for the project.

    I guess 90% of my projects are done on PBP and I like it very much. Are there any future plans for PBP compiler or it is now matured and no more development is planned?

  2. #2
    Join Date
    Nov 2003
    Wellton, U.S.A.

    Default Re: Floating point math

    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2003

    Default Re: Floating point math

    Though this is fairly old, right now I’m writing C code for dspic33FJ64GP just to do floating point math
    where I’m still more proficient with the rest of the program to use a 16F628A in the same circuit.
    Two chips have to talk some serial with each other. Quite crazy since then the board requires
    two regulators for two supply voltages and level conversion for connections between the 3.3 Volt dspic and any 5 Volt pic or peripherals.

    The dspic is really only for some numbers go in, it does it’s sin, cos, tan, and some different numbers come out.

  4. #4
    Join Date
    Sep 2009

    Default Re: Floating point math

    Why you need FP for trig function?
    You can use lookup table and linear interpolation to get 3-4 decimal places resolution.
    Melanie already done that
    And just found this
    So I think that you can do all that in one pic.
    And you can use N bith math, or FP rutines, is long isn't enough... And it must be faster to do that in one PIC, than to sent and receive data thru UART.

  5. #5
    Join Date
    Mar 2003
    Commerce Michigan USA

    Default Re: Floating point math

    Hey Art, Being you like to work with the 16F628's you might have a look at using one of the 16F1847's to replace it. 8K of flash, 1K of ram, 256 bytes of eeprom and 32Mhz. I have replaced a few 16F628's from old projects and they work a treet...
    Dave Purola,

  6. #6
    Join Date
    Aug 2003

    Default Re: Floating point math

    I did give a a lot of thought of getting it into one chip, and it would definitely be the dspic
    since I already have implemented the functions I want into another program for the same chip.
    This is just the first time Iíve had to do the hardware. The last one was a kit web server.

    Since I want the LCD to be continually driven, and am more apt with fancy graphics with an 8 bit pic,
    thatís the reason to consider the second chip.
    If I was happy with a fairly static LCD display, it would be easy with the dspic alone.
    The algorithms are Sunrise/set, Moonrise/Set, and Moon Illumination for a clock.

Similar Threads

  1. Floating point math
    By Glenn in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th January 2009, 03:47
  2. Getting out of floating point
    By jcb344 in forum General
    Replies: 3
    Last Post: - 5th August 2008, 21:18
  3. Replies: 5
    Last Post: - 28th May 2008, 10:20
  4. Floating Point
    By jrudd in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th May 2005, 14:19
  5. help floating Point!
    By Eric in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th December 2003, 21:18

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts