Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

some basic questions about microcontrollers

Status
Not open for further replies.

PG1995

Active Member
Hi,

Could you please help me with the queries below? I wanted to make sure that my basic understanding is correct. Thank you.

Question 1:
Is there any way to convert QFP package IC into a DIP package for use on breadboard? I was thinking of experimenting with PIC32MZ2048EFM144 since it has an FPU. Actually I need to use an MCU with integrated FPU and PIC32 is the only one I could find.

Question 2:
It looks like x-bit designation, like 8-bit, 16-bit, of an MCU is based on the width of data bus or path. The data bus is like a road connecting different parts of an MCU. Do I have it right?

Question 3:
This question is about hardware multiplier and divider. PIC 16F876A doesn't have any hardware multiplier or divider which means it uses software routines to implement multiplication and division such as float point calculation library. PIC 18F46K22 has 8 x 8 single-cycle hardware multiplier but no hardware divider.

Question 4:
PIC 24FV16KM204 has 17-Bit x 17-Bit Single-Cycle Hardware Fractional/Integer Multiplier, 32-Bit by 16-Bit Hardware Divider, and PIC 32MZ2048EFM144 has an FPU. I had always thought that FPU means hardware implemented multiplication and division so why don't we say that PIC 24FV16KM204 also has an FPU.
 

Attachments

  • QFP_PACKAGE.jpg
    QFP_PACKAGE.jpg
    65.4 KB · Views: 329
You're asking very basic questions but want to jump straight into the deap end with a pic32! Is this a good idea?

Mike.
 
You're asking very basic questions but want to jump straight into the deap end with a pic32! Is this a good idea?

Mike.
Ha ha ha ha! Good question. My 2-year-old nephew uses a 64-bir processor.

Are you the guy that thinks someone should build with sticks before they build with purchased boards, too? Bore a hole with brace and bit before using an electric drill.

If a 32-bit microcontroller is needed for a job the OP should step right in. There are many ways to get there.

It sounds like he would be very happy with an olimax board. It can be programmed with a USB cable connected to any PC/Lappy running the Arduino IDE.
 
Last edited:
Thank you, everyone!

Pommie, I understand your point and you are correct in a way because MCUs are used by most students and entry-level hobbyists for learning purposes. I have used both PIC 16F876A and PIC 18F46K22 in the past, and have also forgotten many things about microcontrollers. Working with the said MCUs showed me how one needs to optimize code and avoid float calculations which I might have not given much thought to if I were using some over-kill MCU with FPU.

gophert, How Olimex board is any different from this one DM320007, https://www.microchip.com/DevelopmentTools/ProductDetails/DM320007?

Also I see there are many PCB makers online, you give them the design and they make a board for you. I was wondering if there is any PCB maker which in addition to making a PCB board also solders/connects the required components for you, such as resistors, capacitors, etc, onto the board. Perhaps, I can send them components or they can use their own and charge me extra. Could you please guide me with this?

Thank you!
 
The simplest route would be an Arduino-comparable Teensy 3.5 or Teensy 3.6. These come with FPU and high clock speeds - look up specific commands for single-precision FPU calculations. sinf() vs sin().

note that double-precision floats are not done by FPU - just single precision. These are very fast devices and can be overclocked with the Arduino IDE drop down menus

https://www.adafruit.com/product/3266
 
Thank you!

I think PIC requires you to put more effort into setting up a system because you need to interface inputs and outputs yourself. For learning PIC would be the best bet compared to a developed system like Arduino where you have different modules like WiFi, USB, etc. already set up. Well, I might be wrong because I've never worked with Arduine, Teensy or anything like that.

I'm still waiting if someone could shed some light on the following.

This question is about hardware multiplier and divider. PIC 16F876A doesn't have any hardware multiplier or divider which means it uses software routines to implement multiplication and division such as float point calculation library. PIC 18F46K22 has 8 x 8 single-cycle hardware multiplier but no hardware divider.

PIC 24FV16KM204 has 17-Bit x 17-Bit Single-Cycle Hardware Fractional/Integer Multiplier, 32-Bit by 16-Bit Hardware Divider, and PIC 32MZ2048EFM144 has an FPU. I had always thought that FPU means hardware implemented multiplication and division so why don't we say that PIC 24FV16KM204 also has an FPU.
 
Last edited:
Thank you!

I think PIC requires you to put more effort into setting up a system because you need to interface inputs and outputs yourself. For learning PIC would be the best bet compared to a developed system like Arduino where you have different modules like WiFi, USB, etc. already set up. Well, I might be wrong because I've never worked with Arduine, Tennsy or anything like that.

I'm still waiting if someone could shed some light on the following.

This question is about hardware multiplier and divider. PIC 16F876A doesn't have any hardware multiplier or divider which means it uses software routines to implement multiplication and division such as float point calculation library. PIC 18F46K22 has 8 x 8 single-cycle hardware multiplier but no hardware divider.

PIC 24FV16KM204 has 17-Bit x 17-Bit Single-Cycle Hardware Fractional/Integer Multiplier, 32-Bit by 16-Bit Hardware Divider, and PIC 32MZ2048EFM144 has an FPU. I had always thought that FPU means hardware implemented multiplication and division so why don't we say that PIC 24FV16KM204 also has an FPU.


Hardware multiplier is easier because everything is integer and binary.

A hardware divider would require handling of fractional bits and does not exist - this is what the FPU does. An FPU also handles exponential expressions for very large numbers.
 
Thank you.

Hardware multiplier is easier because everything is integer and binary.

A hardware divider would require handling of fractional bits and does not exist - this is what the FPU does. An FPU also handles exponential expressions for very large numbers.

But the numbers being multiplied might also be floating numbers. Anyway, I do get that division would be harder to implement.

Anyway, PIC 24FV16KM204 has both 17-bit x 17-bit single-cycle hardware fractional/integer multiplier, and 32-bit by 16-bit hardware divider. But still this PIC isn't stated as having an FPU.
 
Thank you.



But the numbers being multiplied might also be floating numbers. Anyway, I do get that division would be harder to implement.

Anyway, PIC 24FV16KM204 has both 17-bit x 17-bit single-cycle hardware fractional/integer multiplier, and 32-bit by 16-bit hardware divider. But still this PIC isn't stated as having an FPU.


The multiplied numbers might be floating point numbers but they only need to be floating point numbers if you let them be (or set them to be) floats.

Depending on the hardware capabilities and the precision you need, You can also be strategic to prevent values from being floats (or from remaining floats). Watch your order of operations, rotate left before dividing, divide and cast as int, then rotate the result right.

A float with a value 2.0 takes much longer to handle than an unsigned char 2.
 
Could you please comment on the following? Thanks!

I see there are many PCB makers online, you give them the design and they make a board for you. I was wondering if there is any PCB maker which in addition to making a PCB board also solders/connects the required components for you, such as resistors, capacitors, etc, onto the board. Perhaps, I can send them components or they can use their own and charge me extra.
 
Could you please comment on the following? Thanks!

I see there are many PCB makers online, you give them the design and they make a board for you. I was wondering if there is any PCB maker which in addition to making a PCB board also solders/connects the required components for you, such as resistors, capacitors, etc, onto the board. Perhaps, I can send them components or they can use their own and charge me extra.

Yes, there are plenty. You need to specify exact parts for every position, make sure your design is clear. I haven't used them but I've done several quotes. They charge by some formula based on number of unique parts on your board, and total number of pins. They add a surcharge for each unique part they have to order. I haven't seen any supplier willing to use your parts but I've only seen the details of a few. If you have code that needs to be loaded into a micro, distributors like digikey can do that, or you can add header pins to your design and program the boards once returned to you.
 
Hi,

Could you please help me with the queries below? I wanted to make sure that my basic understanding is correct. Thank you.

Question 1:
Is there any way to convert QFP package IC into a DIP package for use on breadboard? I was thinking of experimenting with PIC32MZ2048EFM144 since it has an FPU. Actually I need to use an MCU with integrated FPU and PIC32 is the only one I could find.

Look here (Originally from post #15):
https://www.proto-advantage.com/store/product_info.php?products_id=3600003

I've been meaning to pick up some of these. :)

Question 2:
It looks like x-bit designation, like 8-bit, 16-bit, of an MCU is based on the width of data bus or path. The data bus is like a road connecting different parts of an MCU. Do I have it right?
Yes, but they're referring to the internal data bus. Sometimes, they're referring to the actual pins that come out of the CPU.

Question 3:
This question is about hardware multiplier and divider. PIC 16F876A doesn't have any hardware multiplier or divider which means it uses software routines to implement multiplication and division such as float point calculation library. PIC 18F46K22 has 8 x 8 single-cycle hardware multiplier but no hardware divider.

They're referring to to Integer (binary) multiplication. Floating point multiplication deals with the fractional component whereas integer multiplying does not.

Of course, that depends on the implementation.

Question 4:
PIC 24FV16KM204 has 17-Bit x 17-Bit Single-Cycle Hardware Fractional/Integer Multiplier, 32-Bit by 16-Bit Hardware Divider, and PIC 32MZ2048EFM144 has an FPU. I had always thought that FPU means hardware implemented multiplication and division so why don't we say that PIC 24FV16KM204 also has an FPU.

FPU means "Floating Point Unit".

Look here:
https://steve.hollasch.net/cgindex/coding/ieeefloat.html

There is also 'fixed point', which is typically a set of numbers meant to scale to a domain. (In DAWs like Cubase, it goes from -1 to 1)

https://en.wikipedia.org/wiki/Fixed-point_arithmetic
 
Last edited:
Thank you, gophert, rjenkinsgb, KeepItSimpleStupid, MichaelaJoy!


The pin count for PIC32MZ2048EFM144 is 144 and this DIP converter has only 52 pins so it won't work.

2. Not a simple answer. See: https://www.quora.com/What-do-you-mean-by-8-bit-16-bit-32-bit-microprocessor
before I looked it up, I pretty much got the same answer but no details. So, "The manufacturer determines it" isn't a bad answer/
Register size looks like a 1st order bit size determination. If there is a mix of register sizes all bets are off.

That was good answer. From the examples in the linked answer, I'd say that a manufacturer calculates that how much data it can move around at a time internally against some standard and then the 'bitness' of an MCU or MPU is determined.

Q4: FPU. It looks like the anwser to that is messy too. I took a while to develop a standard Floating point number form, but it wasn;t always that way.

Here is the IEEE-754 formal described: https://en.wikipedia.org/wiki/IEEE_754

and here https://manx-docs.org/details.php/1,1332 is the manual for an early Floating Point Unit (PDP-11), probably 1970's or earlier.

Thank you for the links. So having a simple multiplier and divider doesn't just qualify to be an equivalent of an FPU. It's like comparing a numerical calculator with a graphing calculator.

Yes, but they're referring to the internal data bus. Sometimes, they're referring to the actual pins that come out of the CPU.

Initially when you I read your reply, I agreed with you that they were referring to the internal data bus. But then I had a look on the provided by KISS and in the excerpt below I don't understand why they are referring to the "external data bus" . If you search the word "external" on the source document, you'd see that they are mostly referring to the external data bus. I don't understand why this so when the discussion about the 'bitness' of an MCU or MPU should be about the internal data bus.

"Consider the following examples:
  • Zilog Z80 - Considered an 8-bit CPU, it has an 8-bit data bus, 16-bit address bus, and a mix of 8-bit and 16-bit registers.
  • Intel 8086 - Considered a 16-bit CPU, it has a 16-bit data bus, a 20-bit address bus, and 16-bit registers.
  • Intel 8088 - Considered a 16-bit CPU, even though it has only an 8-bit external data bus. Everything else is identical to the 8086. The original IBM PC was based on this CPU.
  • Intel 80386 - Considered a 32-bit CPU, it has a 32-bit data bus, 32-bit address bus, and 32-bit registers.
  • Intel 80386SX - Considered a 32-bit CPU, even though it has only a 16-bit external data bus and a 24-bit external address bus. Everything else is identical to the 80386."
Source: https://www.quora.com/What-do-you-mean-by-8-bit-16-bit-32-bit-microprocessor

internal222-jpg.115932


Thank you!
 

Attachments

  • pin_count.jpg
    pin_count.jpg
    62.5 KB · Views: 322
  • internal222.jpg
    internal222.jpg
    28.4 KB · Views: 273
It comes down to architecture.

Look here: https://en.wikipedia.org/wiki/Von_Neumann_architecture

When you design with any CPU, you must first see if the data / address busses are multiplexed.

Signal names like \( \overline{ALE} \) are used to capture the upper part of the address that the CPU is accessing at the time.
The same thing is done with the data bus. There will be signal lines that will help you identify even / odd bytes (If the CPU splits the data up that way.)
Once again, it varies from one CPU architecture to another.

Then, look up Harvard Architecture (The link should be on the same wikipedia page)

The PIC is a Harvard architecture (as well as others...Dunno which. I haven't tried all of them (yet) :) )

When I want to use a chip, the first thing I do is study the datasheet and see what's needed to support it.
That helps me to do an initial cost estimation as well as determining clocking / power requirements.

Then, I can get a handle on what's needed to build a prototype. Developer boards are nice, but they usually have stuff that's not needed
in my design. Or, a variant of it is needed, using different parts.

If you're learning and tinkering, then a developer board is perfect for you.

If you're designing something to sell, or as proof of concept, then a prototype is needed.
 
Last edited:
I don't understand why they are referring to the "external data bus"

The 8 / 16 / 32 etc. bit designation generally means the width of the internal data bus and data registers.

Quite a few microcontrollers microprocessors can either optionally run with a "narrower" external data bus, or have different versions with different external data bus widths.

Although that means external data transfers take more memory cycles, the program is no different and the CPU memory controller handles the different bus widths transparently.

It means you can build a cheaper system, with less memory devices and a lower pin-count CPU but the same software, if that suits a particular application.

The Motorola 68000 is a good example; it's a 32 bit CPU and has versions in the family with 8 bit, 16 bit or 32 bit external data busses
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top