Author Topic: How to manage 120*8*16 microcontrollers?  (Read 2544 times)

0 Members and 1 Guest are viewing this topic.

Offline JohanHoltbyTopic starter

  • Contributor
  • Posts: 30
How to manage 120*8*16 microcontrollers?
« on: June 02, 2019, 05:07:11 am »
Hi!
I'm designing a 40 ports Solid state relay switch and I need to monitor each port for voltage and current at about 1Ms/S. I would also like to store the streaming data in an SDRAM (3.3V compatible) for the last 8 seconds. So using a 128Mbit should do.

My initial idea is to use two 30-50 cent microcontrollers, one for current and one for voltage (one to high side and one to low side of the SSR driver) and then let them output 8bit each to the the memory pins and then have a third IC to control the Memory addressing. All this three would run in sync using some common clock source.

To add on this I will stack this boards. To about 8 boards in total and could probably have around 16 of this stacks.

So this would leave me with about 120 microcontrollers and that would give me three challenges:
Which bus should I use? I could decide to only communicate  with the Memmory chip that would reduce it to 40.
Since I will run sensitive analog signals through this board will I have problems or will it be solvable with a multi layer board?
How do I program them? Is JTAG dasychain the only option other that some switching needle bed?

Is there a better way to do it?
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: How to manage 120*8*16 microcontrollers?
« Reply #1 on: June 02, 2019, 10:21:04 am »
Hi. You are suggesting a 'polling' type scheme, where you store all the results in the RAM. This results in a bandwidth problem. Hence your questiin about whuch bus and protocol

Try changing the problem around. Instead of polling try a interrupt scheme.
In other words, only send information when there is a state change.
This should reduce the bandwidth if the state/current/voltage does not change often.

This will allow lower requirements for the bus and protocol.
 
The following users thanked this post: JohanHoltby

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: How to manage 120*8*16 microcontrollers?
« Reply #2 on: June 02, 2019, 12:18:07 pm »
128Mbit * 120 micros = 15360Mbit/s = 15Gbit/s
call me crazy but at a lot of places you can't get more than Gigabit internet ... your application requires 2 10Gbit connections. that's just to put things in perspective. why do you want to sample at such a high rate for 40 ports at the same time? even then, why would you want to share that data with another computer / MCU / etc. ?

the only thing I can think of would be an electronic fuse for over voltage / over current protection but that doesn't require sharing that info  :-//
 
The following users thanked this post: JohanHoltby

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 9327
  • Country: fi
Re: How to manage 120*8*16 microcontrollers?
« Reply #3 on: June 02, 2019, 12:54:59 pm »
By solid state relay, you mean power line AC?

Are you really sure you want to sample at such rate? What information are you expecting to see at such high frequencies?
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 7001
  • Country: ca
Re: How to manage 120*8*16 microcontrollers?
« Reply #4 on: June 02, 2019, 02:37:03 pm »
Im doing almost the same thing with 3x usb NiDac  16 input ports (each),  i monitor rf output of the boards i test, they are medical grade/certified boards.

It consume lots of ressources to get the job going, i had to slower the sample rate, now at 1 measurment in 3 seconds interval each board, i was doing it a 1 sec intervals  loll  and save the log into a text file and a bitmap for ISO purposes ...

The only safety i use is: a countdown timer, it will cut off all the tests past the software programmed cycle, and for added protection, all the DC supplies line are short protected and fused in case of ...

I do this on a dual core pc 4gb ram with an oooold windows XP  loll  The software was custom made for us, but no updates since :(


And  as other replied, why do you need to measure up to 1ms/sec  ???  is it too critical ??
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 9327
  • Country: fi
Re: How to manage 120*8*16 microcontrollers?
« Reply #5 on: June 02, 2019, 02:47:13 pm »
For such systems, it's not a bad idea to use distributed simple serial (SPI, for example) ADCs, and use a large FPGA with a lots of IO to collect and packetize the data for whatever high-BW output medium. If necessary, you can use digital isolators easily in the SPI links.

Pre-analysis, filtration and compression on FPGA could make data reduction possible, allowing standard gigabit ethernet or USB to be used even if the amount of input data is much more.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14117
  • Country: gb
    • Mike's Electric Stuff
Re: How to manage 120*8*16 microcontrollers?
« Reply #6 on: June 02, 2019, 03:02:33 pm »
General rule - only use multiple MCUs when there are really good reasons to - it's always more complicated and debugging can be a nightmare.

The scheme you propose is just crazy unless maybe you need galvanic isolation- using a single MCU to do everything will be much, much easier. If you need isolation.

BTW you can get 64Mbit SPI SRAMs, which will be much easier to drive than SDRAM :
https://lcsc.com/product-detail/RAM_VTI7064MSME_C139966.html
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: How to manage 120*8*16 microcontrollers?
« Reply #7 on: June 02, 2019, 04:11:45 pm »
General rule - only use multiple MCUs when there are really good reasons to - it's always more complicated and debugging can be a nightmare.

Yes, sort of. On the opther hand if you consider preprogrammed MCU (in-house or not) as any other IC you buy, then idea is not that crazy anymore. Still it is so that 1Msps 12bit ADC standalone chips are more expensive than MCU with kinda equivalent ADC peripheral. I think OP is thinking similar way.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14117
  • Country: gb
    • Mike's Electric Stuff
Re: How to manage 120*8*16 microcontrollers?
« Reply #8 on: June 02, 2019, 04:43:39 pm »
Unless you're making thousands, the cost of the MCU is pretty insignificant compared to the development effort, not to mention the logisitics of dealing with multiple sets of firmware.

One thing you can usefully do if all MCUs are the same type, is have one common firmware image in all MCUs, and have  a pin tied on the PCB, or something similar, to tell it which position it is in.
 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: How to manage 120*8*16 microcontrollers?
« Reply #9 on: June 02, 2019, 05:46:42 pm »
Unless you're making thousands, the cost of the MCU is pretty insignificant compared to the development effort

Sure. Code audit and testing costs are high as well. Thou you could be mad scientist or just hobbyist making steampunk multichannel analog input (card) for yourself :D

Quote
not to mention the logisitics of dealing with multiple sets of firmware.

Not every MCU firmware shall be updated as often as Windows. When you select ADC chip, you supposedly do not change it often during lifetime of your product. MCU "ADC firmware" can be made once and that's it - your MCU becomes ADC IC. If preprogrammed - you even stock it along with other components.

It is even better from logistics point of view - you have to stock just single type of ADC "tempate" in form of blank MCU's :D
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 9327
  • Country: fi
Re: How to manage 120*8*16 microcontrollers?
« Reply #10 on: June 02, 2019, 06:14:03 pm »
Yes, I agree with ogden in the idea that if the firmware for the "node" is really super simple enough, it's fine to prototype the software once and then mass program.

If it's <100 lines, configuring ADC and SPI, or possibly bitbanging a simple control interface, then chances that there is a hard-to-find, hidden bug left after initial development is small. It's nonzero, but you can take the controlled risk.

I have been pushing my luck to >1000 lines of code, more complex distributed designs and have been quite succesful, but yeah, I understand it's a bit scary.

But if a cheap SPI ADC does the job, I wouldn't go this way just to save some cents; the price difference isn't that much. OTOH, if the SPI ADC doesn't somehow produce the wanted datastream format, for any reason, then an MCU replacement quickly becomes attractive.

Those On-Time-Programmable cheap Chinese controllers would be spot-on. Yes, there is a risk, but also learning opportunities.
« Last Edit: June 02, 2019, 06:16:23 pm by Siwastaja »
 

Offline JohanHoltbyTopic starter

  • Contributor
  • Posts: 30
Re: How to manage 120*8*16 microcontrollers?
« Reply #11 on: June 02, 2019, 10:12:43 pm »
Wow. Such great thoughts from all! THANK YOU! I have done some more thinking after reading your thoughts and will go with a larger singel chip IC like STM32F3... There is some which have 4 ADCs with 5Msps which would reduce the complexity very much.

call me crazy but at a lot of places you can't get more than Gigabit internet ... your application requires 2 10Gbit connections.
& and many more.
Yes that would be crazy. That is why I use the memory. I want to be able to break the system and evaluate what the **** happened.
The bus speed only need to be about 500kbit/s when the data is fetch out from the system. I'm leaning to RS485 right now. Good or bad?

For such systems, it's not a bad idea to use distributed simple serial (SPI, for example) ADCs, and use a large FPGA....
This is a cost constraint. The SPI ADCs cost more than a MCU. But as other have pointed out I will run in to problem if i try to program them before i place them if when I find a bug. JTAG might be an option if I use the STM chip maybe?...

BTW you can get 64Mbit SPI SRAMs, which will be much easier to drive than SDRAM :
https://lcsc.com/product-detail/RAM_VTI7064MSME_C139966.html
Great I will keep them in mind for the future. They was quite costly but definitely interesting if I would go with a single MCU for every function. That is no longer the case due to the feed back I have received. I still have the challenge of using only 3.3V RAM chips. Most in lower voltage especially the ones cost less.

And  as other replied, why do you need to measure up to 1ms/sec  ???  is it too critical ??
No 1ms/sec is not critical and it's not a hard constraint but it would be nice to know what did happened in the system and when.
 

Offline jmelson

  • Super Contributor
  • ***
  • Posts: 2851
  • Country: us
Re: How to manage 120*8*16 microcontrollers?
« Reply #12 on: June 02, 2019, 10:14:40 pm »
I just designed a 512-channel power supply to bias silicon photomultipliers.  Each needs a slightly different voltage to give the correct gain.  We also wanted current readout.

So, this thing will have 512 channels of DACs to set the voltage, and 512 channels of ADCs to read the current.
I did this all with ONE computer, a Beagle Bone Black.  Due to the large amount of channels, I used the PRU (200 MIPS microcontroller) to do the low-level I/O.  This is not fast sampling, but can read all the channels in a few milliseconds.

If I understand your subject line correctly, you are talking about using 15,360 microcontrollers?  YIKES!

Jon
 

Offline chris_leyson

  • Super Contributor
  • ***
  • Posts: 1549
  • Country: wales
Re: How to manage 120*8*16 microcontrollers?
« Reply #13 on: June 02, 2019, 10:36:42 pm »
If you put a small micro onto an FPGA then from Xilinx KCPSM6 user guide
Quote
By the way, the current record stands at 3,602 in an XC7V2000T and it wasn’t full 
. State machines would be more economical for this application.
 

Offline JohanHoltbyTopic starter

  • Contributor
  • Posts: 30
Re: How to manage 120*8*16 microcontrollers?
« Reply #14 on: June 02, 2019, 10:40:03 pm »
:) I have got so much bash I will not go there (thankfully). I will use only some higher lever higher speed MCUs. My current plan is STM32G3 or STM32F3 and use about 4 per board. As you indicated my original plan would have given me some headache.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: How to manage 120*8*16 microcontrollers?
« Reply #15 on: June 03, 2019, 07:21:30 am »
The bus speed only need to be about 500kbit/s when the data is fetch out from the system.

How do you know which exactly channel contains data you are looking for? If you need to analyze whole set of data, it is: 16bits * 1MSPS * 8seconds * 120*8*16 = 245.7 Terabytes. Using 500kbps you need 15.6 years to read everything.

Quote
I'm leaning to RS485 right now. Good or bad?

Bad. It does not solve you anything, only adds additional networking layer to implement and debug. Get your data into Ethernet as soon as you can. Check what CERN scientists with LHC science instruments do.

Quote
I will run in to problem if i try to program them before i place them if when I find a bug. JTAG might be an option if I use the STM chip maybe?...

Self-programming over data interface.
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 9327
  • Country: fi
Re: How to manage 120*8*16 microcontrollers?
« Reply #16 on: June 03, 2019, 07:27:15 am »
No 1ms/sec is not critical and it's not a hard constraint but it would be nice to know what did happened in the system and when.

Again, what do you expect to happen at such small timescale?

Power lines tend not to have such dynamics, there's inductance in wiring, and capacitance in loads, all over the place.

For some kind of EMI analysis, I'd kinda understand that, but then you would like to have even more bandwidth, and look at radiated electromagnetic fields.
 

Offline JohanHoltbyTopic starter

  • Contributor
  • Posts: 30
Re: How to manage 120*8*16 microcontrollers?
« Reply #17 on: June 03, 2019, 10:11:02 am »
How do you know which exactly channel contains data you are looking for?

Due to the nature of the system. If I see a problem i can follow the trace of clues and check for reasons without a need for a re run. Think of it like a LTspice simulation but on the real deal. I will not download all data only the data of interest.

Again, what do you expect to happen at such small timescale?

Good point. Without a reason it would be stupid!
I hope to find the reason why the system is behaving like it is. So this is mainly a feature for debugging. Think of it as a 1Mhz oscilloscope that knows every thing.....42...;)
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 8217
  • Country: nl
  • Current job: ATEX product design
Re: How to manage 120*8*16 microcontrollers?
« Reply #18 on: June 03, 2019, 10:33:19 am »
What is the goal of the system? Overload protection? Diagnostics?
In any case, there is usually very little reason to store all these data, unless you work at CERN.
Your output is going to be 1 bit, the system is working or it doesnt work.
Let the microcontollers do their job, and analyse the data. Have an open collector output for faults, and something like 485 or CAN for communication.
Wherever it's possible, reduce the amount of data to something which is less. Do you need 1 million sample per sec from the microcontoller, or is it enough to have 1 sample of RMS value per second?

Or you can replace the microcontroller with a comparator?
 

Offline JohanHoltbyTopic starter

  • Contributor
  • Posts: 30
Re: How to manage 120*8*16 microcontrollers?
« Reply #19 on: June 03, 2019, 01:28:46 pm »
It's diagnostics. CERN would be nice but no I don't work there. The problem is that I don't know what I need to extract from the raw data. I want it all..... :)

But as you say. If I know what I want to know this is none optimal way of doing it, I agree.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf