Category Archives: Raspberry PI Hat’s

Smart SPI Test Kit

This is the test suit for Smart SPI. This is an old pic, but I will upload a newer one showing RPI mounted behind the 32xServo and how we access SWD & Raspberry PI for development.

The mechanics of thos robot is dodgy, but it is a very good and fun test kit. I also have a different robot that we can have some fun with during testing using the 8x DC Motor hat.

Keep in mind that Raspberry PI Zero W provide both Bluetooth and Wifi – I only need battery added making this a very easy and scalable design.

Adding more Hat’sm we can scale up and we basically have a PLC style design with Raspberry PI as core. I have a few more Hat designs coming up, but once I have tested this I will try putting this into volum production through kickstarter.

I have no idea about prices yet, but I hope we can achieve ca 25.- USD or lower. This is no-profit, but the key is that I need volumes to push prices down. I also need to engange professionals for CE/FCC tests. I am not so worried about the later, as Wifi/Bluetooth is dealth with by 3rd party, and this is only a component – but, we need to test that we don’t have nasty signals by accident.

Smart SPI Driver

I need a specialized SPI driver to support the Smart SPI concept. The block diagram above show the logical view with device to device communication, while the diagram below show the physical design. Just to remind everyone – in the logical concept we communicate device to device. In the physical this is done by a device sending a message to RPI that send it to the addressed device.

A classic SPI will enable a CS, communicate with that device before it continue to the next device. As discussed before this is not optional as it do not take into account the actual stream queues, so we will implement several important tweaks to optimizeSPI communication efficiency.

We will only use the CS for ID procedures at start-up. I am currently looking into even drop this. Each device here is intelligent and capable of filtering out it’s own messages. They also have 3-state capability allowing them to listen only while only one respond back. This enables a free flow where RPI have a continuous send with a soft-switch selecting the device that communicate back.

This requires specialized SPI drivers both for Raspberry PI and STM32. The advantage for Raspberry PI is that we allow Linux to use deep DMA queues and avoid CPU heavy bit-banging. The only dissadvantage is a complex SPI driver.

My current Hat’s support CS addressing using a classic address selection. I am considering ditching that and set the MCU address directly with 3-4 GPIO pins. The drawback is that I need to modify all Hat’s, but that is doable since none are in production yet – and I am commiting to using a number of pin’s for address setting. The usage will be the same as before, but we drop the SPI ID procedure because it is not needed anymore. At precent I will focus on a single Hat, so I can pick up this as I make the next revision of the Hat’s. It also gives me time to mature this change a bit.

32 x Servo / IO Capability Map

This table is a all 32 channels on the 32 x Servo / IO Hat mapped out per channel. Explenation under the table.

Ch1 PC1 Analogue In
Digital In
Digital out
Servo
Software PWM
Ch2 PC2 Analogue In
Digital In
Digital Out
Servo
Software PWM
Ch3 PC3 Analogue In
Digital In
Digital Out
Servo
Software PWM
Ch4 PA0 Analogue In
PWM
Digital In
Digital Out
Servo
Software PWM
Ch5 PA1 Analogue In
PWM
Digital In
Digital Out
Servo
Software PWM
Ch6 PA2 Analogue In
PWM
Digital In
Digital Out
Servo
Software PWM
Ch7 PA3 Analogue In
PWM
Digital In
Digital Out
Servo
Software PWM
Ch8 PA4 Analogue In
Analogue Out
Digital In
Digital Out
Servo
Software PWM
Ch9 PA5 Analogue In
Analogue Out
Digital In
Digital Out
Servo
Software PWM
Ch10 PA6 Analogue In
PWM
Digital In
Digital Out
Servo
Software PWM
Ch11 PA7 Analogue In
PWM
Digital In
Digital Out
Servo
Software PWM
Ch12 PC4 Analogue In
Digital In
Digital Out
Servo
Software PWM
Ch13 PC5 Analogue In
Digital In
Digital Out
Servo
Software PWM
Ch14 PB0 Analogue In
PWM
Digital In
Digital out
Servo
Software PWM
Ch15 PB1 Analogue In
PWM
Digital In
Digital Out
Servo
Software PWM
Ch16 PB2 Digital In
Digital Out
Servo
Software PWM
Ch17 PB10 PWM
Digital In
Digital Out
Servo
Software PWM
Ch18 PB11 PWM
Digital In
Digital Out
Servo
Software PWM
Ch19 PC6 PWM
Digital In
Digital Out
Servo
Software PWM
Ch20 PC7 PWM
Digital In
Digital Out
Servo
Software PWM
Ch21 PC8 PWM
Digital In
Digital Out
Servo
Software PWM
Ch22 PC9 PWM
Digital In
Digital Out
Servo
Software PWM
Ch23 PA8 PWM
Digital In
Digital Out
Servo
Software PWM
Ch24 PA9 PWM
Digital In
Digital Out
Servo
Software PWM
Ch25 PA10 PWM
Digital In
Digital Out
Servo
Software PWM
Ch26 PA11 PWM
Digital In
Digital Out
Servo
Software PWM
Ch27 PA12 Digital In
Digital Out
Servo
Software PWM
Ch28 PB3 PWM
Digital In
Digital Out
Servo
Software PWM
Ch29 PB4 PWM
Digital In
Digital Out
Servo
Software PWM
Ch30 PB5 PWM
Digital In
Digital Out
Servo
Software PWM
Ch31 PB6 PWM
Digital In
Digital Out
Servo
Software PWM
Ch32 PB7 PWM
Digital In
Digital out
Servo
Software PWM

Analogue In means it has an ADC capability on the channel. This can sample at a very high frequency. It is 15 of these

PWM means we have a Hardware PWM signal with a very high frequency capability. It is 23 of these.

Analogue out means it connect to a DAC. It is 2 of these,

Digital In & Digital Out is on all 32 channels.

Servo is available on all 32 channels and is the default configuration.

Software PWM means we bit-bang the pin in software to create a PWM signal. Max frequency is ca 10KHz. Available on all 32 channels.

An updated version of this table can be found in Annotated Schematics (coming soon). Pin’s have all cababilities as per STM32F105RB capabilities, but more advanced features will need custom modified firmware to access.

Wireless 32xServo (IO) Controller

I maintain Zero mounting holes on all my Hat’s because it’s an easy & cheap way to assemble a wireless control system using the capabilities in Zero W. The picture above show Zero W on top of a 32xServo Hat. I have only populated 16 of them, but all 32 are available since the Hat fit’s nicely on the inside. The pic below show a Zero booting up with a 5″ TFT display. I tried booting the Zero W, but realized I need to update my image.

You can see the red dot from the 32xServo Hat mirroring in the display. The only practical issue here is that SWD is hard to get to – which isn’t a real issue as I just as easy can move the Zero to bottom of the stack for development – but, I did draft special SWD adapters for this purpose earlier that allow me access from the side (See 3D below).

This can be clicked on/off from the side while the Hat’s are inside a stack. The use of 1.27 pich headers is just about the right hight for this. The one thing this SWD adapter lack is a Boot and Reset button. I seldom need those, but I prefer to have them on the adapter – not waste space on the boards.

The 32xServo or 32xIO have the advantage that the signals are connected directly to the MCU. The new version (not shown here) have TVS diodes on each signal, but you can otherwise use the signals as per MCU capability for in/out. This makes this a very ideal wireless controller because you have 32 very capable channels + pointing at the obvious a Raspberry PI Zero W with camera port. I will re-assemble my 6 legged Robot with this on top later.

16 x Servo Module – 1st draft

Just the first 3D draft of my Servo Module. I still have the Raspberry PI Zero W hanging on the back of this – we don’t need to populate that header, but had plenty of room for it so just left it there. on top left you see jumpers to select Servo and Servo Signal voltage. On right you see a classic 3 x 16 header for servo connectors with the photo coupler providing a complete isolated Servo module.

I have a few changes I need to do – firstly I want to investigate how to add a current sensor with full isolation – possible using a photo coupler.

Micro/Pocket PC

This is a 5″ display and the keyboard I just ordered. I think the size is about correct. The trouble is more finding a TFT display that hide the HDMI on the back (inside) rather than demanding cables extending to the sides. I actually need a workable console for Raspberry PI that include both keyboard and display and don’t occupy to much space – interesting…

PLC Ethernet/GSM Revision 1.0 Annotated

These pictures show the annotated 3D. Full PDF documentation can be found on the Download page (here).

  1. 4 pin HMI header.
  2. Super capacitor for RTC.
  3. SWD.
  4. W5500
  5. Raspberry PI Zero W mounting holes.
  6. Ethernet RJ45
  7. GPS Antenna
  8. GSM/GPRS Antenna
  9. Nano SIM Card holder.
  10. Standard mounting holes. M2.5 in each corner.
  11. SIM808 module
  12. Analogue Audio/USB connector.
  13. 4V PSU (MIC29302BU)
  14. 2 x MAX3485 for RS485.
  15. STM32F405RG
  16. 3.3V PSU (LM1113)
  17. 40 pin PLC backbone connector
  18. 40 pin Raspberry PI 2/3/Zero W connector
  19. Audio/USB available on back side. 5V + VBUS available here.
  20. Test holes for PCM
  21. Extra wiring to enable swapping of PCN In/Out

All In One Home Central

Looking at my Ethernet/GSM module I realise that I with a minor change on the backbone pin-out can just add 2.54 pitch screw terminals and we have a stand-alone home sentral with 5V on the upper screw block and RSX on the lower. 5V here is in reality 4.5 to 12V, so we can just add a 2 cell LIPO directly this way. Need to think about this option, but I see no reason not to do the backbone change as this would enable all modules too be used both in rack and stand-alone “as is”.

Ethernet/GSM Module Update

Finally got the last packages in and added some extras. Still some work to do before this is done thought, but in the process of completing 1st final draft. Due to the complexity of this module I expect 1-3 revisions before we are done. Basically I just want to complete this draft & doc and let it mature a bit before I review the design.

Of notable changes is that I decided on a supercap for the RTC battery. Using a battery would cause people to run-around changing batteries. A supercap does not last that long, but I expect an hour++. I actually need to test. I also added an Analogue Audio Connector+ SIM808 USB is available on pins. I changed to Nano SIM Card and added a HMI (UART) connector. The pictures below show the 3D from side/back to illustrate.

I have not added Raspberry PI to the illustration, but it fit on back With the Connectors right. Since my Hat’s also have Zero Mount holes you can actually add several Hat’s by setting their address to 2-8. The Ethernet/GSM module have hard-wired address 1. Full size Hat’s will stick out ca 3cm.