Search

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

Go to page

Active Member

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.

Active Member

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.

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?

Well-Known Member

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

Active Member

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.

Well-Known Member

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.

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.

Active Member

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.

Well-Known Member

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.

Active Member

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.

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.

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."

Active Member

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.