0
\$\begingroup\$

This is a noob question but I was looking at some modules just to realize not all of them have MCUs - meaning they can't be programmed considering MCUs have a flash memory where the programs are stored, and SRAM to store the data. Is this the main reason? Basically, how does one determine whether a module is programmable or not from a hardware architecture standpoint?

Those modules though contain peripherals (i.e SPI) over which they can be communicated with another the MCU. For the context, I'm referring to nRF24L01

\$\endgroup\$
7
  • 1
    \$\begingroup\$ No hard answer but a lot of things have to go right for the module to be programmable for the end-user. There has to be microcontroller somwhere, whether inside the specialized radio IC being used or exernal, it has to have enough extra memory to hold the user program, enough extra processing power to run it along with everything else it is doing, the OEM firmware has to run alongside the user, designers have to write firmware so you can program it without wiping the OEM firmware, it has to have enough peripherals available for you to use and it has to have extra lines run out for you to use \$\endgroup\$
    – DKNguyen
    May 20 '20 at 17:34
  • 1
    \$\begingroup\$ The chip you link to can be programmed. It has a memory map that you write values to that changes the functionality. It just can't be programmed like a general purpose MCU. Companies generally want their products to meet their datasheet specifications, and if the design allows full customization by uploading new code it would no longer meet the specs. \$\endgroup\$
    – Justin
    May 20 '20 at 17:41
  • \$\begingroup\$ @Justin - i'm looking at Figure 1 where I see a bunch of external pins including MOSI, MISO etc used for SPI. Where is the memory located considering there isn't an MCU? \$\endgroup\$
    – MKD
    May 20 '20 at 18:04
  • 1
    \$\begingroup\$ It is an ASIC (application specific integrated circuit). ASICs can have whatever circuitry they need on them. It looks like it probably doesn't have any nonvolatile memory (though it could). Normal RAM memory can be done just using registers (banks of flip flops). By the way, it could even have a processor core on it -- it is possible to buy the design files for many processors, allowing you to include them into your own ICs without a separate chip (to be clear, that is not in any way required in order to have a memory map). \$\endgroup\$
    – Justin
    May 20 '20 at 18:15
  • \$\begingroup\$ Maybe a better way to word the question would be "What capability or features are needed to make a module programmable" \$\endgroup\$
    – SteveSh
    May 20 '20 at 19:09
1
\$\begingroup\$

Many SPI-interfaced peripherals including the nRF24L01 actually do not contain a stored-program processor. Instead they are more hard wire logic - state machines, etc. It's actually a little tricky to implement an SPI peripheral on a processor - it can be done, but its conversely a very natural fit for a finite state machine to expose a bunch of registers over SPI which control the operation of other FSM's that do the actual work of the chip.

Of course other devices do, for example MEMS sensor ICs may have an on-board processor even capable of running custom code.

There are also a lot of fixed-function devices that are clearly acknowledged to have firmware, but where the end user isn't allowed to change it (at least beyond loading a new binary from the vendor). Sometimes you can reverse engineer these, sometimes easily, sometimes only with extreme difficulty. These would include things like radio + MCU combinations implementing some radio protocol.

And then there are components where the fact that they have firmware is little discussed, almost secret. Most USB-interfaced chips presumably have something like an MCU inside, there have even been suggestions that some USB-serial parts are just re-numbered generic MCUs. But the firmware of such devices may be not just non-alterable by a customer, but actually immutable, for example in a mask ROM or one-time-programmable technology.

\$\endgroup\$
9
  • \$\begingroup\$ Aren't user-defined programs stored in flash memory or you're referring to ROM in your first line? Clearly, it's up to the manufacturer to make a module user-programmable but from a hardware architecture standpoint, what really makes one non-programmable? I'd assume it needs to have at least flash to store the programs, and SRAM to store the data (part of the MCU). There are nordic modules i.e nrf5 series that can act as a standalone MCU and are programmable, and the main difference that I see is it has an MCU. \$\endgroup\$
    – MKD
    May 20 '20 at 19:17
  • \$\begingroup\$ I think you are stuck on the term programmable. It is not a fixed definition term, vague and to some extent opinion based on what it means. To be programmable in no way means it has to have a processor with memory holding instructions. the uart on a microcontroller is programmable but it does not have a processor nor flash/ram to hold instructions for a processor it doesnt have. It is programmable in that 1) we can program its optional functionality, speed, bits, etc. And 2) there is a program somewhere else doing that, just not in the uart. \$\endgroup\$
    – old_timer
    May 20 '20 at 22:01
  • \$\begingroup\$ Chris, yes in fact not just suggested but early USB days the EZ-USB which they may still make flavors of. Was in fact a chip that enumerated generically, you downloaded the firmware from a driver on your computer, then it would reboot with that firmware in ram and that firmware would (if programmed to) re-enumerate as some other product. /lib/firmware for example on a linux machine is probably not empty, your mouse, keyboard, etc might already rely on downloaded firmware it may or may not have started generic but this is not unique \$\endgroup\$
    – old_timer
    May 20 '20 at 22:07
  • \$\begingroup\$ @old_timer the EZ-USB are explicitly USB MCUs not fixed function parts \$\endgroup\$ May 20 '20 at 22:36
  • \$\begingroup\$ @kol No, the first paragraph is about devices that simply do not have a computational processing engine which could execute a program. It has nothing to do with type of memory technology but is about the lack of a processor that can run a program - the specific term being "stored program processor". Some fixed function engine which can only have its behavior tuned by registers that say activate options and program dividers is not a "stored program computer" \$\endgroup\$ May 20 '20 at 22:37
1
\$\begingroup\$

You are misunderstanding what the term programmable means. To be programmable does not mean it has a processor that runs programs. It is one of those terms like embedded, firmware, 8-bit processor, and dozens of others that are used in the hardware/software world but are vague. They do not have dictionary definitions or lets say the dictionary definitions are by definition wrong because the terms are vague. Some are marketing depending, the marketing department for company X has copy that says that product Y runs on a Z number of bit processor. Or its harvard architecture or many other terms. And that copy is not wrong because by their definition that is correct. Some other company may use a term differently and they are also correct in their use. Long timers at certain companies will sometimes develop very rigid definitions for terms which are correct inside those walls but completely contradict long timers at other companies, both companies are right.

So for the folks that have commented so far, and the notion that this peripheral/module is programmable. It is. it is not a rigid fixed function product that you cannot change its functionality, certainly not through a program on it or some other connected in some way module/device.

A microcontroller (another one of those terms that is vague, there are corner cases in folks definitions) generally has a processor some ram for data and instructions and sometimes non-volatile storage for instructions and data. Quite often also has some on board peripherals, uart, timer, spi, i2c etc. These peripherals themselves do not have processors in them but are programmable because they are not fixed function, the uart is generally not locked at one speed and bits per character and stop bits, you can program that you can change those settings, you can pick when to send a character and when not to. But through some bus there is a processor running a program that the user uses to manipulate the connection between that processor and that uart program it to do things.

It may have a state machine in it which is basically all a processor is, but rarely in one of these peripherals do you get to feed the state machine directly like you do in a processor, you set some settings that go through some logic that turn into inputs into the state machine, much less generic than a "processor" (another one of those terms that is vague and in the eye of the beholder).

So whether it is a uart on the same chip through some number of layers of memory mapped busses, or a uart or some other peripheral on some other chip via some number of layers of busses, and the peripheral has options that can be chosen or manipulated over/through that bus, it is programmable too. It might have processors hidden or not in it, it might just be some state machines or just some discrete logic, it is still programmable. as is this product you are looking at.

Where the boundary is of fixed function vs programmable is where different definitions will disagree.

But you know my bread machine is programmable, through buttons and a display I can tell it when to start and what things to do. A coffee maker with a dial for a timer and an on off button is programmable, I want to you to start at 7:00AM, go...Didnt have to write one line of code.

This chip vendor happens to make other products with with a processor on board and that or similar transceivers so that you dont have to buy two chips an mcu and this you can just buy one bigger chip from them. Is that at a high level any different than a separate mcu chip and this chip? In either case if the vendor has a processor to manage the radio buried in the design but dont want us to know there is no reason why they would ever hint at that. Some produces have a full blown mcu inside, but we dont know that they just give us pins and bus specs and they program the product/part before it goes out. But it might have an arm instead of just the typical 8051 or z80 or other you see (hah, only sometimes you get to see) buried in these products. Some gps module vendors go into detail as to what processor is inside, but you cant touch that thing it is pre-programmed, you apply power and ground and hook a uart up to the tx pin and thats all you get sometimes. They have a floating point unit in there all kinds of math going on, pretty good sized program running, but its not programmable as far as we are concerned turn it on and it spits something out we cant control (some are you can change the baud rate and updates per second, maybe more features, but not download firmware).

What capability or features are needed to make a module programmable?

It needs to be not fixed function and it needs to have some form of an interface where you can choose options to change/customize how it functions. A processor and code are not a requirement.

I would argue the light in my office is not programmable I have an on/off switch so some may argue that it is, but I would say it isnt. If it had a dimmer or a three way bulb lamp, well okay now we are venturing into gray area (as far as the "system" goes, the power plus switch plus light, socket, wires, etc).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.