Sunday 29 January 2017

pcb design - Need help making an STM32 development board


I have been playing around Arduino and wanted to make my own development board for a long time.


I have decided to use the STM32F103C8T6 microcontroller for this. But being relatively inexperienced in hardware design, I'm doubtful as to whether what I'm doing is correct.


My Eagle Design till now



The oscillator I've chosen would be an 8 MHz one with load capacitances 18 pF each. But I'm doubtful whether this will work. Please find the errors and give tips to me.


PS: As far as I know, this chip only has a USART. How do I go about implementing I²C, SPI, and USB with this?



Answer




Please find errors and give tips to me.



As you are a beginner this is a very board topic, but briefly:




  • As others have said, there are cheap STM32F1 boards available which you can learn from, before you try to design your own. Look at one of those (or at least its schematic) and compare it to your proposed schematic. You will find many differences. Research those differences to learn more. There is also the STM32VLDISCOVERY development board (based on STM32F1) which has a built-in programmer/debugger (and also other "discovery" boards by ST).





  • There is plenty of documentation for your chosen STM32F103C8 MCU - click on the "Resources" tab on the STM32F103C8 page. One important document is "AN2586: Getting started with STM32F10xxx hardware development". That explains the main hardware design requirements (power, decoupling capacitors, oscillator, configuration pins etc.) and you must read & understand this.




  • Your schematic does not show what voltage you will be supplying to VDDA on pin 9, but some problems include:




    • Check that the voltage supplied to VDDA is within the allowed range.





    • Schematic shows +5V being supplied to VBAT (pin 1). That will kill your MCU. Read the datasheet and AN2586 regarding the allowed power supply voltage range.




    • Schematic shows power only being supplied to VDDA on pin 9. However you must supply power to all VDD pins (and ground to all VSS pins). Again, read AN2586 for examples of power supply connections.




    • Schematic shows no decoupling or bypass capacitors. This is not in accordance with AN2586 and will likely cause intermittent problems (or worse).





    • Schematic shows the BOOT0 and BOOT1 pins floating. This is a bad idea and will cause problems. Read AN2586 and the device datasheet to better understand the function of those pins, how to connect them and why you might want to change BOOT0 during development.




    • Schematic shows no manual reset button and associated components. Are you really sure that you don't want one?






  • Think about how you are going to (a) program and (b) debug your code on the MCU. Although the STM32F1 does contain a primitive serial bootloader (a little like the Arduino that you are used to) this gives no debugging functionality. Read about SWD (JTAG) functionality and see how that (when used with appropriate PC-based software) offers a range of programming and debugging features.


    That is why you will see SWD (JTAG) ports on many of the existing STM32F1 demo / evaluation / hobby boards. You should consider adding an SWD (JTAG) connector to any development board that you design.





[Related: See this question about making an STM32F4 custom development board. The same principles apply here.]




You don't have to learn everything at once, but until you better understand this MCU (which is more complex than your Arduino), then trying to make your own development board is more likely to end in failure. That is why a more efficient and less frustrating path for you, may be to buy an existing development board, learn about how to program and debug software on it (including choosing which toolchain / IDE you prefer - there are many options) and reverse-engineer the design of that simple STM32F1 board.


When you have done that, you will be in a much better position, with improved knowledge, to then design your own development board and for it to be successful, instead of trying to do so now. Good luck!


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...