Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

micro controller for finding ratio

Status
Not open for further replies.

Baalu

Newbie level 3
Joined
Jun 20, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,300
Hi

I wanted to find the ratio of a set of no:s using a microcontroller.
eg 30.5/16.8 = 1.8
Data is received by an SPI and transmitted through an USART.

Can anyone suggest a suitable microcontroller, preferable with lesser no; of cycles per division
 

Thanks for the reply.

I am planning to use PIC/dsPIC for my application.

But I haven't worked in microcontrollers before. From the datasheets of a few PICs I have seen they are capable of giving only an integer result.So if I need, for eg: 30/4..can i get the result as result= 7.5 rather than Quotient = 7 and reminder = 2? Can dsPIC30x or PIC24x give the required result as a floating point number?
 

most microcontroller compilers and libraries have float variables with, if the device does not have floating point hardware, the float calculations done in software. This is the case with the PIC24 and dsPIC. also you can print float and double results using printf() etc
Code:
  float x = 30/4.0f;
  printf("%f\n", x);
would give a float result 7.5

if you are looking for a more sophisticated (and expensive) development board the Microchip Explorer 16 is good
**broken link removed**

if can take PIC24, dsPIC and PIC32 PIMs and a range of daughter boards can be plugged in
**broken link removed**
 
Last edited:
  • Like
Reactions: Baalu

    Baalu

    Points: 2
    Helpful Answer Positive Rating
Is there a corresponding code in assembly language. How is it stored in the memory?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top