Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Creating a custom board with Netduino firmware?


  • Please log in to reply
27 replies to this topic

#1 Frode

Frode

    Advanced Member

  • Members
  • PipPipPip
  • 202 posts
  • LocationNorway

Posted 21 May 2014 - 07:19 AM

Hi guys, 

I'm on a quest to create my own "custom" Netduino board. Meaning I want to design a PCB which uses the same microcontroller (STM32F405RGT6) as the Netduino Plus 2 does, and which accepts the standard Netduino Plus 2 firmware.

 

The reason for wanting to use the standard firmware is that tweaking the firmware too would be a little too much to wrap my head around for now.

 

I'm reading the schematics for the Netduino Plus 2, and have some questions.

 

Is it correct that in order to use the standard firmware I need to use an external 25MHz oscillator? And is it also true that the oscillator needs to have two capacitors with the same pF capacitance as the crystal has?

 

On the VDD inputs I see that there are 5pcs 0.1uF caps, and 3pcs 10uF caps. Why are there several of them, and how to you determine how many?



#2 Juzzer

Juzzer

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts
  • LocationHertfordshire, UK

Posted 21 May 2014 - 08:57 AM

Yes you need to use a 25mhz crystal to use the netduino firmware

The crystal needs 2 load capacitors and for optimal results you need to take into consideration the boards parasitic capacitance to get the correct values for the 2 caps. You can probably get away with using the same values as stated on the crystals datasheet.

 

Each VCC pin should have a 0.1uF decoupling cap and a few 10uF to smooth things out



#3 Frode

Frode

    Advanced Member

  • Members
  • PipPipPip
  • 202 posts
  • LocationNorway

Posted 21 May 2014 - 12:13 PM

Does it matter if the decoupling capacitors are spread out all over the board, or places right next to eachother in a huddle somewhere?



#4 Juzzer

Juzzer

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts
  • LocationHertfordshire, UK

Posted 21 May 2014 - 04:26 PM

Place them next to the VCC pins



#5 Frode

Frode

    Advanced Member

  • Members
  • PipPipPip
  • 202 posts
  • LocationNorway

Posted 26 May 2014 - 09:28 PM

Hi again - one more question about some of the pins in the schematic.

 

There are several pins with the comment "pulled low for bootloader". Will the board work if I leave those pins floating? Or do they need to be pulled up/down by resistors?



#6 Frode

Frode

    Advanced Member

  • Members
  • PipPipPip
  • 202 posts
  • LocationNorway

Posted 26 May 2014 - 10:15 PM

Here is the schematics I've got so far. I'm sending it for fabrication tomorrow, so I hope it is correct.

 

 

STM32F405Schematics.PNG



#7 Juzzer

Juzzer

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts
  • LocationHertfordshire, UK

Posted 27 May 2014 - 07:49 AM

It's a bit hard to read but some of the pin assignments look wrong to me....

Yes you need to pull both Boot 0 and Boot 1 to GND with 10k resistors.

You have 3 Boot0 ? - should only be on pin 60



#8 Frode

Frode

    Advanced Member

  • Members
  • PipPipPip
  • 202 posts
  • LocationNorway

Posted 27 May 2014 - 08:59 AM

There is only one Boot0, but I (probably confusingly) use the same Boot0-label several times. I think it made a mistake trying to reuse the same pull-down resistor for several of the pins.

 

In the Netduino 2 schematics there are comments on pins 3, 30, 43, 52 and 57 saying "Pulled up/down for bootloader".

Is it enough to add pull-down resistors on Boot0 (pin 68) and Boot1 (pin 28), or do I need them on pins 3, 30, 43, 52 and 57 as well?



#9 Juzzer

Juzzer

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts
  • LocationHertfordshire, UK

Posted 27 May 2014 - 12:20 PM

you only need boot0 and boot1 (this is based on the Oberon STM port)



#10 Frode

Frode

    Advanced Member

  • Members
  • PipPipPip
  • 202 posts
  • LocationNorway

Posted 27 May 2014 - 12:47 PM

Ok, great, then I can remove some of those extra resistors, and make my board simpler :)



#11 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 27 May 2014 - 02:08 PM

Have a look at the description in the datasheet, it explains it in great detail.

  • When BOOT0 is logic 0, the code executes from flash - this is what you want for 'normal' operation,  i.e. .NET MF running; the pull-down resistor R12D ensures the logic 0 level,
  • When BOOT0 is logic 1 (switch pressed) then BOOT1 determines if the code executes from system memory (logic 0, ROM Bootloader), or embedded SRAM (logic 1). You usually want the ROM bootloader to be executed, hence the second pull-down resistor R11D. BOOT0 is a dedicated pin, while BOOT1 is shared with GPIO (PB2) - it is sampled a few cycles after reset, then it can be used as regular GPIO.

The use of the rest of bootloader pull-up/down resistors is described in the Application Note 2606: basically, when a peripheral (USART, CAN, USB) is used to connect to the bootloader, its "pins have to be kept at a high or low level and must not be left floating during the detection phase".



#12 Frode

Frode

    Advanced Member

  • Members
  • PipPipPip
  • 202 posts
  • LocationNorway

Posted 27 May 2014 - 05:15 PM

Thanks CW2, I'll take a look at that Application Note.

 

The sheer volume of information and documentation in those datasheets and appplication notes can be quite overwhelming, so I appreciate your comments.

 

One other question - I'm creating a Fritzing part for the STM32F405RTG6, and I have a question about the naming of the pins. I see that the Netduino schematics includes more information than just the name of the pin. For example, pin "PA2" is called "PA2/UART2_TX". Is that the pin-configuration that just the Netduino firmware uses, so that when I create the Fritzing part I should name the pins with the shortname?



#13 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 27 May 2014 - 05:54 PM

For example, pin "PA2" is called "PA2/UART2_TX". Is that the pin-configuration that just the Netduino firmware uses, so that when I create the Fritzing part I should name the pins with the shortname?

 

That pin configuration is microcontroller-specific. It means the GPIO pin is shared (multiplexed) with another peripheral - it can be configured as third pin of GPIO port A, or TX line of UART2. There is a big table in the datasheet  :P that describes pin functions - most pins have more than one features (I think theoretically up to 15 in ST micros) and sometimes the same signal can be enabled on different pins (e.g. UART2 TX is available also on PD5).

 

Regarding the names in schematic symbols, it depends - you'd probably need to include at least the GPIO identifier and maybe the alternate function when it is important in your design - like in the above example, "PA2/UART2_TX" indicates the use of TX serial line. Listing all the available features on each pin would require quite large symbol, but I have seen such schematics too (usually, the part is split into several symbols that contain logically grouped features). I think in Fritzing, you can have additional information in the pin description, which is displayed in form of tooltip...



#14 Frode

Frode

    Advanced Member

  • Members
  • PipPipPip
  • 202 posts
  • LocationNorway

Posted 27 May 2014 - 08:42 PM

Great explanation, as always, CW2!
Good idea about using the pin-description as well.

Note to future self (and others wanting to create their own Netduino-clones); forum member cys tipsed me about this blogpost with relevant info: http://eleccelerator...breakout-board/

#15 Juzzer

Juzzer

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts
  • LocationHertfordshire, UK

Posted 28 May 2014 - 08:29 AM

@Frode - why not just use GHI's Cerb40 open source files?



#16 Frode

Frode

    Advanced Member

  • Members
  • PipPipPip
  • 202 posts
  • LocationNorway

Posted 28 May 2014 - 10:42 AM

Hmm, I haven't seen the Cerb40 II before. Thanks for the tip, I'll take a look at it.

 

Will the Netduino 2 firmware work with that board, or do I need to create a custom firmware?



#17 Juzzer

Juzzer

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts
  • LocationHertfordshire, UK

Posted 28 May 2014 - 10:53 AM

The cerb 40 uses a 12mhz crystal.



#18 Frode

Frode

    Advanced Member

  • Members
  • PipPipPip
  • 202 posts
  • LocationNorway

Posted 28 May 2014 - 11:12 AM

But I can just change it to a 25MHz one, and that'll make it Netduino-firmware-compatible, right?

#19 Juzzer

Juzzer

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts
  • LocationHertfordshire, UK

Posted 28 May 2014 - 11:18 AM

Yes change the crystal and caps.
i would just use the ghi firmware...

#20 Frode

Frode

    Advanced Member

  • Members
  • PipPipPip
  • 202 posts
  • LocationNorway

Posted 28 May 2014 - 09:06 PM

You mean the firmware found at https://ghiopensource.codeplex.com ? For now I'm not comfortable compiling my own firmware, so I'll try to create a board that works with the Netduino firmware instead. Maybe, when I have that working, I can have a go at creating custom firmware.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.