CE Home
Navigation
Go Back   CrazyEngineers Forum > CE : Technical Discussions > Electrical & Electronics Engineering
Notices


Advertisements
Reply
 
LinkBack (1) Thread Tools Display Modes

  1 links from elsewhere to this Post. Click to view. #1 (permalink)
Old 16th July 2008, 03:21 AM
CE - Apprentice
 
Join Date: 24th June 2008
I'm a Crazy Electrical Engineer
Posts: 22
Default 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
el3ktr1k is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)
Old 16th July 2008, 08:03 PM
CE - Addict
 
sauravgoswami's Avatar
 
Join Date: 26th February 2008
Location: India
I'm a Crazy Electronics Engineer
Posts: 498
Send a message via Yahoo to sauravgoswami
Default Re: Multiplying in a microcontroller

r u using assembly language???,if yes then it sure must have or simply use C-lang for programmingit will be easier
__________________
Be HaPpY !!!!
sauravgoswami is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)
Old 17th July 2008, 03:44 AM
CE - Apprentice
 
Join Date: 24th June 2008
I'm a Crazy Electrical Engineer
Posts: 22
Default Re: Multiplying in a microcontroller

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?
el3ktr1k is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)
Old 17th July 2008, 01:25 PM
CE - Addict
 
sauravgoswami's Avatar
 
Join Date: 26th February 2008
Location: India
I'm a Crazy Electronics Engineer
Posts: 498
Send a message via Yahoo to sauravgoswami
Default Re: Multiplying in a microcontroller

use keil,its very versatile and popular
__________________
Be HaPpY !!!!
sauravgoswami is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)
Old 17th July 2008, 01:35 PM
CE - Addict
 
sauravgoswami's Avatar
 
Join Date: 26th February 2008
Location: India
I'm a Crazy Electronics Engineer
Posts: 498
Send a message via Yahoo to sauravgoswami
Default Re: Multiplying in a microcontroller

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.
http://www.winpicprog.co.uk

why dont ya try PICBASIC PRO http://www.melabs.com/products/pbp.htm
__________________
Be HaPpY !!!!
sauravgoswami is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.crazyengineers.com/forum/electrical-electronics-engineering/3517-multiplying-microcontroller.html
Posted By For Type Date
Electronics-Engineering » Electronics Engineering Jobs For Australia This thread Pingback 21st July 2008 09:44 PM


All times are GMT +5.5. The time now is 08:38 PM.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Member comments are owned by the poster. Copyright © 2005-2008 CrazyEngineers.com. All rights reserved.

Advertisements