Author Topic: What MCU Chip to Use for a 8-Cell individ. NiMH Roundcell Charger/Analyzer?  (Read 2836 times)

0 Members and 1 Guest are viewing this topic.

Offline SuzyCTopic starter

  • Frequent Contributor
  • **
  • Posts: 792
Due to the MCU part nofindum crisis of the prev. two years I had to make do with parts on hand.
I decided to spend a few days building a 2x9V plus 4x roundcell NiMH cell charger/analyzer in my spare time, but failed to have on hand a single MCU that could handle the number of I/O, A2D, PWM, User GUI required.

So, I built a chimera of three MCU's working together. One Infineon 5V PSOC4200 ARM (>40 I/O if not using 16-chan 12-bit A2D) stamp for PWM and charging, One 16F 28-pin PIC for monitoring cell temperature, and finally a 40-pin 18F PIC for GUI to achieve a ticker tape 7-digit x 7-seg Bubba Mplx'd LED display and also deal with the many button switches, 10-status LEDs, and 9V charging status. All three chips communicate with each other using RS-232 links with the 40-pin 64mHz PIC18F45K22 being the Master.

I finished this task in free-time over a month or so and now it works 100%, works exactly as I wanted, but I would like to try to first use a approx 100-pin or so single MCU to handle the job to(but also now 8 round cells +2x 9V)eliminate the communication problem and simplify any debug/modify pgm process.
My Analyzer device will:
1) measure/setup/change/display charge mAH, Discharge mAH, charging temperature rise/limit, charge time, also meas. cell internal Res. Also want to have a two way charge status indication, test cells. For charge, monitor voltage, current, temperature of each of the 8-roundcells. 9V rect. bats are easy to charge and analyze when charging is accomplished slowly.
2)Develop a simple(maybe just same multi-7-seg LED) display, quick view status LEDs plus use a multi-touch sw. GUI.

I know nothing about working with STM or NTX MCUs, but maybe a dirt cheap dev. board(stamp?) on Alibaba that fit the bill. It will be a small challenge just to make a decision to select the best chip and a greater challenge to learn how use the tool chain.
3)I find it so easy to work with PDIP 5V Vdd MCU's, have no experience on how to migrate to 3.6V max Vdd MCU's.

What is the best/easy way:
1)Trying to work with PIC's pay for use compilers and just use a PIC32 chip?
2)Spend months learning how to be able to understand how to competitively choose and use (very different from PIC's)  STM or NXP tool chains to config a STM or NXP chip?
« Last Edit: December 08, 2023, 03:59:42 am by SuzyC »
 

Online kripton2035

  • Super Contributor
  • ***
  • Posts: 2626
  • Country: fr
    • kripton2035 schematics repository
Re: What MCU Chip to Use for a 8-Cell NiMH battery analyzer?
« Reply #1 on: December 07, 2023, 06:20:50 pm »
there are PSOCs with 100 I/O pins ...
 
The following users thanked this post: SuzyC

Offline SuzyCTopic starter

  • Frequent Contributor
  • **
  • Posts: 792
Re: What MCU Chip to Use for a 8-Cell NiMH battery analyzer?
« Reply #2 on: December 07, 2023, 06:35:09 pm »
100 pins or so..
But I need to get to charge any one or multiple size cell individually and asynchronously of others. 
8x 12-bit A2D for round cell voltages
2x min 10-bit A2D for 9V NiMH batteries
8x  min 10-bit A2D for cell current
9x min 10-bit  A2D for cell temp
7 I/O for 7-dig 7-seg LED disp. common anodes
8 I/O  for 7-seg LED Segs incl decpoint
9 I/O for touch Sw's
1 I/O for Power ON
12-single LEDs for quick-at-a-glance blinking indicators of charging status, etc.

Be able to develop 100-pins using a single mini dev bd/ dev stamp?
« Last Edit: December 07, 2023, 07:01:49 pm by SuzyC »
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16743
  • Country: us
  • DavidH
Re: What MCU Chip to Use for a 8-Cell NiMH battery analyzer?
« Reply #3 on: December 08, 2023, 01:00:03 am »
Is there some reason that it must be a single chip design?  I would add external I/O expansion to a more limited microcontroller.  I find it advantageous to locate I/O closer to where it will be used.
 
The following users thanked this post: SuzyC, tooki

Offline IOsetting

  • Regular Contributor
  • *
  • Posts: 60
  • Country: cn
Re: What MCU Chip to Use for a 8-Cell NiMH battery analyzer?
« Reply #4 on: December 08, 2023, 01:35:41 am »
7 I/O for 7-dig 7-seg LED disp. common anodes
8 I/O  for 7-seg LED Segs incl decpoint
9 I/O for touch Sw's
1 I/O for Power ON
12-single LEDs for quick-at-a-glance blinking indicators of charging status, etc.
Since these won't need high speed, maybe you can use something like 74HC595 and 74HC165 to expand these IO?
Then you need only 6 pins to drive these 37 IOs.
« Last Edit: December 08, 2023, 01:46:31 am by IOsetting »
 
The following users thanked this post: SuzyC, tooki

Offline SuzyCTopic starter

  • Frequent Contributor
  • **
  • Posts: 792
Re: What MCU Chip to Use for a 8-Cell NiMH battery analyzer?
« Reply #5 on: December 08, 2023, 02:53:20 am »
DavidHess/Amyk..I have much examined your expansion idea very carefully.

It is not too much a pin count nor cost jump to replace a 74HC595 SR with an actual PIC/STM/NXP 14 to 40-pin MCU footprint to get better results with much easier to follow coding to achieve 7-seg multiplexed 7-digit displays, but I want to put all my eggs in one small basket. I am quite aware that adding non-mcu dumb peripheral chips requires carefully attention/balancing in regard to code loop execution time, task scheduling and interrupt servicing to achieve flicker-free many-dig mtplxed displays and quickly responsive control buttons with debounce code. I also want a smaller PCB footprint, means less parts on a smaller PCB.

Of course, since I have already have the working code for a 3-MCU solution for simultaneously async charge/analyze 4-NiMH roundcells plus 2 9V bats, I could just use two <100 pin MCUs and modify code to make a virtual all-in-one device for a 8-roundcell + two 9V analyzer, thus eliminating the two other slave MCUs I am using now and their associated data/cmd syncing with the master MCU.
CON:  The existing mult-7 Seg display would have to be shared by the two MCU's.
« Last Edit: December 08, 2023, 03:57:56 am by SuzyC »
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8314
Re: What MCU Chip to Use for a 8-Cell NiMH battery analyzer?
« Reply #6 on: December 08, 2023, 03:14:52 am »
Do you really need at least 27 ADC channels on the MCU itself? An analog multiplexer or two would be sufficient.
 

Online kripton2035

  • Super Contributor
  • ***
  • Posts: 2626
  • Country: fr
    • kripton2035 schematics repository
you could use i2c to talk to a display with some TM1638 chips, and so remove a lot of I/O
and it would still be flicker free...
 
The following users thanked this post: SeanB

Offline Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 90
  • Country: es
Re: What MCU Chip to Use for a 8-Cell NiMH battery analyzer?
« Reply #8 on: December 08, 2023, 04:12:01 pm »
100 pins or so..
But I need to get to charge any one or multiple size cell individually and asynchronously of others. 
8x 12-bit A2D for round cell voltages
2x min 10-bit A2D for 9V NiMH batteries
8x  min 10-bit A2D for cell current
9x min 10-bit  A2D for cell temp
7 I/O for 7-dig 7-seg LED disp. common anodes
8 I/O  for 7-seg LED Segs incl decpoint
9 I/O for touch Sw's
1 I/O for Power ON
12-single LEDs for quick-at-a-glance blinking indicators of charging status, etc.

Be able to develop 100-pins using a single mini dev bd/ dev stamp?

If I were going to design such an appliance,  I'd go using the KISS principle. There's methods for reducing interface pin count, thought for low pin count MCUs but also valid when you have a high amount of signals interfacing a mainstream IC.

But, your design has certain constraints that I won't tie to. For example, I would get rid of the vintage Bubble thing and fit 7 single digit 7seg display, no matter whether common anode or cathode (but all of them of the same type). Then you can control the full set of leds, both display and single indicators. Using Charlieplexing with 9 GPIOs (something somehow easy to achieve throught code) you can control 9 sets of 8 leds at 1/9th duty cycle per set, that means controlling full segments of 7 single digit displays plus 2 groups of 8 individual leds = up to 16 indicators.

You know? If you don't need multiple keypresses, you can use just one IO for reading all switches by using a very simple resistor matrix and an analog ADC read. In fact, you can adjust resistor values to be able to read 2 or more simultaneous keypresses.

Assuming you don't need to share grounds of NTCs, you can use the already used IOs for the charlieplex scanning as multiplexed ground references for all the temperature sensors, then you will need just one ADC input...

Take a look at these tricks. You might know many of them as you have already programmed PICs.

https://ww1.microchip.com/downloads/en/devicedoc/01146b.pdf
 

Offline SuzyCTopic starter

  • Frequent Contributor
  • **
  • Posts: 792
Krypton2035:  Thanks for helping:
PRO: I see clearly how adding a dedicated TM1638 chip for the LED display reduces  the master MCU I/O pin count use.
CONs:
1) Added cost of chip.
2) Flickering problems if a 7-Seg x 8 dig display is actually a tickertape display.
3) Addition PCB layout time cost of TM1638
4) Increases overall size of PCB
5) Rather than use the TM1638, for the same cost, a MCU using a single serial pin makes a flicker free display(but still has CONs 1,3-4)
6) Would have to spend the time to debug/tune/rewrite a fine-tuned tickertape display code already perfected.
« Last Edit: December 08, 2023, 07:32:56 pm by SuzyC »
 

Offline SuzyCTopic starter

  • Frequent Contributor
  • **
  • Posts: 792
Re: What MCU Chip to Use for a 8-Cell individ. NiMH Roundcell Charger/Analyzer?
« Reply #10 on: December 08, 2023, 05:12:14 pm »
 Sacodepatatas: Many thanks for your detailed advice!
I am not sure exactly what you mean by Charlieplexing, a circuit drawing (even on a piece of a dinner napkin) is worth a thousand words!
Right now I am using BubbaPlexing, simply means I connect  each Common Anode to a MCU pin, one resistor needed.
All LED disp digits segment connects directly to its own MCU pin, no resistor needed.

Is this what you mean?

Works perfectly and truly difficult to see brightness variations due to number of segments active.
----
Analog Key Mtplxing:
PRO:  Only requires one A2D pin to read up to about 10 SW's.

CONS:  I built an UV scanner using this technique and after about a few months the resistance of common miniature though-hole
switches(like the type used in VCR's etc) developed a very high contact resistance requiring me to press really hard repeatedly to get some SW's to work, but even so, some of the switches would not work at all.
----
Charlieplxing A2D: Cannot understand exactly what you describe here. Again, a simple schematic posted would disambiguate what you are describing.

-----
Finally, I want everyone to know that I want to make devices that are high-quality, reliable, and long lasting.
I choose to fab my own individual roundcell analyzer because the cost of an industrial unit was very high(and I like building my own projects). I want my custom equip. to be of greater quality and performance than stuff sold to consumers.

I try not saving pennies in parts only to lose dollars in performance, capability, ease of repair and operation, and reliability.


I will use novel circuits that can achieve my goals to reduce BOM size and cost without sacrificing performance and reliability.
« Last Edit: December 08, 2023, 07:26:24 pm by SuzyC »
 

Online kripton2035

  • Super Contributor
  • ***
  • Posts: 2626
  • Country: fr
    • kripton2035 schematics repository
Re: What MCU Chip to Use for a 8-Cell individ. NiMH Roundcell Charger/Analyzer?
« Reply #11 on: December 08, 2023, 05:57:49 pm »
10 x TM1638 cost around $2 shipped ... so they will not increase the BOM that much ?
and I don't see how you can have flickering problem with this chip: it handles all the refreshing for you...
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16743
  • Country: us
  • DavidH
Re: What MCU Chip to Use for a 8-Cell NiMH battery analyzer?
« Reply #12 on: December 08, 2023, 06:15:49 pm »
It is not too much a pin count nor cost jump to replace a 74HC595 SR with an actual PIC/STM/NXP 14 to 40-pin MCU footprint to get better results with much easier to follow coding to achieve 7-seg multiplexed 7-digit displays, but I want to put all my eggs in one small basket. I am quite aware that adding non-mcu dumb peripheral chips requires carefully attention/balancing in regard to code loop execution time, task scheduling and interrupt servicing to achieve flicker-free many-dig mtplxed displays and quickly responsive control buttons with debounce code. I also want a smaller PCB footprint, means less parts on a smaller PCB.

I am considering replacing simple expansion using the 74HC595 SIPO and 74HC165 PISO shift registers with a moderate pin count microcontroller like the PIC or AVR which is actually less expensive.
 

Offline SuzyCTopic starter

  • Frequent Contributor
  • **
  • Posts: 792
Re: What MCU Chip to Use for a 8-Cell individ. NiMH Roundcell Charger/Analyzer?
« Reply #13 on: December 08, 2023, 06:47:05 pm »
Krypton2035:  My bad, actually I should say the smooth tickertape display char pacing/char stepping could be affected(slightly out of a constant char shift step rate), not dig brightness.

Again, adding an additional chip only leads to greater PCB footprint/complexity and cost and goes against a goal of eliminating 2 of the MCU's.
« Last Edit: December 08, 2023, 06:50:24 pm by SuzyC »
 

Offline SuzyCTopic starter

  • Frequent Contributor
  • **
  • Posts: 792
Re: What MCU Chip to Use for a 8-Cell individ. NiMH Roundcell Charger/Analyzer?
« Reply #14 on: December 08, 2023, 06:59:36 pm »
I did find some Infineon >64 pin ARM M0+ MCU's maybe in hand-solderable batwing flatpack pkg in stock at Mouser that could do the job, even if there is future availability questions. Not to mention a single piece price ~35 USD not including 30USD special charge penalty to ship a small order.

Does anyone know of a 5V STM or NXP dev board available?
« Last Edit: December 08, 2023, 07:16:03 pm by SuzyC »
 

Offline nali

  • Frequent Contributor
  • **
  • Posts: 664
  • Country: gb
Re: What MCU Chip to Use for a 8-Cell individ. NiMH Roundcell Charger/Analyzer?
« Reply #15 on: December 08, 2023, 07:03:00 pm »
----
Analog Key Mtplxing:
PRO:  Only requires one A2D pin to read up to about 10 SW's.

CONS:  I built an UV scanner using this technique and after about a few months the resistance of common miniature though-hole
switches(like the type used in VCR's etc) developed a very high contact resistance requiring me to press really hard repeatedly to get some SW's to work, but even so, some of the switches would not work at all.
----

Your switch problems here sound very much like a wetting current issue where you're not breaking through the oxide layer on the contacts. You can mitigate this with small value capacitors across each switch to provide a current surge when contacts close.
 

Offline SuzyCTopic starter

  • Frequent Contributor
  • **
  • Posts: 792
Re: What MCU Chip to Use for a 8-Cell individ. NiMH Roundcell Charger/Analyzer?
« Reply #16 on: December 08, 2023, 07:08:18 pm »
Nali: Thanks, I have tried that, but this is a fixup rather than a design choice and this fixup allows me to futz around for minutes to "freshen" the Sw's. I'll pass on that!

The idea does work for a while, the few the Sw's  the better, but I don't want to design in likely goofy Sw operation into my analyzer.

I would really like to migrate my design to only use perfect touch switches and Infineon MCU's claim to be best at this.
« Last Edit: December 08, 2023, 07:20:41 pm by SuzyC »
 

Offline Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 90
  • Country: es
Re: What MCU Chip to Use for a 8-Cell individ. NiMH Roundcell Charger/Analyzer?
« Reply #17 on: December 08, 2023, 08:11:50 pm »
Sacodepatatas: Many thanks for your detailed advice!
I am not sure exactly what you mean by Charlieplexing, a circuit drawing (even on a piece of a dinner napkin) is worth a thousand words!
Right now I am using BubbaPlexing, simply means I connect  each Common Anode to a MCU pin, one resistor needed.
All LED disp digits segment connects directly to its own MCU pin, no resistor needed.

Is this what you mean?


What you depict is a classic matrix multiplexing. By other hand, Charlieplexing takes advantage of the tristate capability of MCU IO ports (Hi output state, Lo output state, High Z input state), so you can turn on/off many more LEDs with just a few lines. But also it can be used for implementing many touch switches. Wikipedia has a very detailed page regarding Charlieplexing so that whatever i can write in here is much loose than what it is writen there. The manner of connecting individual digits is in a spiral fashion, that's why a multidigit display matrix can't be used (because they have all A segments, B segments, and so on, tied to the same pin). One can use 8 lines to drive up to 8 digits (without dot) or 9 lines to drive up to 9 digits with dot segment.



Here is how i did some years ago when i modified the popular 50MHz PIC16F628 frequency meter firmware to unfold the 5 digits display to control 8 digits by using just PORTB.




Charlieplxing A2D: Cannot understand exactly what you describe here. Again, a simple schematic posted would disambiguate what you are describing.

Charlieplexing is not just for LEDs,  a diode is required (because GPIOs will be forward or reverse polarizing some diodes while others can be left floating). But they can be BE diodes of NPN transistors. Let's figure out that NTCs are conected as the low side of a resistor divider (the middle point is what you connect  to the ADC). Just put one electrode of every NTCs connected to that ADC port, the other electrode of each NTC connected to the collector of each individual transistor that is going to be controlled by the charlieplexed matrix throught the respective B-E diodes. The transistor that is set as active, instead of lighting an LED, it leads the NTC to ground while the rest of NTCs are floating, not disturbing the measuring.

https://en.wikipedia.org/wiki/Charlieplexing
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3474
  • Country: it
Re: What MCU Chip to Use for a 8-Cell individ. NiMH Roundcell Charger/Analyzer?
« Reply #18 on: December 09, 2023, 06:39:10 am »
1)Trying to work with PIC's pay of use compilers and just use a PIC32 chip?

why? you have -O2 in free mode, that's more than enough
 
The following users thanked this post: bookaboo, woofy

Offline bookaboo

  • Frequent Contributor
  • **
  • Posts: 734
  • Country: ie
Re: What MCU Chip to Use for a 8-Cell individ. NiMH Roundcell Charger/Analyzer?
« Reply #19 on: December 09, 2023, 08:47:16 am »
Solid advice in this thread, just to add my experience.... Don't underestimate the hassle of switching devices and toolchains, unless you want to migrate anyway. I'd steer clear of jumping around platforms.

Also the Microchip compiler paid version (if you even need it which you probably don't) isn't that expensive monthly, just unsubscribe when the code is done. Of course if you want to mod then you have to sub again. Pain in the ass, but better than losing months of time on ST or NXP learning curve.
 

Offline Ground_Loop

  • Frequent Contributor
  • **
  • Posts: 650
  • Country: us
Re: What MCU Chip to Use for a 8-Cell individ. NiMH Roundcell Charger/Analyzer?
« Reply #20 on: December 09, 2023, 12:34:13 pm »
A MAX7219 will drive 8 7-seg digits flicker free with only 3 IO (SPI clock, data, and chip select).  They can also be daisy chained to basically an unlimited number of digits without additional IO.  SPI can be up to 10 MHz which will provide a very smooth ticker tape display.  Further, you can use these to also drive your status LEDS.  All LED IO can be reduced to 3 IO.  Cons 1, 3, 4 and 6 apply.
« Last Edit: December 09, 2023, 12:50:21 pm by Ground_Loop »
There's no point getting old if you don't have stories.
 

Offline 8goran8

  • Contributor
  • Posts: 30
  • Country: cs
Re: What MCU Chip to Use for a 8-Cell individ. NiMH Roundcell Charger/Analyzer?
« Reply #21 on: December 09, 2023, 08:30:03 pm »
There are many microchip PIC32 microcontrollers that meet your criteria.
Check out, for example, the PIC32CX SG41/SG60/SG61 family of microcontrollers.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 27188
  • Country: nl
    • NCT Developments
Re: What MCU Chip to Use for a 8-Cell NiMH battery analyzer?
« Reply #22 on: December 10, 2023, 12:20:32 am »
100 pins or so..
12-single LEDs for quick-at-a-glance blinking indicators of charging status, etc.
For the LEDs you could consider 'smart RGB LEDs' like these:
https://www.lumex.com/digital-led.html

You only need 1 data line from an SPI interface (sending 3 bits for each bit of LED data to meet the pulse width data modulation scheme).
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf