Multiplying in a microcontroller

I'm doing a project with a PIC16F877 and I was wondering how I can multiply by a decimal number. Suppose for example I wanted to do 10*2.73. It seems like this pic doesn't have any instructions for multiplication. Thanks for any help

Replies

  • sauravgoswami
    sauravgoswami
    r u using assembly language???,if yes then it sure must have or simply use C-lang for programmingit will be easier
  • el3ktr1k
    el3ktr1k
    Yes I was doing this in assembly. I got the microcontroller to control motors without any feedback but now that I need to implement a PI controller, I may have to switch to programming in C. Do you know of any free C compilers that will work with the pic16F877?
  • sauravgoswami
    sauravgoswami
    use keil,its very versatile and popular
  • sauravgoswami
    sauravgoswami
    When you say MPLAB, do you mean assembly or C18? MPLAB is a design environment pkg, not a language, compiler, or assembler itself.

    C18 has a floating point lib already available. As noted, fp is extremely cycle-intensive and rarely necessary. If it's essential, fine, but it rarely is. Even the task you mention would seem better served by understand the task well enough to fit the numbers into 32 bit integers. These will be hundreds of times faster than fp.

    If you're doing assembly, making your own 64 bit integer data type is possible if you modify your math routines. That'll still be much faster.
    #-Link-Snipped-#

    why dont ya try PICBASIC PRO #-Link-Snipped-#

You are reading an archived discussion.

Related Posts

Hi friends, I am new to here so apologize if this thread is posted at a wrong place I am a student in a college, for an experimental project we...
hello:smile:
Hi everyone, I am the manager of a placement consultancy and have to spend a lot of time online looking for potential information. This consumes a lot of time, but...
Happy Birthday balasubramanian, shaan1987 Keep rocking Guys. 😁🎉😁:myparty: -Crazy (Engineers)
my samsung hard disk loosed the ddlr file how to currupt it