Author Topic: Microcontroller Development Advise  (Read 10539 times)

0 Members and 1 Guest are viewing this topic.

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 4328
  • Country: us
Microcontroller Development Advise
« on: June 17, 2023, 04:15:29 pm »
New to microcontroller development and not that proficient in software/computer development in general, altho we have done some work with RPi and Python utilizing I/Os to drive various controls, and precision DACs and read back from precision ADCs and have used the SPI for some work. So basically a newb when it comes to microcontrollers, altho did play around with Arduino a little.

So we are looking for a development platform to develop a relatively simple microcontroller than can produce some specific I/O in the form of pulses and possible read back a few logic signals and maybe some analog input.

What we need the microcontroller to do is create a set of 8 sequential non-overlapping pulses of varying width (0.5 to 5ms), at a rate of ~4Hz to ~80Hz selectable. Another output is a selectable timer from ~60sec to ~1800sec. Everything is ~6 bit resolution, except the analog input at ~8bit resolution.

For UI a rotary dial, with a couple push buttons (Start, Stop, Select) and medium resolution small LCD. No need for USB or other type interfaces, or the need to upload firmware by the end user, and not concerned about protecting the design or code either, as it's going to be trivial anyway.

Per item/chip cost isn't an issue as these will likely be less than few hundred total units in production, but the main point is a good, simple, easy to learn and use development platform to work from.

We have accounts at Adafruit, Newark, Mouser, Digikey, and a few popular other sources.

Anyway, looking for advice from those microcontroller gurus that are well versed in this technology sector (read actually microcontroller developers), and please not the usual rhetoric from those no valued added folks.

Thanks in advance for any guidance/help provided.

Best,
« Last Edit: June 17, 2023, 04:21:12 pm by mawyatt »
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 
The following users thanked this post: newbrain

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28711
  • Country: nl
    • NCT Developments
Re: Microcontroller Development Advise
« Reply #1 on: June 17, 2023, 04:21:24 pm »
If you don't want to get deep into programming and cost is not an issue, then look at a PLC with HMI. Your requirements are well within the realm of what is possible using a PLC and these have straightforward to use development tools.

Otherwise just use an RPi compute module with some controls bolted onto it. Use Python + Qt to build a GUI.

Creating a GUI that works reasonably on a microcontroller with less resources means going through the learning curve of programming C, dealing with graphics libraries, implement a means to deploy updates, connectivity, etc.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 4328
  • Country: us
Re: Microcontroller Development Advise
« Reply #2 on: June 17, 2023, 04:49:21 pm »
The RPi is the option we've been considering since we are familiar with them. Just need to create a setup that boots up upon power application.

Will take a look at PLC, hadn't considered those, thanks!!

Best,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28711
  • Country: nl
    • NCT Developments
Re: Microcontroller Development Advise
« Reply #3 on: June 17, 2023, 05:06:15 pm »
Making something start automatically on a Linux system is not super difficult using systemd. If a device has a GUI, there has to be a dependence on the graphics system running with having the user logged in automatically.

Random Google find:
https://www.makeuseof.com/what-is-systemd-launch-programs-raspberry-pi/
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline eugene

  • Frequent Contributor
  • **
  • Posts: 519
  • Country: us
Re: Microcontroller Development Advise
« Reply #4 on: June 17, 2023, 05:37:23 pm »
I would not recommend a Raspberry Pi if you need precise control of timing. Maybe a RPi Pico....

From your description, it sounds like almost any microcontroller can do what you want, even the simplest Arduino or Arduino-like development board. To save development time, you might as well program it as an Arduino and take advantage of libraries to control the LCD, though that wouldn't be hard to do bare metal either. I'm fond of Teensies from pjrc.com, but I also bought a bag of Pro Micro clones on Aliexpress for something like $2 each. They would be more than adequate - and probably easier to make work than a Raspberry Pi.
90% of quoted statistics are fictional
 

Online woofy

  • Frequent Contributor
  • **
  • Posts: 412
  • Country: gb
    • Woofys Place
Re: Microcontroller Development Advise
« Reply #5 on: June 17, 2023, 05:41:34 pm »

.. altho did play around with Arduino a little.

.. but the main point is a good, simple, easy to learn and use development platform to work from.


There you go then, you've answered your own question.
I would have thought almost any arduino + an spi lcd module will do the job.

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3324
  • Country: ca
Re: Microcontroller Development Advise
« Reply #6 on: June 17, 2023, 05:49:36 pm »
LCD is obviously the biggest part to handle. That's huge variety here ranging from simple text to complex graphics etc. Otherwise, any MCU with enough pins will do.

If it really doesn't matter whether it costs $2 or $100, no consideration for size or power consumption, then there's no criteria to select. Get whatever you're more familiar with.

Although 300 pieces at $100 will cost $30k. That's more than enough to hire someone who would design an efficient solution for you.
 

Online dobsonr741

  • Frequent Contributor
  • **
  • Posts: 713
  • Country: us
Re: Microcontroller Development Advise
« Reply #7 on: June 17, 2023, 06:17:17 pm »
if you want the buy the platform ready for low code solutioning here is one: https://www.unihiker.com/
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 9653
  • Country: fi
Re: Microcontroller Development Advise
« Reply #8 on: June 17, 2023, 06:20:08 pm »
Arduino plus a display module which comes with an easy-to-use library is not a bad idea: availability is good (including all the clones) and you are already familiar with it. For more complex projects or professional workflows, you can then move away from the Arduino ecosystem gradually, but it sounds like your project is achievable even with the limitations of Arduino libraries, and the ease of use is a plus for you if you are a newbie. Another advantage is you'll be able to find helping hands quite easily because nearly everyone has played around with Arduinos.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28711
  • Country: nl
    • NCT Developments
Re: Microcontroller Development Advise
« Reply #9 on: June 17, 2023, 06:48:12 pm »
I would not recommend a Raspberry Pi if you need precise control of timing. Maybe a RPi Pico....
You forget that SoCs like the ones used on the RPi have peripherals like you find on microcontrollers. Including hardware timers. On top of that it isn't hard to write a kernel module that reacts to a timer interrupt. This way you can create pretty decent response times from software as well.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline eugene

  • Frequent Contributor
  • **
  • Posts: 519
  • Country: us
Re: Microcontroller Development Advise
« Reply #10 on: June 17, 2023, 07:27:43 pm »
LOL. And you forget all of the OPs requirements.

I'm glad that you will never attend one of my design reviews.
90% of quoted statistics are fictional
 
The following users thanked this post: hans, dobsonr741

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Microcontroller Development Advise
« Reply #11 on: June 17, 2023, 07:57:05 pm »
Most any microcontroller family will have a part to meet these fairly modest specs. Depending on your packaging requirements, you might start with what screen you want and work backwards from there. If it "doesn't matter, so long as it's functional", there are ESP32 boards with integrated OLED displays on them for under $20. Pair that with a rotary encoder with a pushbutton switch and the other buttons you need and you could be under $25 in parts with minimal assembly. ESP8266 has 2 10-bit ADCs and ESP32's are 12-bit. You will probably spend most of the complexity in the project doing the level shifting/protection to shape and protect the analog inputs. Most everything else is entirely straightforward.

If you need more control over the appearance, making a custom PCB and mounting a micro to it is also not hard, time-consuming, or particularly expensive.

A 500microsecond pulse is still fairly long and none of the other timing items specified are anywhere close to difficult to achieve.

I did read that you don't need other connectivity and accept that at face value but will still observe that the ESP chips have WiFi and Bluetooth, which might represent a value-add if you want to do computer or smartphone control either now or down the road.
« Last Edit: June 17, 2023, 07:58:48 pm by sokoloff »
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28711
  • Country: nl
    • NCT Developments
Re: Microcontroller Development Advise
« Reply #12 on: June 17, 2023, 08:51:03 pm »
ESP8266 has 2 10-bit ADCs and ESP32's are 12-bit. You will probably spend most of the complexity in the project doing the level shifting/protection to shape and protect the analog inputs. Most everything else is entirely straightforward.
The ADCs in the ESP  chips are utter crap. It takes a whole lot of software and some extra hardware (reference input) to get some to something somewhat useful but there still is a fairly large piece of the lower / upper range you can't use.
« Last Edit: June 17, 2023, 08:52:57 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1725
  • Country: 00
Re: Microcontroller Development Advise
« Reply #13 on: June 17, 2023, 08:56:14 pm »
I think any technical solution is a product of their developer skillsets. An optimum in terms of bill of material costs or other "overheads" cannot always be reached unless development may take infinite resources. Using a SoC from a RPi is grossly overkill for the task at hand. But also tricky because desktop OS'es aren't intended for precise timing. That does not mean it cannot be done, but breaking out kernel modules to generate a 500u-5ms pulse is bonkers if OP is also clearly asking something thats managable for someone thats reasonably new to programming and microcontrollers.

Likewise I would argue the PLC is similarly bad idea. It may be fine for a handful of deployments, but OP is talking literally hundreds. Even if a cheap PLC costs 200$, if you need to purchase 200 of them you can easily pay a consultant or engineer 30k$ in wages (probably a good 1-2 months engineering time) for a solution that costs only 50$. Given the broad requirements I don't think someone experienced will take 2 months to complete this. Someone new maybe more, but those hours are also put into new skills.

Generating a few pulses and driving a LCD display is a manageable task even for a beginning developer with embedded systems. I'd recommended sticking to the Arduino eco system. ESP32 can also be programmed with the Arduino IDE, but you'll need to install their SDK. But Arduino Uno is perhaps the easiest to start.

Using Arduino has the benefit of a vast selection of libraries. I think this is most useful for a LCD display. If you want something graphic, I'm sure there are libraries for Arduino that can do a lot of the heavy lifting for you, and provide examples on how to write text on screens with fonts etc.  There are tons of LCD display shields and modules that work 2-wire I2C or 4-wire SPI. I'm not sure if the Uno is (best) suited with these libraries, because it only has 2K of RAM and thus cannot hold a framebuffer for a colour LCD of any usable size. Many people have moved beyond the Arduino Uno because of its memory limitations. However the beauty of Arduino is that you can quite easily migrate a sketch to a different Arduino-compatible board, such as a different Arduno board, or a ESP32 chip/module, or a Teensy.

Yes the ADC of the ESP32 is a bit crap. It has problems with rail-to-rail operation (offset and attenuation issues) and also IIRC linearity. It depends on the application though. If you need something a bit more accurate, you can also add an external ADC.

Although there is a lot of material on Arduino, its quality can vary. Some people may bash Arduino for this reason as "a proof-of-concept platform" at best. Although those arguments do have some merits, I don't think its an universal truth though. Like I said: different teams will develop different solutions to the same problem.

Choosing the right board can be a bit tricky. I'm not sure if longevity of a requirement is as well. Microcontrollers tend to stick around for quite a long time generally speaking, but if you were to buy a module such a Teensy, its an additional risk to see whether those boards also are still in stock, or are still being made. But at that point you could also look into designing your own PCB instead.
 

Online woofy

  • Frequent Contributor
  • **
  • Posts: 412
  • Country: gb
    • Woofys Place
Re: Microcontroller Development Advise
« Reply #14 on: June 17, 2023, 09:02:42 pm »
.. there are ESP32 boards with integrated OLED displays on them for under $20.
Yep, and the ESP32 can be programmed using the arduino environment, which is at least somewhat familiar to the OP. There are also lcd libraries available to make life easy.

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 709
  • Country: gb
    • Electronic controls
Re: Microcontroller Development Advise
« Reply #15 on: June 17, 2023, 09:19:03 pm »
Have a look at Arduino.
It comes with its own dev system.

I used to work for a Microchip consultancy so got stuck with PIC's.
 

Offline hubi

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
Re: Microcontroller Development Advise
« Reply #16 on: June 17, 2023, 10:35:33 pm »
What does medium resolution LCD mean to you? If that means 1024x768@24bpp, I would exclude small microcontrollers. If 320x240@16bpp is ok, I'd look at the Raspberry RP2040. I like the development environment, there are lots of examples, documentation and design resources. The chip has a poor ADC, but should meet your requirements. If you want, you can use the RP2040 with the arduino development environment, but the C/C++ SDK would be my preference by far. I really like the cmake based build system. There are fewer libraries available than for arduino, but I think you will find a graphics driver/display library pretty easily, e.g., TFT_eSPI and lvgl.

Also, it's cheap and available.
 
The following users thanked this post: nctnico

Online MK14

  • Super Contributor
  • ***
  • Posts: 5076
  • Country: gb
Re: Microcontroller Development Advise
« Reply #17 on: June 17, 2023, 11:04:15 pm »
New to microcontroller development and not that proficient in software/computer development in general, altho we have done some work with RPi and Python utilizing I/Os to drive various controls, and precision DACs and read back from precision ADCs and have used the SPI for some work. So basically a newb when it comes to microcontrollers, altho did play around with Arduino a little.

So we are looking for a development platform to develop a relatively simple microcontroller than can produce some specific I/O in the form of pulses and possible read back a few logic signals and maybe some analog input.

What we need the microcontroller to do is create a set of 8 sequential non-overlapping pulses of varying width (0.5 to 5ms), at a rate of ~4Hz to ~80Hz selectable. Another output is a selectable timer from ~60sec to ~1800sec. Everything is ~6 bit resolution, except the analog input at ~8bit resolution.

For UI a rotary dial, with a couple push buttons (Start, Stop, Select) and medium resolution small LCD. No need for USB or other type interfaces, or the need to upload firmware by the end user, and not concerned about protecting the design or code either, as it's going to be trivial anyway.

Per item/chip cost isn't an issue as these will likely be less than few hundred total units in production, but the main point is a good, simple, easy to learn and use development platform to work from.

We have accounts at Adafruit, Newark, Mouser, Digikey, and a few popular other sources.

Anyway, looking for advice from those microcontroller gurus that are well versed in this technology sector (read actually microcontroller developers), and please not the usual rhetoric from those no valued added folks.

Thanks in advance for any guidance/help provided.

Best,

Given your mention of specific past experiences.

I'd suggest considering the raspberry PI PICO range.  As already mentioned (RP2040), by other(s).

It can readily come with MicroPython, and your low frequency signal requirements, may be doable quickly (development time wise), with its commands and library functions.

It is a real microcontroller, rather than an OS based Linux system (which a full on Raspberry PI, such as the Raspberry PI 4), would be.  Full OS's, can cause timing issues (errors), which may affect your program too badly (specification dependent).  Generally they are not considered acceptable for genuine/tricky hardware tasks, if precise timing etc is needed.
6 bits might be doable (with an OS), but it tends to introduce lots of jitter (uncertainty), which is best avoided, in many cases.
Bare metal on a big PI is possible, but is usually best left for experts in software, with huge amounts of time on their hands.  Whereas bare metal on a PI PICO is standard.

Also, increasingly these days it (The PI PICO), can be treated/programmed, as if it was almost an Arduino, as it is included in the Arduino studio IDE and is used by enough people (arguably lots, relatively speaking), to have lots of searchable information and tons of included documentation.

Supply of the PICO devices, which is available in both a very economically priced development board, useable in products or as a bare chip, has been excellent, even when other things were in severely, short supply.  They didn't even seem to price gouge.

There are even a range of ready made (somewhat plug in or connectable) accessories, such as displays and all sorts of things, at reasonable cost/quality, readily available.  A bit like the Arduino eco system.

It is available as a breadboard-able development board if wanted (header pins) and can include wi-fi and very recently bluetooth, built in as standard that can be useful, e.g. to ease development and debugging.  As you can readily connect it to stuff that way.

If things get tough with those timing signals, it has a (unfortunately rather complicated to program) PIO unit, which can handle very precise, complicated timing signals and other stuff.  Think of it as being an extremely tiny software like FPGA I/O peripheral.

Its downsides, are it doesn't have that much I/O stuff on the chip, limited number of I/O pins, and always needs an external flash (QSPI) chip, if going bare MCU chip.  It does have an A to D converter, but it is not an especially good one.

N.B. There are many other solutions, which also can have merits.  I've described only one possible solution/family.
« Last Edit: June 17, 2023, 11:12:17 pm by MK14 »
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Microcontroller Development Advise
« Reply #18 on: June 18, 2023, 12:42:32 am »
ESP8266 has 2 10-bit ADCs and ESP32's are 12-bit. You will probably spend most of the complexity in the project doing the level shifting/protection to shape and protect the analog inputs. Most everything else is entirely straightforward.
The ADCs in the ESP  chips are utter crap. It takes a whole lot of software and some extra hardware (reference input) to get some to something somewhat useful but there still is a fairly large piece of the lower / upper range you can't use.
That seems like it could be a pretty good fit when the product brief includes "and [possibly] read back a few logic signals and maybe some analog input."
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28711
  • Country: nl
    • NCT Developments
Re: Microcontroller Development Advise
« Reply #19 on: June 18, 2023, 01:19:27 am »
What does medium resolution LCD mean to you? If that means 1024x768@24bpp, I would exclude small microcontrollers. If 320x240@16bpp is ok, I'd look at the Raspberry RP2040. I like the development environment, there are lots of examples, documentation and design resources. The chip has a poor ADC, but should meet your requirements. If you want, you can use the RP2040 with the arduino development environment, but the C/C++ SDK would be my preference by far. I really like the cmake based build system. There are fewer libraries available than for arduino, but I think you will find a graphics driver/display library pretty easily, e.g., TFT_eSPI and lvgl.
I think that route will still have a steep learning curve before you have a product you can deploy / sell without worries. I'm doing a project using an ESP32 right now and I need to dig deep into the build system here and there to make it do what I want (100% instead of the 99% that comes out of the box). Information found online is often outdated and/or incomplete.

Depending on timeline and budget it may make sense to start with something that has a more polished environment like a module that runs Linux (doesn't need to be a Rpi) and has some means to generate the signals in an easy way. Especially if the UI has to look good on a display with a reasonably high resolution. For a couple of 100 units it may make sense financially to go for a full-custom design based on a SoC or microcontroller but such a project takes quit a bit of time to finish (at least 9 months lead time just for development; time flies while testing & tweaking). And then you might need FCC / safety certifications as well. Using pre-certified hardware like a PLC suddenly looks like a quick way out...
« Last Edit: June 18, 2023, 01:27:36 am by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline DrGeoff

  • Frequent Contributor
  • **
  • Posts: 794
  • Country: au
    • AXT Systems
Re: Microcontroller Development Advise
« Reply #20 on: June 18, 2023, 01:26:19 am »
A PIC18 and an OLED display? The rest of the I/O is simple.
Was it really supposed to do that?
 

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 4328
  • Country: us
Re: Microcontroller Development Advise
« Reply #21 on: June 18, 2023, 01:34:01 am »
The RPi Pico and the RD2040 were a couple we had considered, but not the ESP32 which we'll look into.

To add some additional information, the "System".

Will need to display some text, a few lines, although needs to readable from 3~6 feet, so a small resolution LCD but larger area should suffice. A custom PCB is planned, as there's lots more "stuff" involved, like high current drivers for each pulse phase as well as overcurrent sensing and lockout (safety) precautions.

Later planned is having a multi-level final pulse for each phase where a high voltage and current is forced into the inductive loads, then quickly tapering off and decaying to a much lower holding level holding current, thus keeping the load and driver dissipation down. The timing of these multi-levels is yet to be determined, but the overall pulse-width and rep rate are roughly the same as previously mentioned. So each of the 8 pulse lines may need to be PWM to achieve the desired driver waveform decaying feature. As of now the concept involves creating the desired waveform in the HV and HC driver with PWM on each of the 8 pulse lines, with a shorter initial pulse, then a couple additional narrow pulses to create the holding current effect. We don't know enough about the various "loads" yet to have a good picture of what this waveform needs to be, and may need to be selectable for specific "loads". However, this is a much higher end System that will be at a Premium, and require another custom PCB and supporting components.

One note, we could have farmed this out and had a true pro create the controller, but we saw this as an opportunity as a means to learn something about microcontrollers and because we are semi-retired our time isn't as valuable as when directly billable while previously employed......and not having to create significant valued added for senior executives quarterly bonuses ???

Anyway, thanks folks for all the good information and discussions :-+

Best,

« Last Edit: June 18, 2023, 01:37:29 am by mawyatt »
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2288
  • Country: au
Re: Microcontroller Development Advise
« Reply #22 on: June 18, 2023, 05:46:34 am »
Will need to display some text, a few lines, although needs to readable from 3~6 feet, so a small resolution LCD but larger area should suffice.
So this may be best as two modules ?

You could start with common character LCD modules cheap, and available in larger glass models for better distance reading.
one example  https://www.aliexpress.com/w/wholesale-large-character-LCD-i2c.html
Then you can decide if you need to add more time/effort/cost to a fancier display
example https://www.aliexpress.com/item/1005005297304786.html


New to microcontroller development and not that proficient in software/computer development in general, altho we have done some work with RPi and Python utilizing I/Os to drive various controls, and precision DACs and read back from precision ADCs and have used the SPI for some work. So basically a newb when it comes to microcontrollers, altho did play around with Arduino a little.

So we are looking for a development platform to develop a relatively simple microcontroller than can produce some specific I/O in the form of pulses and possible read back a few logic signals and maybe some analog input.

What we need the microcontroller to do is create a set of 8 sequential non-overlapping pulses of varying width (0.5 to 5ms), at a rate of ~4Hz to ~80Hz selectable. Another output is a selectable timer from ~60sec to ~1800sec. Everything is ~6 bit resolution, except the analog input at ~8bit resolution.
.....
A custom PCB is planned, as there's lots more "stuff" involved, like high current drivers for each pulse phase as well as overcurrent sensing and lockout (safety) precautions.

Later planned is having a multi-level final pulse for each phase where a high voltage and current is forced into the inductive loads, then quickly tapering off and decaying to a much lower holding level holding current, thus keeping the load and driver dissipation down. The timing of these multi-levels is yet to be determined, but the overall pulse-width and rep rate are roughly the same as previously mentioned. So each of the 8 pulse lines may need to be PWM to achieve the desired driver waveform decaying feature. As of now the concept involves creating the desired waveform in the HV and HC driver with PWM on each of the 8 pulse lines, with a shorter initial pulse, then a couple additional narrow pulses to create the holding current effect. We don't know enough about the various "loads" yet to have a good picture of what this waveform needs to be, and may need to be selectable for specific "loads". However, this is a much higher end System that will be at a Premium, and require another custom PCB and supporting components.
That's starting to sound like a programmable waveform generator, which could need a MCU with a bit more RAM.

I'd start with that you already know, and try multiple paths.
Find which is easiest to get working.

The RPi may be to unwieldly, but the Pi-Pico + python might be quick enough.
A generic Ardunio may be 'good enough' ?

or, you might like to try to get your hands on the new Arduino UNO R4  using 5V Renesas RA4M1 (Arm Cortex®-M4)
5V is good for gate driving power MOSFETS

https://www.elecrow.com/blog/new-arduino-uno-r4-coming-in-may-upgraded-configuration-with-usb-c-and-wi-fi-support.html


 
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3324
  • Country: ca
Re: Microcontroller Development Advise
« Reply #23 on: June 18, 2023, 02:27:02 pm »
Will need to display some text, a few lines, although needs to readable from 3~6 feet, so a small resolution LCD but larger area should suffice. A custom PCB is planned, as there's lots more "stuff" involved, like high current drivers for each pulse phase as well as overcurrent sensing and lockout (safety) precautions.

You don't need much CPU power to control a text LCD - the LCD will have its own controller, you only need to pass some commands and the text.
 
Later planned is having a multi-level final pulse for each phase where a high voltage and current is forced into the inductive loads, then quickly tapering off and decaying to a much lower holding level holding current, thus keeping the load and driver dissipation down. The timing of these multi-levels is yet to be determined, but the overall pulse-width and rep rate are roughly the same as previously mentioned. So each of the 8 pulse lines may need to be PWM to achieve the desired driver waveform decaying feature. As of now the concept involves creating the desired waveform in the HV and HC driver with PWM on each of the 8 pulse lines, with a shorter initial pulse, then a couple additional narrow pulses to create the holding current effect. We don't know enough about the various "loads" yet to have a good picture of what this waveform needs to be, and may need to be selectable for specific "loads". However, this is a much higher end System that will be at a Premium, and require another custom PCB and supporting components.

RPi is totally unsuitable for this. Get a real MCU. If you want to use PWM you can do it with PWM modules (which generate precise PWM pulses for you), for which you would need an MCU with 8 PWM modules. Or, you can bit-bang your pulses without PWM modules. If it's hard for you to do all 8 channels from one MCU, you can have 8 very small MCUs each controlling a single FET driver. These small MCUs then can be controlled from a master MCU.

One note, we could have farmed this out and had a true pro create the controller, but we saw this as an opportunity as a means to learn something about microcontrollers and because we are semi-retired our time isn't as valuable as when directly billable while previously employed......and not having to create significant valued added for senior executives quarterly bonuses ???

Do it. Forget the Python stuff, get a real MCU and learn to program in C. This is not a rocket science, and is much easier to do than you think. Take practical (i.e. how do I do it?) as opposed to esoteric (i.e. what is the prescribed way to do it?) approach to shorten your learning curve. Remember that your goal is to learn something, as opposed to getting results without learning. Move in small steps (as small as you can make them). May be it'll take couple weeks, but the result will be way more reliable and manageable.
« Last Edit: June 18, 2023, 02:30:03 pm by NorthGuy »
 
The following users thanked this post: Siwastaja, sokoloff

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9985
  • Country: us
Re: Microcontroller Development Advise
« Reply #24 on: June 18, 2023, 03:39:26 pm »
I would do the development on an Arduino UNO for the libraries.  For production, I would design a specific purpose PCB and use the ATmega328 chip with the same code and libraries.  Everything that can be done with the Arduino has already been done and the projects are all over the Internet.

The Pi Pico with Micro-Python is a really good choice but I don't know if the infrastructure has all of the required libraries.  I  like the Micro-Python approach but I don't have a lot of experience with it.  The boards are small enough that your end product could be an interface PCB and a mounted Pico.

I'm starting to like the Micro-Python thing but C++ works on the Pico as well.
 
The following users thanked this post: MK14


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf