My STM32F407 DSP Project

MrChips

Joined Oct 2, 2009
23,245
This is show and tell time. I wanted to show you what I have been working on.

This is a project exactly two years in the making.
This is a gamma-ray spectrum analyzer to be used in nuclear research and radiation and medical physics research and therapy.

This is a screen shot of the VGA output. It shows three windows, an oscilloscope, a histogram and a text window showing the region of interest. This is an energy spectrum of cobalt-60 from a NaI detector.

The chip that I am using is STM32F407 running at 168MHz. The ADC is digitizing the detector signal at 42Msps. I am totally amazed with the power and capabilities of the STM32F4. This is a project that has been on-going for the past ten years in various shapes. I have been waiting for a chip like the STM32F4 for the last five years and now that I have experienced what it can do I am totally blown away.

Here are photos of the finished unit, assembled and exploded with its parts.

This project is still not completed. There are some more features that I would like to add. As it is now, it is going to market.

THE_RB

Joined Feb 11, 2008
5,438
Very nice work! Including high speed ADC logging, real time data analysis AND you did VGA graphics/text output direct!

People may not understand what an impressive set of tasks that is doing in real time.

Re manufacturing, you could have your endplates CNC machined and also engraved with plug names and product branding etc. Personally I would make the endplates out of thick engravers plastic which would look nice once engraved, but it's possible you need metal endplates for shielding? If so you would need CNC metal plates plus thinner engravers plastic, unless you can source painted aluminium plate that can be engraved and cut.

MrChips

Joined Oct 2, 2009
23,245
Thanks RB. Actually, you get the credit for giving me the idea of generating VGA directly from the MCU.

It would seem to me that the STM32F4 ARM chip is the world's best kept secret in embedded world. I almost didn't want any of my competitors to find out about this MCU. But then it is no secret if you are willing to look around for the most suitable MCU for your project.

Mechanical packaging is not my favorite aspect of project design. I look forward to any suggestions of where I can find shops to do low volume manufacturing to make the endplates. Plastic would work but as you say the EMI shielding is important.

THE_RB

Joined Feb 11, 2008
5,438
Small volume machining is hard to get done cheap. Proper machine shops will quote big setup fees on small quantity jobs, especially from someone new where they expect hassles.

In the past I have had good experience with trophy engraving type shops for one offs or few offs. Especially if you can provide them with a 2D CAD drawing or any vector drawing like from Corel draw, they can import that direct and not have to do any CAD work. They can usually work with light gauge aluminium plate cutouts, and can definitely do the cosmetic engraving. Those type shops usually have an expensive machine and lots of down time so they can appreciate the chance to make 10 of this or 50 of that especially if you let them do it in their slack times.

Alternatively, there are a few small CNC machines you could buy and be set up for under 1000, and then could do the routing and engraving yourself. You'd only have to sell a few units to pay that off, and then you'd have a prototyping and manufacturing asset for life. Thread Starter MrChips Joined Oct 2, 2009 23,245 I like that last suggestion. I like to roll my own with my own equipment. Any suggestions for a CNC machine I should be considering? This is not my area and all new to me though I do have machine shop experience, i.e. I have worked with lathes and mills. Edit: Thanks for giving me a kick in the head. I am so accustomed to cutting holes by hand that I completely forgot that I have access to a mill. I will cut the holes on the mill on my next unit. Last edited: Shagas Joined May 13, 2013 804 Looks really nice . Might be a stupid question but is that a DIY pcb? It's looks neat from here. How did you make the GUI? Some sort of graphics generating library or did you make it from scratch? Thread Starter MrChips Joined Oct 2, 2009 23,245 PCB made by commercial PCB house. GUI built from scratch. All windows can be scaled, scrolled, moved and overlapped. There is no OS employed. Shagas Joined May 13, 2013 804 Looks very nice . Can't wait to learn how to do things like these. nerdegutta Joined Dec 15, 2009 2,676 This looks very nice, MrChips. How are the edges of the metal container where you mount the metal plates? Do the have an edge? It looks like you first put in the PCB, and the by miracle, you insert and align the metal plates. It must be really hard/difficult to mount them. Is the chip programmed in C? THE_RB Joined Feb 11, 2008 5,438 I like that last suggestion. I like to roll my own with my own equipment. Any suggestions for a CNC machine I should be considering? This is not my area and all new to me though I do have machine shop experience, i.e. I have worked with lathes and mills. ... I'm a bit out of the loop re buying small CNC machines, I built my own a few years back. Ebay used to have Chinese machines you can try searching for "2030" or "3040" which had 20cm x 30cm or 30cm x 40cm cutting areas. From what I've read from users they need a bit of aligning and setup (because they are crudely assembled) but are all metal frame and rails. My preference would be for fully supported long rails, so there's no flex on the long rails. The shorter rails are not so critical. I just found this 3020 one on Ebay Australia for718 plus $100 shipping; http://www.ebay.com.au/itm/CNC-3020...INE-DRILLING-MILLING-DESKTOP-ck-/181136940227 It looks to have unsupported long rails (bottom) but on a 30cm travel that might be ok. Definitely talk with them about the bearing rail diameters, and if they are supported or not. JBernard Joined Aug 8, 2013 46 amazing work! i've done some fab stuff in the past, and you should try laser cutting for those end plates. would be WAY cheaper than getting them machined. and you could do engraving at the same time. That would be so easy, for a 1 off like that you'd basically be paying for the machine setup fee and that simple of a cut would be minimal. As in 40$ for machine setup and to cut those pieces would probably be about 5$in actual cutting cost! that cheap! let me know if you'd like a source! Thread Starter MrChips Joined Oct 2, 2009 23,245 It just so happens that I am sitting right now at a free STM workshop featuring the latest STM32F429. If there is one coming to your area, register. It's free. Plus you get a free Discovery board. Lunch smells good! Thread Starter MrChips Joined Oct 2, 2009 23,245 amazing work! i've done some fab stuff in the past, and you should try laser cutting for those end plates. would be WAY cheaper than getting them machined. and you could do engraving at the same time. That would be so easy, for a 1 off like that you'd basically be paying for the machine setup fee and that simple of a cut would be minimal. As in 40$ for machine setup and to cut those pieces would probably be about 5\$ in actual cutting cost! that cheap! let me know if you'd like a source!
Please do send me info. Nice to know all my options.

THE_RB

Joined Feb 11, 2008
5,438
amazing work!
i've done some fab stuff in the past, and you should try laser cutting for those end plates. would be WAY cheaper than getting them machined. and you could do engraving at the same time.
...

Sorry JBernard but I will argue that. I have quite abit of experience getting aluminium parts laser cut, and the result is NOT cosmetic. By the time the laser melts through 1.5mm or 2mm thick of metal, it blows out the back leaving nasty melted dags etc. That can be fine for large metal boxes as you can file off the dags and burrs and clean up the melted edges.

But for small parts that need precise connector shapes cut out it will be nasty and require a lot of cleanup.

Also, the machine that laser cut aluminium in 1.5mm sheet and thicker is a very large high powered industrial laser, and generally is no good for any cosmetic laser engraving, as the beam width itself is 1.5-2mm.

Machines that do cosmetic laser engraving like on electronic panels etc use a tiny laser by comparison, and much better focus with beam widths of maybe 0.2-0.5mm typical. And small cosmetic engraving laser machines like that CANNOT cut shapes out of aluminium sheet, they are underpowered and don't have the splatter zones and water bath etc to catch all the melted metal.

MrChips

Joined Oct 2, 2009
23,245
I haven't decided on how to finish the extruded aluminum box. Here are my options I can think of:

• sand blasting
• paint
• anodizing
• plasma electrolytic oxidation

Brian Griffin

Joined May 17, 2013
64
Thanks for sharing the project and the minor details. I'm intending to use the STM32M4 too for my work in the university once I get the prototype done.

THE_RB

Joined Feb 11, 2008
5,438
To MrChips; I would go anodised. You can get great colours and if the endplates are anodised too you can then engrave or laser engrave texts on the endplates, to get a dual-colour effect (silver text on dark coloured anodised plate).

Helmi_Romdhani

Joined Mar 7, 2014
1
Hi ! I am working on an academic project in wich i am using an stm32f407 to control an lcd display via vga. Can you help me how to proceed?