tag:blogger.com,1999:blog-167366992024-03-07T19:08:35.328+00:00Sustainable Suburbia---------------Getting along in the 21st Century with half the baggage you carried in the last.------------ /*************************Low cost electronic solutions for a low impact lifestyle.************************/Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.comBlogger323125tag:blogger.com,1999:blog-16736699.post-8206395555421777442016-11-12T12:12:00.000+00:002016-11-12T12:18:05.538+00:00myStorm - Achieving the $30 Price Breakthrough!<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<strong style="line-height: 1.57143em;"><span style="font-family: inherit;">This post was originally written in late July - during the design phase of myStorm. Unfortunately this and other posts were accidently deleted, but have now been partially recovered.</span></strong><br />
<strong style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></strong>
<b>From now this blog will continue on my <a href="https://nanode0000.wordpress.com/" target="_blank">Wordpress site</a></b><br />
<br />
<br /></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="line-height: 1.57143em;"><span style="font-family: inherit;">In this part I look a little closer at the target hardware and look at the way in which we are now able to achieve a $30 selling price.</span></span><br />
<span style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZX_QGEPHMXCcAdFmz6NbeLP1oL8QeQ099c3e4CaRybuPc_eomrTRUjc2XtLiV_coSQ91yr41YkGvDAvjqYXnQ0fMn8EbxUV-UXyox93D4RzGlu91cpQFfs-nB9o2JgdD8aY4B/s1600/myStorm_silk.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZX_QGEPHMXCcAdFmz6NbeLP1oL8QeQ099c3e4CaRybuPc_eomrTRUjc2XtLiV_coSQ91yr41YkGvDAvjqYXnQ0fMn8EbxUV-UXyox93D4RzGlu91cpQFfs-nB9o2JgdD8aY4B/s320/myStorm_silk.jpg" width="306" /></a></div>
<strong style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></strong>
<strong style="line-height: 1.57143em;"><span style="font-family: inherit;">ARM Section</span></strong><br />
<strong style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></strong>
<span style="line-height: 1.57143em;"><span style="font-family: inherit;">The ARM microcontroller performs several basic functions at different times in the development cycle.</span></span><br />
<span style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></span>
<span style="line-height: 1.57143em;"><span style="font-family: inherit;">1. As a non-volatile Flash memory device for holding the FPGA bitfile</span></span><br />
<span style="line-height: 1.57143em;"><span style="font-family: inherit;">2. As a FPGA programmer communicating the bitfile to the FPGA via an SPI interface.</span></span><br />
<span style="line-height: 1.57143em;"><span style="font-family: inherit;">3. As a general purpose I/O slave processor - by way of serial or fast 8-bit parallel interface </span></span><br />
<span style="line-height: 1.57143em;"><span style="font-family: inherit;">4. As a system controller for applications where the Raspberry Pi Zero is not present on board.</span></span><br />
<span style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></span>
<span style="line-height: 1.57143em;"><span style="font-family: inherit;">The microcontroller needs a flash memory of at least 256K bytes. </span></span><br />
<span style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></span>
<span style="line-height: 1.57143em;"><span style="font-family: inherit;">I have had experience of the STM32 range of microcontrollers - so these were the obvious choice - but with a tight budget, not stretching to a $4 mcu, we were obliged to follow an alternative strategy.</span></span><br />
<span style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></span>
<span style="line-height: 1.57143em;"><span style="font-family: inherit;">Some months ago, through my association with the <a href="http://www.stm32duino.com/" target="_blank">STM32Duino group</a>, I got to hear about some low cost ARM M3 parts from a vendor in China, apparently binary and pin compatible with the STM32 parts . At first, these appeared to be rip-offs of the STM32F103 series, produced by Chinese vendor Giga Devices. However, <a href="http://zeptobars.com/en/read/GD32F103CBT6-mcm-serial-flash-Giga-Devices" target="_blank">further investigation</a> revealed that they were actually a new design, which employed a neat idea to produce a low cost, volume range of ARM Cortex M3 microcontrollers for the Chinese market. And because Giga Device is a Flash Memory manufacturer, their M3 Cortex parts have up to 3Mbytes of flash "on-chip".</span></span><br />
<span style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></span>
<span style="line-height: 1.57143em;"><span style="font-family: inherit;">Of primary interest, however, was their low cost - a 256Kbyte ARM M3 Cortex by Giga Device sells for about $1.00, saving us $3 on not having to buy a device from STM.</span></span><br />
<span style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></span>
<span style="line-height: 1.57143em;"><span style="font-family: inherit;"><b>The Raspbery Pi Zero.</b></span></span><br />
<span style="line-height: 1.57143em;"><span style="font-family: inherit;"><b><br /></b></span></span>
<span style="line-height: 1.57143em;"><span style="font-family: inherit;">When the Raspberry Pi Zero was released in November 2015, it was heralded with a blaze of publicity as a $5 fully functioning Linux computer. Just add keyboard and display with the O/S stored on a microSD card.</span></span><br />
<span style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></span>
<span style="line-height: 1.57143em;"><span style="font-family: inherit;">With its small size of just 64 x 35 x 5mm, and unbeatable value, it appears to be the ideal solution for a low cost development system. </span></span><br />
<span style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></span>
<span style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></span>
<span style="line-height: 1.57143em;"><span style="font-family: inherit;">20 5V tolerant GPIO lines and 6 12-bit ADC channels (3V3 input) are brought to "Arduino" stye pin headers - so that external shields may be fitted.</span></span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;"><br clear="none" /></span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">Wide assortment of GPIO brought to Arduino shield connectors</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">6 Analogue Input Lines AN0 - AN5</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">UART (with bootloader facility) TX, RX</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">Up to 18 digital lines - including I2C and SPI</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">Up to 3 differential input 16 bit ADC channels (If STM32F373 fitted)</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">USB 2.0 connection for programming, data and power</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">8 bit bidirectional bus interface to FPGA and Pi - Zero with handshaking lines</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">SPI bus for programming FPGA from bit file</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;"><br clear="none" /></span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<strong style="line-height: 1.57143em;"><span style="font-family: inherit;">FPGA Section</span></strong></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<strong style="line-height: 1.57143em;"><span style="font-family: inherit;"><br clear="none" /></span></strong></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">3 single PMOD connectors</span><br />
<span style="font-family: inherit;">5 double PMOD connectors</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">8 bit bidirectional bus to Pi-Zero and ARM</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">LVDS to "Olimex" style 2 x 16 connector</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">2 x 8 header for direct connection to 32 x 32 RGB matrix display.</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">100MHz clock oscillator</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">64K x 16 fast SRAM - can be upgraded to 512K x 16.</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<strong style="line-height: 1.57143em;"><span style="font-family: inherit;">Pi Section</span></strong></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;"><br clear="none" /></span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">Standard 2 x 40 GPIO header for Raspberry Pi GPIO</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">EEPROM for PIHAT identity</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<strong style="line-height: 1.57143em;"><span style="font-family: inherit;">Other</span></strong></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<strong style="line-height: 1.57143em;"><span style="font-family: inherit;"><br clear="none" /></span></strong></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">Efficient dual voltage switching regulator</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">4 USER switches</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">5 USER LEDs</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">RESET switch</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">BOOT switch</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">All I/O on 0.1" grid - wherever possible</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<strong style="line-height: 1.57143em;"><span style="font-family: inherit;"><br /></span></strong></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<strong style="line-height: 1.57143em;"><span style="font-family: inherit;">Applications.</span></strong></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;"><br clear="none" /></span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">1. As a stand alone versatile application controller</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;"><br clear="none" /></span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">2. As an advanced Analogue and Digital I/O board for the Raspberry Pi and Pi Zero</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;"><br clear="none" /></span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">3. As a teaching platform for learning 32 bit ARM and FPGA programming.</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;"><br clear="none" /></span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">4. As a platform for developing Open Core cpus on the FPGA</span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;"><br clear="none" /></span></div>
<div style="background-color: white; border: 0px; color: #383838; line-height: 1.57143em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;">5. For high speed digital instrumentation - such as DSO or logic analyser</span></div>
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<b style="background-color: white; color: #222222; line-height: 18.48px;"><span style="font-family: inherit;">Cost Reduction</span></b><br />
<span style="font-family: inherit;"><b style="background-color: white; color: #222222; line-height: 18.48px;"><br /></b><span style="background-color: white; color: #222222; line-height: 18.48px;">Keeping the cost down was a primary concern, yet we wanted to make a board that was genuinely useful.</span></span><br />
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<span style="background-color: white; color: #222222; font-family: inherit; line-height: 18.48px;">To achieve this, Alan came up with a unique strategy:</span><br />
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<span style="background-color: white; color: #222222; font-family: inherit; line-height: 18.48px;">1. Low cost FPGA with open source tool chain</span><br />
<span style="background-color: white; color: #222222; font-family: inherit; line-height: 18.48px;">2. Low cost ARM - to act as "system integrator" and glue.</span><br />
<span style="background-color: white; color: #222222; font-family: inherit; line-height: 18.48px;">3. On board Pi Zero - to host the open source FPGA tools - user supplies this at $5.00</span><br />
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<span style="background-color: white; color: #222222; font-family: inherit; line-height: 18.48px;">Having settled on the ICE40HX4K - as the largest ICE40 available in an LQFP package - and thus more easily routed on a 2 layer board than a BGA part, we set about identifying the other key components.</span><br />
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<span style="background-color: white; color: #222222; font-family: inherit; line-height: 18.48px;">Having seen James Bowman's J1a Forth Processor - a soft core running in an ICE40HX1K part, I wanted to add a fast (10nS) 16 bit wide SRAM - which in a TSSOP-44 package allows parts between 64K and 512K words. With this combination comes the ability to create a number of soft core processors, of which the 16 bit simple processor described in the "Nand to Tetris" course would seem a very suitable candidate.</span><br />
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<span style="background-color: white; color: #222222; font-family: inherit; line-height: 18.48px;">Other applications include digital instrumentation that require large arrays of fast memory - such as digital oscilloscopes and logic analysers.</span><br />
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<span style="background-color: white; color: #222222; font-family: inherit; line-height: 18.48px;">The lynchpin in this design is the use of a low cost ARM device, not only to provide USB communications, storage (in flash) of the FPGA bitfile, plus provide a series of ADCs and 5V tolerant GPIO pins and peripherals to augment the FPGA architecture.</span><br />
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<b style="background-color: white; color: #222222; line-height: 18.48px;"><span style="font-family: inherit;">Costing</span></b><br />
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<span style="background-color: white; color: #222222; font-family: inherit; line-height: 18.48px;">We believe that if an FPGA board sells for around $30 then it will attract a fair bit of attention.</span><br />
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<span style="background-color: white; color: #222222; font-family: inherit; line-height: 18.48px;">This was going to be tricky - so we set ourselves a BOM on a very tight budget of arount $10 based around the principal components - costed in 100 and 1000 off quantities:</span><br />
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<span style="background-color: white; color: #222222; font-family: "courier new" , "courier" , monospace; line-height: 18.48px;"><b> 100 off 1000 off</b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="background-color: white; color: #222222; line-height: 18.48px;"><b><br /></b></span><span style="background-color: white; color: #222222; line-height: 18.48px;"></span><span style="background-color: white; color: #222222; line-height: 18.48px;"><b>FPGA $5.56 $5.37</b></span></span><br />
<span style="background-color: white; color: #222222; font-family: "courier new" , "courier" , monospace; line-height: 18.48px;"><b>ARM $1.20 $1.00</b></span><br />
<span style="background-color: white; color: #222222; font-family: "courier new" , "courier" , monospace; line-height: 18.48px;"><b>SRAM $1.69 $1.22</b></span><br />
<span style="background-color: white; color: #222222; font-family: "courier new" , "courier" , monospace; line-height: 18.48px;"><b>PCB $0.88 $0.49</b></span><br />
<span style="background-color: white; color: #222222; font-family: "courier new" , "courier" , monospace; line-height: 18.48px;"><b>Connectors $0.50 $0.40</b></span><br />
<span style="background-color: white; color: #222222; font-family: "courier new" , "courier" , monospace; line-height: 18.48px;"><b>Remainder $0.50 $0.40</b></span><br />
<span style="background-color: white; color: #222222; font-family: "courier new" , "courier" , monospace; line-height: 18.48px;"><b> </b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="background-color: white; color: #222222; line-height: 18.48px;"><b><br /></b></span><span style="background-color: white; color: #222222; line-height: 18.48px;"></span><span style="background-color: white; color: #222222; line-height: 18.48px;"><b>Sub Total $10.33 $8.88</b></span></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="background-color: white; color: #222222; line-height: 18.48px;"><b><br /></b></span><span style="background-color: white; color: #222222; line-height: 18.48px;"></span><span style="background-color: white; color: #222222; line-height: 18.48px;"><b>LOP $2.58 $2.22</b></span></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="background-color: white; color: #222222; line-height: 18.48px;"><b><br /></b></span><span style="background-color: white; color: #222222; line-height: 18.48px;"></span><span style="background-color: white; color: #222222; line-height: 18.48px;"><b>Total $12.91 $11.10</b></span></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="background-color: white; color: #222222; line-height: 18.48px;"><b><br /></b></span><span style="background-color: white; color: #222222; line-height: 18.48px;"></span><span style="background-color: white; color: #222222; line-height: 18.48px;"><b>Pi Zero $5.00 $5.00</b></span></span><br />
<div style="background-color: white; color: #222222; line-height: 18.48px;">
<span style="font-family: inherit;"><br /></span></div>
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<span style="background-color: white; color: #222222; font-family: inherit; line-height: 18.48px;">So in 1000 of quantity, the BOM and manufacturing (LOP = Labour, Operations Profit) comes to a total of around $11, which allows a selling price of about $30.</span><br />
<span style="font-family: inherit;"><br style="background-color: white; color: #222222; line-height: 18.48px;" /></span>
<span style="background-color: white; color: #222222; font-family: inherit; line-height: 18.48px;">The customer provides their own Raspberry Pi or Pi Zero, from as little as $5.00.</span>Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com2tag:blogger.com,1999:blog-16736699.post-5867867355287614752016-11-12T12:11:00.001+00:002016-11-12T12:18:30.002+00:00A Storm in the Making<div style="color: #383838;">
<strong style="line-height: 1.57143em;">This post was originally written in late July - during the design phase of myStorm. Unfortunately this and other posts were accidently deleted, but have now been partially recovered.</strong></div>
<div style="color: #383838;">
<strong style="line-height: 1.57143em;"><br /></strong></div>
<div style="color: #383838;">
<b>From now this blog will continue on my <a href="https://nanode0000.wordpress.com/" target="_blank">Wordpress site</a></b></div>
<br />
Before rushing into mass production of any new product it is sensible to carry out a pilot production run - to make sure that everything works - before you commit to the expense of full production.<br />
<br />
My career for the last 20 years has taken me through several such pilot production runs, for various companies and individuals around the world. In many cases I was the hardware engineer on the project - and it was therefor expected that I would oversee the pilot and main roduction runs. As a consequence, I have been travelling to Shenzhen, China, many times since 1999.<br />
<br />
Over the years, I have worked with many great people over there, who have gone out of their way to ensure that production runs smoothly, and to ease the stress of meeting tight deadlines in a very foreign country. As a result, I have made many good friends, who are willing to get involved or help out, however they can, in any new project.<br />
<br />
The tight timescales of the myStorm Project meant that we would have to combine the Pilot Production with an immediate small run of production units, and this naturally put extra demands on time and resources. However, I am pleased to report that everything went as smoothly as expected, and we now have a batch of 50 myStorm boards heading back to the UK.<br />
<br />
In this blogpost, I'll try to give a flavour of some of the challenges we have faced over the run up to and then Pilot production run.<br />
<br />
<b>Sourcing the Components.</b><br />
<br />
I needed to source at least 50 sets of components for the Pilot Production, and this was further complicated in that some of these were sourced in the UK and needed to be shipped across to Shenzhen in time for production. I then found out from a contact at RS Exports Department, that Chinese Customs were cracking down on small shipments - and as such I would be heavily penalised for import duty, or components would be delayed or confiscated in Customs. This was not what I wanted to hear, as any uncontrolled delay might jeopardise our chances of getting the goods back into the UK by Friday 2nd September.<br />
<br />
My task was to source the sets of ICs that would be used on myStorm. This included the ICE40 4K FPGA and the ARM Cortex microcontroller and a couple of smaller parts.<br />
<br />
The ICE40 was in short supply in the UK, so I had to purchase from Mouser in the USA and have 33 parts shipped across. These arrived on Thursday 11th August, and were repackaged and ready to ship on Monday 15th, along with the other ICs.<br />
<br />
I found the Chinese Customs site very confusing - so I decided to sent the ICs to my friend Eva, in Hong Kong, so that she could fill out the necessary customs declaration in Mandarin, and choose a local courier company who could deliver the ICs across to Toby in Shenzhen.<br />
<br />
The distance between Hong Kong and Shenzhen is barely 20 miles, but with the complication of "1 Nation 2 systems" this courier process took about 5 days to complete. Toby received all of the ICs on Monday 22nd August.<br />
<br />
Meanwhile, Toby had been visiting the Shenzhen Electronics Market and purchasing all of the smaller items on the BOM - such as the passives, connectors, switches, LEDs etc. These items are seriously cheap in China - as most of them are locally produced, whereas ICs generally still come from Western Suppliers, and tend to have little price advantage when bought in China.<br />
<b> </b><br />
<b>The Road to Production.</b><br />
<br />
Not quite a Tom Hanks movie, but with enough twists in the plot to challenge the small team we have working in China.<br />
<b> </b><br />
With the components sourced, it was time to deliver them to the pcb assembly factory- so that they could be placed on the solder pasted pcbs and run through the reflow oven.<br />
<b></b><br />
On Thursday, Toby messaged me to say that the "plate" - the foil stencil used to apply solder paste to the pads, had a problem and would have to be remade. This would cost $45 and take 24 hours. Not a huge monetary expense, but a delay in production to Friday/Saturday, leaving us just 5 days to ship the goods out of Shenzhen and back to the UK in time for the FPGA course at OSHCamp 2016.<br />
<br />
The solder stencil arrived at the factory late on Friday, and a couple of trial pcbs were made to ensure all was well - and that the voltage regulator circuit was producing a stable 1.2V for VCC and 3.3V as the main digital supply rail. I had insisted that we do these tests before placing the expensive main ICs - that represent about $15 per board.<br />
<br />
The voltage regulator tests went well, and so I was happy to comitt to the 4 panels of 12 boards to be fully populated with all components and run through the assembly and reflow process. Toby worked until 9pm Friday - to ensure everything was good to go - for an early morning start on Saturday to get the batch of boards completed.<br />
<br />
In order that I could be online to assist - it meant me getting up very early Saturday morning - about 4am, which is 11am in Shenzhen. Toby informed me that the factory were complaining that the pads used for the 0402 components were oversize and that some of the very light 0402 components were "Tomb-stoning". This is the process where the solder paste on 2 pad components does not melt evenly, and the surface tension effects of the first pad to melt causes the component to erect vertically - just like a tombstone.<br />
<br />
This was not good news - and I assured Toby that I had used the standard footprints for 0402 as supplied by EagleCAD. However - this was probably where I went wrong, and should have read some of the online guides about pad sizes and preventing tombstoning.<br />
<br />
Fortunately the problem was not excessive, and any components that did tombstone were easily corrected manually with a soldering iron. By 6pm Shenzhen time, the pcbs were finished and ready for collection.<br />
<br />
Toby and I could then relax - after what had been a long and stressful week.<br />
<br />
Summary of additional costs:<br />
<br />
Shipping ICs to Hong Kong from UK $85<br />
Shipping ICs to Shenzhen plus Chinese import duty (17%) $165<br />
New solder stencil $45<br />
Shipping goods by DHL Express to UK<br />
<b><br /></b>
<b>Lessons for the Future</b><br />
<br />
Shipping ICs around the world often attracts additional costs of import duty - worsened if you then need to pay again when they arrive back in the UK. However because many of the ICs were sourced in the UK and US - we had no real option. Part of the way through this traumatic 2 weeks, I found out that Mouser have a Chinese Division and that almost all of the Western sourced ICs could be bought from Mouser in Shenzhen - and not attract additional charges. This will be the preferred way - moving forwards into volume production.<br />
<br />
Because of delays in the Pilot Production, it left us little time to ship the boards back to the UK - and so a more expensive Express service had to be employed. With a little more time and a little less rushing around - this would have saved a bit of money. <br />
<br />Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com1tag:blogger.com,1999:blog-16736699.post-40895279962202041022016-11-12T12:11:00.000+00:002016-11-12T12:18:59.831+00:00Brewing Up a Storm<div style="color: #383838;">
<strong style="line-height: 1.57143em;">This post was originally written in early July - during the design phase of myStorm. Unfortunately this and other posts were accidently deleted, but have now been partially recovered.</strong></div>
<div style="color: #383838;">
<strong style="line-height: 1.57143em;"><br /></strong></div>
<div style="color: #383838;">
<b>From now this blog will continue on my <a href="https://nanode0000.wordpress.com/" target="_blank">Wordpress site</a></b></div>
<br />
This week we saw the arrival of the first batch of myStorm pcbs from Toby in Shenzhen. The gerbers were sent on Thursday 21st July and pcbs - plus solder stencil arrived the following Thursday lunchtime - quick work.<br />
<br />
Meanwhile Alan and I had been out shopping for the BOM parts - with enough components to build up a small prototype batch of about 5 boards.<br />
<br />
We got together on Friday evening at the Surrey and Hants Hackspace, and managed to spend a couple of hours painstakingly placing the 80 or so 0402 parts onto the freshly screen-stenciled - solder pasted sample pcb.<br />
<br />
In fading light we retired with more than half the SMT components placed, with a view to completing the task in the fresh morning light - when both our eyes and hand co-ordination would benefit from a good night's sleep.<br />
<br />
The placement continued for another 2 hours in the morning and by 11:30 we had a fully placed board. After some basic checks for IC alignment - we turned on Alan's home made hotplate - an aluminium block, with a cartridge heater and a cheap temperature controller. Setting the temperature to about 220C - within 5 minutes the board was starting t show positive signs of solder paste reflow.<br />
<br />
The pasting operation had been not 100% successful, - the definition of the solder pads around the pins was far from perfect - but with the application of heat - and the miracles of surface tensio - the solder flowed beautifully - leaving perfectly soldered pins and 0402 components.<br />
<br />
A quick bit of remedial work to fix any "tombstoned" components, I was onto the last leg of this demanding race - and soldering the PMOD and Arduino connectors into the remaining throough-hole locations on the board.<br />
<b><br /></b>
<b>Initial Tests</b><br />
<b><br /></b>
Check, check and check again - then correct the things you missed.<br />
<br />
First we checked for supply to ground shorts - and the 3V3 was connected to 0V - because a single 0402 100nF decoupling capacitor had moved sideways across its pads and was shorting across them. Easily fixed - but not so easy to spot in the first place. A few solder bridges between pins on the 64 pin LQFP ARM package - again easily fixed with the soldering iron and a dab of water-solvent based SMT flux.<br />
<br />
Then it was time to apply the 5V power and test the power rails. All appeared well with 1.2V for the Vcore and 3V3 as the digital supply to the ARM and the FPGA.<br />
<br />
On first power-up some of the LEDs glowed dimly - and the power light glowed yellow.<br />
<br />
Next we had to find a way of getting some life into the ARM chip - an STM32F103RC - the same as used on the Nucleo dev board. I opted to get "Blinky" running - using mBed to program the board.<br />
<br />
Downloaded the ST Link Utility - which included the latest drivers and the programming application. Once this was down loaded it was relatively easy to use the blink example, change the port Pin to PA_15 and flash the LED!<br />
<br />
A first success! <br />
<br />
<br />
Tomorrow - there are 2 more prototype pcbs to populate and bake. Once you have done the first one - fixed the snags - the rest is easy.Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-36274190698348802832016-11-12T12:08:00.000+00:002016-11-12T12:10:23.481+00:00The Missing PostsIn July, I accidently deleted about 6 months of posts. These fortunately have now been partially recovered and moved across to my <a href="https://nanode0000.wordpress.com/" target="_blank">wordpress site.</a><br />
<br />
I hope you join me on the other site.<br />
<div id="footer" style="border-top: thin solid rgb(226, 226, 226); color: #666666; font-family: Verdana, Geneva, sans-serif; font-size: 0.8em; font-weight: bold; height: 65px; margin-left: 0px; width: 1322.02px;">
<div id="footer" style="border-top: thin solid rgb(226, 226, 226); font-size: 0.8em; height: 65px; margin-left: 0px; width: 1322.02px;">
</div>
</div>
Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-63229547072218032782016-11-11T13:01:00.002+00:002016-11-11T13:01:57.425+00:00Chipstick - a diminutive MSP430 FRAM Forth ComputerRecovered from an accidental delete!<br />
<br />
<ul style="background-color: white; font-family: Verdana, Geneva, sans-serif; list-style: none; margin: 0px; padding: 0px;"><div class="itembody" style="margin-left: 22px; margin-right: 22px; margin-top: 0px; overflow: hidden; padding-bottom: 9px; padding-top: 9px;">
<div style="color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-bottom: 1.5em; margin-right: 2em; margin-top: 0em; padding-left: 30px;">
Last week, I wrote about the $5 Forth Computer, and showed an early breadboard version using an MSP430FR2433 mounted on a prototyping adaptor and plugged into a breadboard.<br />
<br />
Well, I am pleased to report that the batch of 20 prototype pcbs have arrived back from the manufacturer earlier today and the build of the first unit is underway.<br />
<br />
The following pictures show the build sequence - starting from the bare pcb<br />
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="ChipStick - An Small Scale Experimental Forth Machine" border="0" height="197" indx="12702085" rank="166" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8KbWpj6yVUMTaqmhnd3aLLbS9BDmhC-FdJVb1c141ZLY4sFmLX_lTvUftL93U69PMa6n6K2dZeLZyERTyb_7ycNeJRWtXRoxpO-zg7ufdg5XQJiuL7pgBZqPZd9YyC_-Lg4Dp/s320/ChipStick_upper.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">Top side of unpopulated ChipStick board - millimetre scale!</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="ChipStick - An Small Scale Experimental Forth Machine" border="0" height="189" indx="12702085" rank="166" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigUfS8tl5mAZ1kOPk7wEyRjv0Q9WRiAr5ExSxf3kf3Bzl3OxFwkbxih5GeayvGM0vcW3plkK277r5WX2ruGaScG7KwdxvVYqMUaOjI3LuBpUs7Pb_SS-6Ha7q6My1xq0-2KNMj/s320/ChipStick_lower.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">Underside of ChipStick pcb with locations for SRAM and USB converter IC</td></tr>
</tbody></table>
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="ChipStick - An Small Scale Experimental Forth Machine" border="0" height="98" indx="12702085" rank="166" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_WEVF-fObRImC42wgUDUyBJxc0ElurMdjS0VakHEzr0nkkyyw-CRejaQiyamuTNTarwGgoMhGCh6NeJ1cp6a2YawBOSS2zaXxMzIHvbs1Xbzm1dtzQd4eCOF4BEAKalSyG8WP/s320/ChipStick_3.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">ChipStick with USB connector, regulator and MCU added</td></tr>
</tbody></table>
<br />
<br />
The ChipStick design has the following features:<br />
<br />
<ol>
<li style="font-size: 0.8em; font-weight: bold; line-height: 1.2em; list-style-image: url("/inc/img/icon_arrow.gif"); list-style-position: outside; margin-bottom: 10px; margin-left: 40px; margin-top: 10px; text-indent: 0em;">MSP430FR2433 with 15.5K FRAM and 4K SRAM</li>
<li style="font-size: 0.8em; font-weight: bold; line-height: 1.2em; list-style-image: url("/inc/img/icon_arrow.gif"); list-style-position: outside; margin-bottom: 10px; margin-left: 40px; margin-top: 10px; text-indent: 0em;">External SRAM or FRAM device connected via SPI on USCI B0</li>
<li style="font-size: 0.8em; font-weight: bold; line-height: 1.2em; list-style-image: url("/inc/img/icon_arrow.gif"); list-style-position: outside; margin-bottom: 10px; margin-left: 40px; margin-top: 10px; text-indent: 0em;">CH340G USB to serial converter IC on detachable section of board</li>
<li style="font-size: 0.8em; font-weight: bold; line-height: 1.2em; list-style-image: url("/inc/img/icon_arrow.gif"); list-style-position: outside; margin-bottom: 10px; margin-left: 40px; margin-top: 10px; text-indent: 0em;">3V3 voltage regulator</li>
<li style="font-size: 0.8em; font-weight: bold; line-height: 1.2em; list-style-image: url("/inc/img/icon_arrow.gif"); list-style-position: outside; margin-bottom: 10px; margin-left: 40px; margin-top: 10px; text-indent: 0em;">Reset Switch and User LED</li>
<li style="font-size: 0.8em; font-weight: bold; line-height: 1.2em; list-style-image: url("/inc/img/icon_arrow.gif"); list-style-position: outside; margin-bottom: 10px; margin-left: 40px; margin-top: 10px; text-indent: 0em;">20 Pin DIL footprint to allow insertion into G2 Launchpad socket.</li>
<li style="font-size: 0.8em; font-weight: bold; line-height: 1.2em; list-style-image: url("/inc/img/icon_arrow.gif"); list-style-position: outside; margin-bottom: 10px; margin-left: 40px; margin-top: 10px; text-indent: 0em;">Programmable by SBW or BSL</li>
</ol>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="ChipStick - An Small Scale Experimental Forth Machine" border="0" height="261" indx="12702085" rank="166" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyv1UGoTzxh46Htu6Z8Ga1g9Xv8hNyPJfAT1LZe5BtoyUu21e8hTHHVaujKxUwK7t6UWXYbxz_w6wX2GSRNoHW9rApKL2mSV-lnFdXPHbckfusZYSpqvaLOfzojRVj_pVFr6rV/s320/ChipStick_blinky.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">ChipStick - code loaded and Flashing LED (before sunrise)</td></tr>
</tbody></table>
<br />
<br />
<br />
<br />
Next Time:<br />
<br />
<a href="https://www.blogger.com/null">Fast Forth - by Jean-Michel Thoorens</a><br />
<br />
This is an implementation of a Direct Threaded Code Forth, written in MSP430 assembly language. It communicates with a terminal program TeraTerm, at 921600 baud.<br />
<br />
I have it running on an MSP430FR5739 - can I port it to the '2433 on te ChipStick?<br />
<div style="color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-bottom: 1.5em; margin-right: 2em; margin-top: 0em; padding-left: 30px;">
</div>
</div>
<a href="https://www.blogger.com/null" name="item168"></a><a href="https://www.blogger.com/null" name="tag:blogger.com,1999:blog-16736699.post-5207654716469267531"></a><a href="https://www.blogger.com/null" name="157165540"></a><div class="itemtitle" style="background: none 0% 0% repeat scroll rgb(250, 250, 250); border: 1px solid rgb(204, 204, 204); margin-left: 22px; margin-right: 22px; margin-top: 10px; padding-bottom: 9px; padding-top: 9px;">
<div id="itemmnu" style="float: right; height: 36px;">
<a href="https://www.blogger.com/null" style="color: #e404f4;"><img src="https://www.rssing.com/inc/img/tmbtn.png" style="margin-right: 4px; margin-top: 4px; max-height: 100%; max-width: 100%;" title="Open menu" /></a></div>
<div id="itemshare" style="float: right; height: 36px;">
<a href="https://www.blogger.com/null" style="color: #e404f4;"><img src="https://www.rssing.com/inc/img/tsbtn.png" style="height: 22px; margin-right: 4px; margin-top: 6px; max-height: 100%; max-width: 100%; width: 22px;" title="Share" /></a></div>
<div id="upVoteDiv" style="float: right; font-size: 0.6em; height: 36px;">
<table><tbody>
<tr valign="middle"><td id="upVoteDesc-10" style="height: 36px;">0</td><td style="height: 36px; vertical-align: middle; width: 36px;"><img id="upVoteImg-10" src="https://www.rssing.com/inc/img/tup-blue.png" style="cursor: pointer; max-height: 100%; max-width: 100%;" /></td><td id="dnVoteDesc-10" style="height: 36px;">0</td><td style="height: 36px; vertical-align: middle; width: 36px;"><img id="dnVoteImg-10" src="https://www.rssing.com/inc/img/tdown-blue.png" style="cursor: pointer; max-height: 100%; max-width: 100%;" /></td></tr>
</tbody></table>
</div>
<div>
<br />
<li style="font-size: 0.8em; font-weight: bold; line-height: 1.2em; list-style-image: url("/inc/img/icon_arrow.gif"); list-style-position: outside; margin-bottom: 10px; margin-left: 40px; margin-top: 10px; text-indent: 0em;">03/27/16--02:11: <a href="http://suburbia86.rssing.com/browser.php?indx=12702085&item=168" style="color: #ff3333;">ChipStick - Applications</a></li>
</div>
</div>
<div class="itembody" style="margin-left: 22px; margin-right: 22px; margin-top: 0px; overflow: hidden; padding-bottom: 9px; padding-top: 9px;">
<div style="color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-bottom: 1.5em; margin-right: 2em; margin-top: 0em; padding-left: 30px;">
<b>Introduction</b><br />
<b><br /></b>ChipStick is a tiny 16 bit microcomputer attached to a PC via a USB cable. It comes with up to 256K bytes of non-volatile memory - uniquely using ferro-electric memory.<br />
<br />
It has up to 16 accessible GPIO lines - which include a mix of SPI, I2C, UART, Timer and ADC channels.<br />
<br />
ChipStick may be plugged into a breadboard or stripboard and act as an intelligent programmable controller interfacing with other circuitry.<br />
<br />
ChipStick can also act as a Digital Debug Tool (DDT), with jumper wire attached, - used to debug/develop low voltage (3V3) target hardware.<br />
<br />
In each case, the extendable Scripting Language SIMPLEX may be tailored to the exact requirements of the user' application.<br />
<br />
ChipStick is based on non-volatile ferroelectric technology. This means that your applications and any recorded data remain in memory even after power down.<br />
<br />
ChipStick may be extended in hardware to meet the requirements of the application - this is planned through both a series of larger expansion boards (based on low cost 50x50mm format) and stackable micro-modules that match the DIL 20 socket format.<br />
<br />
<b>Applications</b><br />
<br />
With these primary applications in mind, ChipStick has been designed to be as versatile as possible - within the constraints of the small footprint.<br />
<br />
As a debug tool, it is no bigger than a USB Stick - easily carrier around with essential hacking tools.<br />
<br />
I have designed it as a socketable component that can easily be added to a board - where a small amount of intelligence is required, or for bridging between sensor devices. It can also collect or send data to SPI devices and bridge that back to the PC via the UART channel.<br />
<br />
Equally, it could be used as a small test equipment device to exercise, monitor or control prototype hardware - it has 16 GPIO lines - including two full SPI ports. These can be attached to the target hardware, and using the SIMPLEX scripting language, the various target hardware can be exercised and data reported back to the PC.<br />
<br />
With the right SIMPLEX script, it can be used to transfer a hex, bin or ascii file from the PC to the target under development.<br />
<br />
The external memory may be used for sensing and datalogging applications, capturing waveforms, playing back arbitrary waveforms - as a signal generator. The ADC channels may be used as a low bandwidth oscilloscope, test meter or for monitoring changing physical quantities in science experiments.<br />
<br />
ChipStick takes much advantage from the trend in modern sensors and peripherals to connect via the SPI or I2C bus. The MSP430FR2433 device provides up to 3 separate SPI buses.<br />
<br />
ChipStick can be interfaced to Wirelss and WiFi modules such as the RFM69 and the low cost ESP-01.<br />
<br />
Suitable sensors include accelerometers, gyroscopes, digital compass, temperature, pressure, loadcells etc.<br />
<br />
For basic GPIO operations - common shift registers may be used with the SPI bus such as the 74HC595 for 8-bits output - for driving LED arrays, the high power TPIC6B595 for driving stepper motors, and the 74HC165 for 8-bit inputs.<br />
<br />
Using a LED driver IC - such as the MAX7219 or <a href="https://www.blogger.com/null">AS1100 series</a> - up to 8 digits or an 8x8 array of LEDs may be driven from the SPI port.<br />
<br />
OLED and LCD graphics displays may also be driven from SPI with a couple of control signals.<br />
<br />
<br />
<b>Educational Applications</b><br />
<b><br /></b><span style="font-family: "times" , "times new roman" , serif;"><span style="color: #222222; line-height: 16.8px;">ChipStick as been designed with education and experimentation in mind.</span></span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span><span style="font-family: "times" , "times new roman" , serif;">It can be used specifically to assist in the teaching of electronics, computer science and interactive coding.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span><span style="font-family: "times" , "times new roman" , serif;">It is versatile enough to meet the needs of high-school and university undergraduates, plus simple enough meet the requirements of the maker and hacker community.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span><span style="font-family: "times" , "times new roman" , serif;">The small size of ChipStick allows it to be used to give intelligence and connectivity in situations where other technology is just too bulky to fit - w</span>ith the programmer section detached it is only 26.5 x 11mm - small enough to fit inside a 4x2 Lego block!<br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span><span style="font-family: "times" , "times new roman" , serif;">It's low cost means that it can deployed in areas where other solutions might prove too expensive.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span><span style="font-family: "times" , "times new roman" , serif;">Here are a few of the educational applications:</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /><b>Teaching Forth.</b></span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span><span style="font-family: "times" , "times new roman" , serif;">Forth is an interactive language and can be best taught with hardware that creates a stimulating interactive environment. This includes the use of LEDs, sound, touch and movement (such as stepper motors and servos).</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /><span style="color: #222222; line-height: 16.8px;">The MSP430 is a good fit for a "traditional" Forth machine - with 16 bit Von Neuman architecture.</span><br style="color: #222222; line-height: 16.8px;" /><br style="color: #222222; line-height: 16.8px;" /><span style="color: #222222; line-height: 16.8px;">MSP430FR2433 with 16K FRAM and 4K RAM is reminiscent of the early minicomputers that Charles Moore would have first coded Forth onto in the late 1960s.</span><br style="color: #222222; line-height: 16.8px;" /><br style="color: #222222; line-height: 16.8px;" /><span style="color: #222222; line-height: 16.8px;">I have added the external SPI memory - specifically so that users can experiment and learn about interpreted languages running on virtual machines. OK - single byte access to external RAM takes approx 30uS - but block access is 3uS per byte. ChipStick will come with a 128Kx8 external SRAM 23LC1024, or FRAM to special order.</span><br style="color: #222222; line-height: 16.8px;" /><br style="color: #222222; line-height: 16.8px;" /><span style="color: #222222; line-height: 16.8px;">The SPI buses on the MSP430FR2433 allow expansion hardware like sensors and shift registers, LED & graphic display drivers etc to easily be added - with minimum of wiring.</span></span><br />
<span style="font-family: "times" , "times new roman" , serif;"><span style="color: #222222; line-height: 16.8px;"><br /></span></span><span style="font-family: "times" , "times new roman" , serif;"><span style="color: #222222; line-height: 16.8px;"><br /></span></span><span style="font-family: "times" , "times new roman" , serif;"><span style="color: #222222; line-height: 16.8px;"><b>Teaching Coding</b></span></span><br />
<br />
<span style="font-family: "times" , "times new roman" , serif;"><span style="color: #222222; line-height: 16.8px;">ChipStick is not limited to Forth - it is easily programmed in C with CCS or Energia, BASIC or in native MSP430 assembly language.</span></span><br />
<span style="font-family: "times" , "times new roman" , serif;"><b><br /></b></span><span style="font-family: "times" , "times new roman" , serif;"><b>Teaching Digital Electronics</b></span><br />
<span style="font-family: "times" , "times new roman" , serif;"><b><br /></b></span><span style="font-family: "times" , "times new roman" , serif;">ChipStick can animate electronics in a low cost way not previously possible. With a breadboard and a few LEDs and switches, ChipStick can form the central controller of many digital projects.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span><span style="font-family: "times" , "times new roman" , serif;">It's ability to easily interface to displays, sensors and actuators allows it to make projects exciting.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span><span style="font-family: "times" , "times new roman" , serif;">ChipStick can also be used to exercise digital electronics, and report results back to a PC for display on a graphical user interface. In teaching environments where real hardware may not be possible or practical - ChipStick can use virtual hardware and achieve most of the same educational aims.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span><span style="font-family: "times" , "times new roman" , serif;"><b>Making & Hacking</b></span><br />
<span style="font-family: "times" , "times new roman" , serif;"><b><br /></b></span><span style="font-family: "times" , "times new roman" , serif;">As a result of it's low cost, ChipStick can be used in projects where other solutions may seem over expensive. Projects no longer need to be stripped down, to salvage the $20 Arduino for another purpose. ChipSticks will be supplied in multi-packs at very low prices - so that the cost of the device is no longer seen to be a barrier to creativity.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span><span style="font-family: "times" , "times new roman" , serif;">ChipStick is compatibe with Energia - an "Arduino Like" IDE. This allows an easy transition to the new device from familiar territory.</span></div>
</div>
</ul>
Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com1tag:blogger.com,1999:blog-16736699.post-55845866941163530572016-11-11T12:59:00.000+00:002016-11-11T12:59:06.080+00:00Building Chipstick<div style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-bottom: 1.5em; margin-right: 2em; margin-top: 0em; padding-left: 30px;">
Recovered from an accidentally deleted blog!</div>
<div style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-bottom: 1.5em; margin-right: 2em; margin-top: 0em; padding-left: 30px;">
<br /></div>
<div style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-bottom: 1.5em; margin-right: 2em; margin-top: 0em; padding-left: 30px;">
Nobody is expecting you to build a ChipStick from scratch - unless you are very keen.<br /><br />The ability to work with tiny SMT parts is not one everyone possesses, but it can quite easily be learned, and with practice, good results are possible with the simplest of tools and equipment.<br /><br />This post follows the construction process step by step - for the curious - or for those brave or foolish to wish to follow in my footsteps.<br /><br /><b>Equipment</b><br /><b><br /></b>SMT Hot Air Rework station with choice of nozzles - I used 8mm<br />Soldering iron with "needle" tip<br />Soldering sponge<br />Flux pen or water soluble SMT flux<br />Tweezers (stainless steel - non-magnetic)<br />0.38mm 60/40 solder (Don't struggle with lead-free - it's dreadful).<br />x10 magnifying eyepiece<br />good overall lighting - use spot light or bright daylight<br />scalpel or craft knife<br />3rd Hand<br />Bluetack - stick the pcb to the bench to stop it moving<br />De-Solder braid - accidents can happen<br />Patience - set a day aside for this, without interruptions<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="background-color: white; color: black; font-family: Verdana, Geneva, sans-serif; margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="238" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrGLtTPEt7b4OVRnjxS1BR1Xxe8nj5XFA626WfnEZyV9GBimVwso5slIniieVYDneXBcBtGLmhARoOPHmE1KxiFwDiWRKT45qn3DdkmJ5jMtCd_G5kYBbJlqQ_2y4MuxyVUl5r/s320/flux_pen.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption"><b>Use a Flux Pen to flux the footprint of the main IC</b></td></tr>
</tbody></table>
<span style="background-color: white; font-family: Verdana, Geneva, sans-serif;">Flux is essential for good solder wetting. Use it liberally on the multipin footprints - such as mcu and other ICs. I use a rosin flux pen for convenience, but there are now some water soluble fluxes that wash off the board with water and an old toothbrush.</span><br style="background-color: white; font-family: Verdana, Geneva, sans-serif;" /><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="background-color: white; color: black; font-family: Verdana, Geneva, sans-serif; margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="214" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjulLsB3StkRjUJ5o07lBeXgbdt7E2hUBlbXGMKRxaYshFH9hc0eYCEGSFLH8VOVTonAYXEtcP1JEUWcASosRKNlaA3_0XszR2yhi1GvOjPEk7DL8CNIm3aHew2hTF7It5pgVTT/s320/solder_prep_0.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">Use a soldering iron and add some solder to the IC pads<br />but not the centre one!</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="background-color: white; color: black; font-family: Verdana, Geneva, sans-serif; margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="111" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqqyMMlYoyjGjxEac1P17GBkAmpom_oltmz6STRh83PclysY0V8bJgSZ-cZR1zRts2x2ehCBMmOw5GbgDAbaf7pLq8T9RSJlhqhIsai-oCgW8-PNJuEL-paMMBqqJpGj_Ffyit/s320/mcu_tinning_2.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">MCU footprint with solder applied</td></tr>
</tbody></table>
<span style="background-color: white; font-family: Verdana, Geneva, sans-serif;">These boards have been "hot air solder levelled" or HASL. They are easy to solder, but for IC pins you need to build up a little more solder thickness on the pads - and don't forget to flux well.</span><br style="background-color: white; font-family: Verdana, Geneva, sans-serif;" /><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="background-color: white; color: black; font-family: Verdana, Geneva, sans-serif; margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="320" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjteqe3JLe3KUZHCiTasBAknkHdhlrdoqofWLZBu-6hl2h_Ei9LhQl0f45g9Simay8ZHf4bo5Ucqx5FBcOqjHE_m13TA5LhZ6pcRhvk6exzfRSr8EXpGyhzuQIHlXQ2G-JKzWaY/s320/solder_prep_1.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">Flux the underside of the IC package<br />and also reflux the pads on the board </td></tr>
</tbody></table>
<div class="separator" style="background-color: white; clear: both; font-family: Verdana, Geneva, sans-serif; text-align: center;">
</div>
<span style="background-color: white; font-family: Verdana, Geneva, sans-serif;">I first position the mcu centrally on the footprint pads with tweezers. The flux heps to hold it in place. Check from the sides that al the pins line up, and check again that Pin 1 is in the correct position!!</span><br />
<div style="background-color: white; font-family: Verdana, Geneva, sans-serif;">
<br /></div>
<div style="background-color: white; font-family: Verdana, Geneva, sans-serif;">
Set the temperature of the hot air tool to between 370C and 400C.</div>
<div style="background-color: white; font-family: Verdana, Geneva, sans-serif;">
<br /></div>
<div style="background-color: white; font-family: Verdana, Geneva, sans-serif;">
When happy with positioning - use the hot air tool about 20mm above the IC and swirl the air around the IC in slow circular motions - about once every second. I count to 20, and usually the solder has melted and the IC is sitting squarely on the board - and not moved to either side. Don't spend more than 30 seconds with heat on any one component. Leave to cool - it will be hot!<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="312" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn7UB6tzSGB2C0yFhovTd5he7bn8hfGOPPQ-Ak8fkjr9KCD_rFvGrCsx1ynTQXbJND4cSKWB4y3QUBRWeFM7VxQf1chw6acz5tXAK6aEvqvBBCvJQo2nx2u5chc64XoqEgNrMt/s320/soldered_mcu.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 12.8px;">The mcu successfully soldered in position using hot air reflow tool<br />Now go around the pins with soldering iron checking every joint is good</td></tr>
</tbody></table>
Next I use the needle point tipped iron and rework every pin. I check that the solder reflows and that the soldered joints are bright silver an "fresh". There should be a neat solder fillet between the board and every contact of the QFN package.<br /><br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="320" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQeh9i6GLD6JxFEh34kovExioffuI8apGC-VcZOlHMpoDlNS4eRdE0vhLsJ1SvQ8zOl-mkIURR8UpxnuIY1x6WBBRI0sEMaT46Aag4AuPTFEY3wmcU8c1QwoWYzR82S3LXfmZ4/s320/magnificent_1110.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">Repeat 13 more times!</td></tr>
</tbody></table>
At this stage - I put the boards into a programming jig and made sure that they accepted the programmed code. If not I inspected carefully and reworked where necessary.<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="266" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7etkr299Twj3ROpF8bobKQQ7_QzT9NK84qqe_D8Y17Xf7z29bqXkVscp1L3EdgqiWfz_bgU5WCXJTeHefrFHa_8P-LlHGtv_qym0snnCHR8P_tLVjOg0XWXuit8U0HixqTJQJ/s320/topside_soldered.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">Voltage regulator and decoupling capacitors added - USB next </td></tr>
</tbody></table>
I then proceeded to put the remainder of the smaller components onto the top of the board - leaving the bulkier mini USB socket until I had completed all the work on the underside of the pcb first!<br /><br /><div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="103" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqQHBcUVgDvoMdZhIWlMzwWScrjUvPHDms8afG8BAJKhwksvMIBwUngcjKQWdIINXTb_TbxHlZjEIgzDp8VKIbzBOVJVw3ZCr-D7hyphenhyphenUpPizFM4VV6E13qAzqnjKcj4uiMaCuUB/s320/almost_done_top.jpg" style="max-height: 100%; max-width: 100%;" /></a></div>
<br /><br /><div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="265" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxFgoN8gprW59T1OLpOg_vgabNILCyP3MRiWRXinCPcmKRGR2PYx8FnXLWMk2OuJoB7sxvy_I0ddr1a-uVt8TRd37_m3JyiWQdLZM9tfUY9X4OhVcvoDBjnaIAVzBxuNCGaujo/s320/CH340G_fit.jpg" style="max-height: 100%; max-width: 100%;" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="320" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ84jlHBIJkIC7F4tlFKwe-9bNiDCBg9AxOaOGQhC5WPqt4cuhvHL9hV_DqrgCwZOlGwOG2l4z2bKs2F-HeliuDTgYoSJTyxR4BWpo_EKuBA0oUiXegvNVe2nQLhIQPp0-DMzm/s320/CH340G_fitted.jpg" style="max-height: 100%; max-width: 100%;" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="320" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKQ8bvZolzMFZF-u92jFIfsblsu0LigwsWLijRtRC-_8HNLSO1IhtbKT0cbyw3jvJLy1Nu7uvavsQU7M8Z1bhohTSw6Lw72UOwODbSxQwbGPG9wzilKjzXCkR8kyAiiIgPoUGN/s320/crystal_to_fit.jpg" style="max-height: 100%; max-width: 100%;" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="305" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit9jA00OP4HjfTzpxHfwmrB-ttV9iYFfctBTPkrOKoi6scHmN0iVwNkW3EK5XYJZtwFVlXA_1aD7BvaQYAIu36CDAv1bD_R9LaYYzOmKCDZn1JXmSyhLrQHa5lXI7EKoUTb6Fb/s320/caps_diode_fitted.jpg" style="max-height: 100%; max-width: 100%;" /></a></div>
<br /><br /><br /><div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="156" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDNDXZ76zu0iko6ISOrbWKbTTJkbIYI8mhDEzFjL6afPihjyXnEbI5WB1pLdM9-W5mFcS2bIS3oijY6yrwzKuIRC3J-0Ekm64NR-pnUcL0hfzH9zEsOLUcsXcF80AKuNevB0Fv/s320/new_topside.jpg" style="max-height: 100%; max-width: 100%;" /></a></div>
<br /><div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="165" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgr6VbCehRQvsjRyTQNFLdbetVRLeYeBoQyp2CTqeIKBBTPqqeP9at_w0ig9KRuyfD_qRulj1A7NMtDVUj43zoHeX6TSZ3b7CvJyNws9Tk7-_4wcypC4h2fyQnUpqz_y8gRdQxV/s320/rams_fitted.jpg" style="max-height: 100%; max-width: 100%;" /></a></div>
<br /><div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="266" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY7gHjeNQ7GyxfI2GjQQ42Ij-2VmAO0Mp3q-r2H22QxNaAcaAQkHYM651NEyqzC25hnvJrjhYoSojKY2LLpg5lUNjzHZ8rjfbrAm1qee48u7gaOdMxRbUtBBtLouBcS58InJCP/s320/topside_soldered.jpg" style="max-height: 100%; max-width: 100%;" /></a></div>
<br /><br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="210" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPm8_iNeDM8EdII6DCAvfY-r4pYLU0cAyPpBc-DCFCPtnPsiQ_JbmkQEhetyIH4bouUCvCGMo7OWWSU1rqsgCZFoaSF9P6O_COfL-bxkorBPPqr1SvbxsRqDukXG4H_FSAuJ6h/s320/new_underside.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">Underside of board with USB converter on left and 128K SRAM on right</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="156" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2TCCQA0hCfTs0JGeN3VVfzBauFRW_uVkX5DQHEuWnUw5GianlRF7FfNoddNbwNjwgtkgrRaXxW0PvjoS1_QExraDHZFkWwfBSrVCR7chbuRCtAtIau6aly7GAi6eR41umiuP4/s320/new_topside.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">Topside completed - undergoing testing</td></tr>
</tbody></table>
<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="272" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkKkNYLOyxutnFtEy3_P5O5yolFNoJdpF3hq05Iea5DL1Iq1wJbj_xAAYJ4nTKQjBKlqOrH7OvkTm-E9GKq5T_JPN9Zwo39OTCilvE5Qqj_L8O7YZtE_WENwRlt5Ygca3kX-Jb/s320/in_for_a+_penny.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">Four completed units - with penny for scale</td></tr>
</tbody></table>
<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="Building ChipStick - A Construction Guide" border="0" height="246" indx="12702085" rank="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhh-JS8n8KWVvNf90Ws7KZOQYSLmos_6uCPPhDnJadiqsoYbT1VFo8MnwB4mtLIQ33o_5xR2_jMEiBs9NMiiKq0Fmmz_BW_-N5ZTymuJBvnmj_F2tW5vPltVXlcRlsEX6t74IOM/s320/pin_choice_2.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">Choice of pins - left are for breadboard, right are to fit DIL 20 IC socket<br /></td></tr>
</tbody></table>
</div>
Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-38350893116677478662016-11-11T12:57:00.001+00:002016-11-12T15:18:17.617+00:00Bootloading Chipstick - the tiny MSP430 FRAM board<div style="background-color: white; line-height: 1.5em; margin-bottom: 1.5em; margin-right: 2em; margin-top: 0em; padding-left: 30px;">
<div style="color: #666666; font-family: arial, helvetica, sans-serif; font-size: 12px;">
<span style="font-family: inherit;">A Post from March to July 2016 - recovered after an accidental deleting session!</span></div>
<div style="color: #666666; font-family: arial, helvetica, sans-serif; font-size: 12px;">
<span style="font-family: inherit;"><br /></span></div>
<b><span style="color: #666666; font-family: inherit; font-size: 12px;">New and recovered posts can be found at </span><span style="color: #383838; font-family: inherit;">my</span></b><b style="color: #383838;"> <a href="https://nanode0000.wordpress.com/" target="_blank">Wordpress site</a></b></div>
<div style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-bottom: 1.5em; margin-right: 2em; margin-top: 0em; padding-left: 30px;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-bottom: 1.5em; margin-right: 2em; margin-top: 0em; padding-left: 30px;">
<span style="font-family: inherit;">Just over a month ago I talked about the <a href="https://www.blogger.com/null">MSP430 bootloader</a> - commonly known as BSL - or bootstrap-loader.</span><br />
<span style="font-family: inherit;"><br /></span><span style="font-family: inherit;">Almost every MSP430 has the facility to load code via this ROM based bootloader - and when first introduced about 15 years ago, it was ahead of its time. The clever engineers at Texas Instruments wanted a simple "Backdoor" method of getting code into the device, using nothing more than a 9 pin serial com port, some trivial level shifting electronics and a modest program running on a PC.</span><br />
<span style="font-family: inherit;"><br /></span><span style="font-family: inherit;">Whilst the 9 pin serial port may have long since disappeared, the BSL is still present in almost every chip - and not just for a UART connection, but for I2C and SPI interfaces too.</span><br />
<span style="font-family: inherit;"><br /></span><span style="font-family: inherit;">With the advent of ferroelectric, non-volatile FRAM memory in the recent range of MSP430 mcus there is all the more reason to want to leverage on the strengths of the BSL and develop neat new means to get code into these often understated devices. With a wireless or Bluetooth connection - firmware over the air (FOTA) becomes practical, and also "self-replicating" gadgets - where one MSP430 equipped gadget can "clone itself" into another unprogramed device - ideal for kids sharing hardware around the playground.</span><br />
<span style="font-family: inherit;"><br /></span><span style="font-family: inherit;"><b>What I have Learned this Month</b></span><br />
<span style="font-family: inherit;"><br /></span><span style="font-family: inherit;">I have now been using this bootloader on and off for a month, and wanted to share with you what I have learned - in the hope that things are easier for those that may wish to follow in my footsteps.</span><br />
<span style="font-family: inherit;"><br /></span><span style="font-family: inherit;">All the information is out there - it's just not all in one place, and a lot of time has been spent finding snippets here and there, and trying to make sense of it all. Like Captain Kirk said... "Our continuing, 5 year mission......"</span><br />
<span style="font-family: inherit;"><br /></span><span style="font-family: inherit;">To start off, you might wish to look at the following TI documentation</span><br />
<span style="font-family: inherit;"><br /></span><a href="https://www.blogger.com/null">Main Bootloader Specification</a><br />
<br />
<a href="https://www.blogger.com/null">MSP430FR4xx / MSP430FR2xx Users Manual</a><br />
<br />
<a href="https://www.blogger.com/null">MSP430FR4xx and MSP430FR2xx Bootloader (BSL)</a><br />
<br />
<br />
<span style="font-family: inherit;"><b>Hardware Initialisation</b></span><br />
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif;">
<span style="font-family: inherit;">The basic idea is that the PC uses the DTR line and the RTS line of the USB to Serial converter to create a pulse sequence which when recognised by internal state machine hardware, causes the MCU to enter Boot Mode.</span><br />
<span style="font-family: inherit;"><br /></span>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="The Great MSP430 Bootloader Swindle - Part 2" border="0" height="98" indx="12702085" rank="170" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7hWDcfCi7d6_Ydgl86Y9yV1jhGIvKJYBKeqIcIBTz78-ZOIVOZ9KNfYhyphenhyphenpvKI80_X4mXRBVhMTC4lbRWYAm-LANukYiqxTwAk2lGmKm37hztpwbxRui0FhxPiDTSHqVrCDjRo/s400/BSL_invoke.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption">The hardware sequence needed to invoke the Bootloader mode</td></tr>
</tbody></table>
<span style="font-family: monospace , monospace; font-size: xx-small;"> </span></div>
<div style="background-color: white; font-family: Verdana, Geneva, sans-serif;">
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<span style="font-family: monospace , monospace;"><br /></span></div>
<div style="color: #222222;">
<div style="font-size: 12.8px;">
<span style="font-family: inherit;">The key points are that there are 2 pulses on the RST/TEST line, the first is 10mS longs and the second is 20mS long. The RESET line (DTR) rises whilst the 2nd RST pulse is still high, and approximately at half way through its duration.</span></div>
<div style="font-size: 12.8px;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-size: 12.8px;">
<span style="font-family: inherit;">This sequence has been chosen because it uses both edges and levels to encode the BSL envoke command, and the hardware that responds to this sequence is unlikely to be falsely triggered by any spurious noise or other accidental stimulii.</span></div>
<div style="font-size: 12.8px;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-size: 12.8px;">
<span style="font-family: inherit;">In theory, any bit of hardware that can generate this pattern can be used to invoke BSL mode, all it does is cause the mcu to jump into the bootloader code and the /RESET and TEST lines have no further function within the body of the programming process that follows immediately after this pulse sequence.</span></div>
<div style="font-size: 12.8px;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-size: 12.8px;">
<span style="font-family: inherit;">After the BSL start sequence has been sent, the Tx and Rx lines become active as data and acknowledgements are sent between the PC and the MSP430. This can be at 9600 baud, with even parity, but some faster BSL programs begin at 9600 baud and request a step up to a faster baudrate for the duration of the programming. </span></div>
<div style="font-size: 12.8px;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-size: 12.8px;">
<span style="font-family: inherit;">At the end of the programming sequence, the PC returns the TEST line high - as shown on the right of the sketch above.</span></div>
</div>
<div style="color: #222222;">
<span style="font-family: inherit;"><br /></span></div>
<div style="color: #222222;">
<span style="font-family: inherit;">Ideally the reset line should go low and then high to issue a rest pulse - but this is dependent on the PC application and is not always the case.</span></div>
<div style="color: #222222;">
<span style="font-family: inherit;"><br /></span></div>
<div style="color: #222222;">
<span style="font-family: inherit;">This may seem simple so far - but then there is the old saying "If it can go wrong, it will go wrong".</span></div>
<div style="color: #222222;">
<span style="font-family: inherit;"><br /></span></div>
<div>
<div style="color: #222222;">
<span style="font-family: inherit;">The problem arises in that over the 6 generations of MSP430 - there have been several different start sequences, for the families of 1xx, 2xx, 4xx 5xx, 6xx and FRxx devices.</span></div>
<div style="color: #222222;">
<span style="font-family: inherit;"><br /></span></div>
<div style="color: #222222;">
<span style="font-family: inherit;">As the hardwware to drive the bootloader evolved from a simple 9 pin RS232 Comm port - where some of the handshaking lines are inverted, the original specification was aimed at what was easiest to implement from a standard serial port.</span></div>
<div style="color: #222222;">
<span style="font-family: inherit;"><br /></span></div>
<div style="color: #222222;">
<span style="font-family: inherit;">In addition, some MSP430 devices share their /RESET and TEST pins with JTAG functions - so to differentiate between JTAG commands and BSL commands s<span style="font-size: 12.8px;">ometimes one or both of RST and DTR shown above are inverted.</span></span></div>
<div style="color: #222222;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: inherit; font-size: 12.8px;"><br /></span></span></div>
<div style="color: #222222;">
<span style="font-family: inherit; font-size: 12.8px;">Here are a few pointers to get you up and running quickly</span></div>
<div style="color: #222222;">
<span style="font-family: inherit; font-size: 12.8px;"><br /></span></div>
<div style="color: #222222;">
<span style="font-family: inherit; font-size: 12.8px;">1. Make sure that /RESET connects to DTR and TEST connects to RTS - easily mixed up.</span></div>
<div style="color: #222222;">
<span style="font-family: inherit; font-size: 12.8px;">2. As a temporary hack, be prepared to add a P-FET to invert DTR line so that /RESET is active low. See picture below</span></div>
<div style="color: #222222;">
<span style="font-family: inherit; font-size: 12.8px;">3. Some<a href="https://www.blogger.com/null"> PC applications</a> allow you to swap or individually invert the RTS and DTR lines - but only available for 1xx, 2xx, 4xx.</span><br />
<span style="font-family: inherit; font-size: 12.8px;"><br /></span>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="The Great MSP430 Bootloader Swindle - Part 2" border="0" height="160" indx="12702085" rank="170" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-R_lRlQhYZm2nxCcqbnV-_Vlm8b3ugDMpNEDsa81qKngFg0zOfkB3cNriNTrkF0yed3Eqm3Z6YHjjFfmOxFd-PFof5Ppbri1KS529KE3inrO8zYulI_-S5uVOiO9JNGwIkFnv/s400/extra_tranny.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption"><b>A P-FET and 10K resistor were added to invert the DTR signal for /RESET</b></td></tr>
</tbody></table>
<span style="font-family: inherit; font-size: 12.8px;"><br /></span><span style="font-family: inherit; font-size: 12.8px;"><br /></span><span style="font-family: inherit; font-size: 12.8px;"><br /></span><span style="font-family: inherit; font-size: 12.8px;"><br /></span></div>
<div style="color: #222222;">
<span style="font-family: inherit; font-size: 12.8px;"><br /></span></div>
<div style="color: #222222;">
<span style="font-family: inherit; font-size: 12.8px;"><b>PC Software </b></span></div>
<div style="color: #222222;">
<span style="font-family: inherit; font-size: 12.8px;"><br /></span></div>
<div style="color: #222222;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: inherit; font-size: 12.8px;">I have found at least 3 variations of PC BSL Scripting applications. Here are the links:</span></span></div>
<div style="color: #222222;">
<span style="font-family: inherit;"> </span><br />
<a href="https://www.blogger.com/null" style="font-family: inherit;">TI's main BSL page</a></div>
<div>
<span style="color: #222222; font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: inherit; font-size: 12.8px;"><br /></span></span></div>
<div>
<span style="color: #222222; font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: inherit; font-size: 12.8px;">Open Source from FlyingCamp Design</span></span></div>
<div>
<span style="color: #222222; font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: inherit; font-size: 12.8px;"><br /></span></span></div>
<div>
<span style="color: #222222; font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: inherit; font-size: 12.8px;">FlyingCamp BSL Library</span></span></div>
<div>
<span style="color: #222222; font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: inherit; font-size: 12.8px;"><br /></span></span></div>
<div>
<span style="color: #222222; font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: inherit; font-size: 12.8px;">FlyingCamp BSL - Utility (1xx, 2xx, 4xx only)</span></span></div>
<div style="color: #222222;">
<span style="font-family: inherit; font-size: 12.8px;"><br /></span></div>
<div>
<span style="font-family: inherit;"><span style="letter-spacing: -1px;"><a href="https://www.blogger.com/null">MSPFET - FREE MSP430 flash programming utility </a> </span></span></div>
<div>
<span style="font-family: inherit; letter-spacing: -1px;"><br /></span></div>
<div>
<span style="font-family: inherit; letter-spacing: -1px;"><br /></span></div>
<div>
<span style="font-family: inherit;"><span style="letter-spacing: -1px;">There may be more</span><span style="letter-spacing: -1px;"> available, but I struggled to find anything that gave me exactly what I needed.</span></span></div>
<div>
<span style="font-family: inherit; letter-spacing: -1px;"><br /></span></div>
<div style="color: #222222;">
<span style="font-family: inherit;">In the end, despite the msp430-bsl-utility being almost exactly what I needed with the means to swap and individually invert RTS and DTR. However this utility was not compatible with 5xx and 6xx Bootloaders.</span></div>
<div style="color: #222222;">
<span style="font-family: inherit;"><br /></span></div>
<div style="color: #222222;">
<span style="font-family: inherit;">To make the bootloader work, I had to use the 5XX mode and invert the DTR (RESET) signal using a P- FETtransistor - in order to match the signal diagram above.</span></div>
<div style="color: #222222;">
<span style="font-family: inherit;"><br /></span></div>
<div style="color: #222222;">
<span style="font-family: inherit;">Once you can generate the correct boot sequence - the rest is fairly easy.</span></div>
<div style="color: #222222;">
<span style="font-family: inherit;"><br /></span></div>
<div style="color: #222222;">
<span style="font-family: inherit;">The script for the BSL is very short - use a filename such as script1.txt</span></div>
<div style="color: #222222;">
<span style="font-family: inherit;"><br /></span></div>
</div>
<div style="color: #222222;">
<div>
<span style="font-family: inherit; font-size: xx-small;"><b>MODE 5xx COM9</b> // Set 5XX mode with USB VCP on COM9<br /><b>RX_PASSWORD </b> // Use Default Password (optional)<br /><b>MASS_ERASE </b> // Erase the device<br /><b>RX_DATA_BLOCK_FAST blink_2433.txt </b> // Send the TI TXT file blink_2433.txt<br /><b>SET_PC 0xC400 </b> // Set the Program Counter to 0XC400 - ready to run</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">The comments are for explanatory purposes only - although if you include them in the script, comments should be on separate lines to any script instruction</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">To use this, put the bsl_scripter.exe, the script1.txt and the blink_2433.txt file all in the same directory.</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">Run by typing </span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">bsl_scripter.exe script1.txt</span><br />
<span style="font-family: inherit;"><br /></span>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://www.blogger.com/null" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img atitle="The Great MSP430 Bootloader Swindle - Part 2" border="0" height="187" indx="12702085" rank="170" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcQRFesd-1NsGwl0kJrF4l7RPMyfJI_PX0LiU0u-0L3jZ0WuEs0tnUhI2LXxSCAtotHAjJGLoQxHwQFm2tBSblMPARAFFEy_c8PqdhVvlP55QTqvQNS6fUE8s4NN6Sg58aaZZh/s400/BSLScripter.jpg" style="max-height: 100%; max-width: 100%;" /></a></td></tr>
<tr><td class="tr-caption"><b>Typical output session from BSL_scripter</b></td></tr>
</tbody></table>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">If all goes well, this takes a couple of seconds to run - after DTR has been allowed to go high again at the end of the programming.</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">Further work required - should be possible to invert DTR in software - so that it doesn't need the hardware hack with the transistor. The BSL utility GUI is the way to go, if someone with Python skills would just hack it to handle 5xx bootloader format</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">The programmer should be modified so that it releases DTR at the end of the programming sequence - so that the code autoruns after loading.</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">A neat way of programming a MSP430 with very simple USB-serial converter - just need 10% more effort in the PC software to allow it to handle the newer parts - without having to resort to command line and P-FETS!</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
</div>
<div style="color: #222222; font-size: 12.8px;">
<span style="font-family: inherit;"><br /></span></div>
<div style="color: #222222; font-size: 12.8px;">
<span style="font-family: inherit;"><br /></span></div>
<div style="color: #222222; font-size: 12.8px;">
<span style="font-family: monospace , monospace;"><br /></span></div>
</div>
Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com1tag:blogger.com,1999:blog-16736699.post-30084260582114862172016-07-21T18:39:00.001+01:002016-07-21T18:58:32.342+01:00A Perfect Storm<br />
After 11 years of Blogger, I am increasingly frustrated with it's lack of sensible features - like the all important code window.<br />
<br />
As such I am looking for alternatives - but for the meantime some recent posts will now be available here:<br />
<br />
https://folknologylabs.wordpress.com/2016/07/21/a-perfect-storm/<br />
<br />
So long and thanks for all the fish.......Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com2tag:blogger.com,1999:blog-16736699.post-11529007018299857462016-03-15T00:14:00.002+00:002016-03-22T00:58:11.281+00:00The $5 FORTH ComputerThe MSP430 makes an excellent choice for a Forth Computer. It already has a 16 bit architecture, and the Von Neuman unified memory space makes dealing with data and instructions somewhat simpler. It's choice of low power, non volatile FRAM memory makes it virtually unique in the microcontroller market.<br />
<br />
FRAM has a fast write cycle - about 100 times the speed of Flash, and with a life of 10E +14 cycles - it will not wear out anytime soon. EEprom is made redundant with FRAM, and the boundary between FRAM and SRAM can be moved - so that FRAM is used as RAM - allowing up to 8MHz operation.<br />
<br />
The MSP430FR2433 is a new addition to the FRAM range of microcontrollers and at $1.50 it is very affordable. Add to this an external SRAM or FRAM memory and you have the makings of a powerful little machine. With volume production, it's possible to have a complete Forth system for around $5 - including the USB programming adaptor.<br />
<br />
Performance wise, it's not in the ARM class, not even close, but at 16MHz full speed, it will run about 4 times the throughput of the Arduino R3.<br />
<br />
One of it's strengths is that it has been blessed with 3 communications ports - allowing a rich mix of asynchronous UART and synchronous SPI hardware to be added.<br />
<br />
The MSP430 may be programmed with a variety of Forths, including Mecrisp, Amforth and 4E4th - the latter having a special port of Camel Forth available specifically for FRAM operation.<br />
<br />
Recently I came across <a href="https://gitlab.com/Jean-Michel/FastForthForMSP430fr5xxx" target="_blank">Fast Forth by Jean-Michel Thoorens</a> - this is Direct Threaded Code, and has support for SD card. Programming is done making use of TeraTerm for file sending - at a full 921600 Baud. It was designed specifically for MSP430 with FRAM - needing just 8K bytes of FRAM.<br />
<br />
Forth was designed as a complete, self contained tool-chain - including Editor, Compiler and Assembler - all the tools that you need to develop code, at your fingertips - present on the target chip. Now for the first time we can have all of this on a tiny, manageable 20 pin DIL module - complete with it's own USB programming interface.<br />
<br />
The communications interfaces include UART, SPI and I2C. There are up to 6 port pins available for use as GPIO, peripheral selects or ADC inputs.<br />
<br />
Need to add more I/O? No problem - can be done using simple shift registers clocked off one of the two available SPI ports.<br />
<br />
Want to build a WiFi or Bluetooth robot - again no problem. Just drive the stepper motors using a shift register or high power driver - such as the<a href="https://www.sparkfun.com/datasheets/IC/TPIC6B595.pdf" target="_blank"> TPIC6B595 </a><br />
<br />
The SPI port may be used to read a PS/2 keyboard, or I2C will interface nicely to a Wii Nunchuck controller.<br />
<br />
ChipStick will accept an external static RAM (23K256 or 23LC1024) up to 128Kx8, or a SPI FRAM of up to 256Kx8. In streaming mode the speed is about 3uS per byte (for long streams) allowing 32K to be transferred in 100mS.<br />
<br />
It should even be possible to experiment with monochrome video output by clocking data out of the SRAM using SPI.<br />
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-Rdnr9cydVPa8f0LEutBYFAjfkir99EdFSkw35_6M7EnowZpzkrh-QhNBRQh86sG3iHzElk9_2lUpWEvNT8Vn3pOIIHGAwuzx8yygfUG0tynUqmRqAlqJZdgUfvsDbJ3YJu8j/s1600/chipsticks.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-Rdnr9cydVPa8f0LEutBYFAjfkir99EdFSkw35_6M7EnowZpzkrh-QhNBRQh86sG3iHzElk9_2lUpWEvNT8Vn3pOIIHGAwuzx8yygfUG0tynUqmRqAlqJZdgUfvsDbJ3YJu8j/s1600/chipsticks.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>Erm - Wrong Chipsticks!</b></td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuZuTFJlPKyZC1-unAQdXqRrGwZ-xdX0hXxX1fH-TXXo4J25yOEnngfQz5CgMujGJzbMWg-ahSjQ5T-nknJt1NCS_Fga_4fbzzBdVy0RncSR-2SXdeVcP85Shpo3ZgOfs_CCo-/s1600/chopstick2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuZuTFJlPKyZC1-unAQdXqRrGwZ-xdX0hXxX1fH-TXXo4J25yOEnngfQz5CgMujGJzbMWg-ahSjQ5T-nknJt1NCS_Fga_4fbzzBdVy0RncSR-2SXdeVcP85Shpo3ZgOfs_CCo-/s400/chopstick2.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>ChipStick will be a fully functioning FRAM MSP430 Forth System!</b></td></tr>
</tbody></table>
<br />
It's nice to have a hobby in which something useful can be designed over a weekend. That's the case with ChipStick - conceived on Friday evening after work - and off to meet it's maker (my pcb board house) at the end of Sunday evening.<br />
<br />
ChipStick is the solution to the modern problem that not enough microcontrollers are breadboard friendly - so I just sat down and designed what I needed - a neat 20 pin DIL module - based on the MSP430FR2433.<br />
<br />
ChipStick is probably the smallest computer I have worked on, but despite it's small size I have managed to pack a lot in. The MSP430FR2433 has 15.5Kbytes of FRAM and 4Kbytes of SRAM. There are 3 communication ports UART & SPI, an external memory - either SRAM or FRAM and up to 4 x 10 bit ADC channels.<br />
<br />
The external memory is either a 23K256 SRAM - and there's facility for battery or super-cap backup, or a non-volatile FRAM device. Either way it extends the memory by a useful 32K to 256K bytes.<br />
<br />
ChipStick comes with a detachable programmer section - which consists of the USB- serial converter IC and the 3V3 regulator. Without the programmer section ChipStick is just 27 x 11mm - and that's small enough to fit inside a 2 x 4 LEGO block! <br />
<br />
The programmer section is however fairly unobtrusive and can be kept in place - even when the device is plugged into a Launch Pad pcb.<br />
<br />
<br />
<br />Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-72668062279911086772016-03-13T18:09:00.001+00:002016-04-03T18:18:19.456+01:00ChipStick - A Diminutive Dev Board<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyW-sUKV0WJ4pMXYEFtnlLBo0A7s6Z09QvhtxID9EWISrCByc-CccLgYAtUN0OO_RLuksDisfz2WMQln8s_71UCc8Hu3V1TgrVmpDRxSFF6OB-LHtwXOUoPqDEFZUQuz8Axl7-/s1600/chipstick2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="176" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyW-sUKV0WJ4pMXYEFtnlLBo0A7s6Z09QvhtxID9EWISrCByc-CccLgYAtUN0OO_RLuksDisfz2WMQln8s_71UCc8Hu3V1TgrVmpDRxSFF6OB-LHtwXOUoPqDEFZUQuz8Axl7-/s400/chipstick2.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>Chipstick - A complete "Retro" computer on a 40 x 11mm stick</b></td></tr>
</tbody></table>
<br />
I have recently been looking at the MSP430 as a contender for a general purpose development board. In the last 3 weeks I have looked at several of the extensive range of devices, both the low cost "value line" and other parts, including those with nonvolatile FRAM memory, 24 bit ADCs and LCD drivers. Having absorbed the data sheets of several devices I came to the following conclusions:<br />
<br />
1. There are hundreds of MSP variants across several families.<br />
2. Very few packages offer consistent pin-out - allowing one device to be swapped for an upgrade part.<br />
3. Register names and bit names often lack consistency across the various families making common code more difficult.<br />
4. You can never quite find the all peripherals you need in the package you want.<br />
<br />
After a bit of consideration, I decided to tackle points 2 and 4 above in one hit - I will design a common carrier board allowing a common footprint.<br />
<br />
As I like the small plug-in DIL packages, as they are breadboard and stripboard friendly. So it seemed a sensible idea to use the DIL 20 as a common footprint. I also found that some devices were available in a very compact 24pin QFN package - which is ideal for mounting at 45 degrees at the centre of a 20 pin DIL footprint.<br />
<br />
In my search for the ideal part, I came across the new MSP430FR2xxx series. These have 15.5K of FRAM and 4K of RAM. In addition they have 2 A type UCSI and 1 B type UCSI universal serial communications interfaces.<br />
<br />
So in a few hours, I had designed a tiny carrier board, to which I added a USB to serial converter IC plus some extra features.<br />
<b><br /></b>
<b>Hardware Details</b><br />
<b><br /></b>
The pcb is designed to take any of the 24pin MSP430FR2xxx range, but in particular the very low cost MSP430FR2433. The 20 pin DIL footprint breaks out the available pins into a form that can be plugged directly into a low cost Launchpad - in place of the MSP430G2553 device.<br />
<br />
This gives almost 16K of nonvolatile FRAM plus 4Kbytes of SRAM - which is eight times the RAM on the '2553.<br />
<br />
On the left hand end of the board is the CH340G USB to serial converter IC. This forms a complete communications and programmer interface - providing the RESET and TEST signals required for the serial bootstrap loader (BSL) programmer.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMyDArlhes03aS4tGjn-9aEBDGvMlGYu4BjeiKsCoNWU2eQDxMbPKEtTCVC-u8I0CX9dZnia9wHJbysgFq9J9KbK6_pB4lL_QW5MphQqckq5kI4GXrSPBsvAeIHFJSgDQGTqsv/s1600/chopstick2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="170" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMyDArlhes03aS4tGjn-9aEBDGvMlGYu4BjeiKsCoNWU2eQDxMbPKEtTCVC-u8I0CX9dZnia9wHJbysgFq9J9KbK6_pB4lL_QW5MphQqckq5kI4GXrSPBsvAeIHFJSgDQGTqsv/s320/chopstick2.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">"Chopstick" - with the Programmer section removed</td></tr>
</tbody></table>
<br />
<br />
It should be noted that this programmer section of the board is detachable, making the 20pin DIL carrier part not much bigger than a standard DIL socket. A 6 way 1.27mm (0.05") pitch connector allows the programming section to be connected to the target using a suitable cable.<br />
<br />
The MSP430FR2433 has 3 very useful communication ports. One of these is reserved for UART communications to a PC, whist the other two can be used for SPI, I2C or other GPIO purpose.<br />
<br />
The board also makes the following provisions:<br />
<br />
1. A reset switch<br />
2. A single LED<br />
3. A 32768Hz crystal may be fitted for more accurate timing.<br />
4. A lithium battery or super-capacitor may be plugged in to power the board<br />
5. On the underside of the board there is a footprint to allow an external SPI SRAM or FRAM IC to be fitted. SRAM available up to 1Mbit (128Kx8) or FRAM up to 256Kx8.<br />
<br />
<br />
In the next part, on receipt of the board back from the manufacturers, around March 23rd - I will discuss some applications for this diminutive dev-board.<br />
<br />
<b>Other recent Posts on ChipStick</b><br />
<b><br /></b>
<a href="http://sustburbia.blogspot.co.uk/2016/03/chipstick-diminutive-dev-board.html" target="_blank">ChipStick - A Diminutive Dev Board</a><br />
<br />
<a href="http://sustburbia.blogspot.co.uk/2016/03/the-5-forth-computer.html" target="_blank">The $5 Forth Computer</a><br />
<br />
<a href="http://sustburbia.blogspot.co.uk/2016/03/building-5-forth-computer-first-steps.html" target="_blank">First Steps to Building the $5 Computer</a><br />
<br />
<a href="http://sustburbia.blogspot.co.uk/2016/03/building-5-forth-computer-first-steps.html" target="_blank">Digital Dust</a><br />
<b><br /></b>
<a href="http://sustburbia.blogspot.co.uk/2016/03/building-chipstick-construction-guide.html" target="_blank">Constructional Guide</a><br />
<br />
<a href="http://sustburbia.blogspot.co.uk/2016/03/the-great-msp430-bootloader-swindle.html" target="_blank">Bootloader</a><br />
<br />
<a href="http://sustburbia.blogspot.co.uk/2016/04/thanks-for-memories.html" target="_blank">Interfacing Memory</a><br />
<br />
<a href="http://sustburbia.blogspot.co.uk/2016/04/chipstick-io-magic.html" target="_blank">I/O Expansion</a><br />
<br />
<a href="http://sustburbia.blogspot.co.uk/2016/04/graphical-distractions.html" target="_blank">Graphical User Interface</a><br />
<br />
<a href="http://sustburbia.blogspot.co.uk/2016/03/chipstick-applications.html" target="_blank">Applications</a><br />
<br />
<br />
<br />
<br />
<br />Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-83313235630388640672016-03-13T08:56:00.003+00:002016-03-13T08:56:34.791+00:00Diving Into ForthI have always had a soft-spot for the Forth Programming Language, since first hearing about it as a sixth-former in the very early 1980s when I was running the after-school computer club on Friday afternoons.<br />
<br />
At that time, I lived in the technological backwaters of the Isle of Man, gleaning all my information from electronics and home computing magazine articles and the occasional <a href="https://www.youtube.com/watch?v=HW5Fvk8FNOQ" target="_blank">worthwhile BBC "Horizon" programme.</a><br />
<br />
There was mention of Forth in the popular computing magazines - but it was probably the <a href="https://archive.org/details/byte-magazine-1980-08" target="_blank">August 1980 Byte </a>article - which originally galvanised widespread interest in using Forth.<br />
<br />
Towards the end of my school days, an innovative Z80A based home computer the <a href="http://www.jupiter-ace.co.uk/Forth_general_byte8008_100.html" target="_blank">"Jupiter Ace"</a> became available - but sadly it was a "day late and a dollar short" in those crazy, pioneering days of UK Home Computer industry - with new products announced nearly every week.<br />
<br />
Since that 1980 article, we now have the internet, Github, open source software and hardware, ubiquitous 32-bit and 16-bit microcontrollers, FRAM memory, FPGAs and dozens of other technical innovations which should all help encourage users to have a look at Forth for digital interaction.<br />
<br />
Getting started in Forth has never been simpler, in addition to<a href="http://mecrisp.sourceforge.net/" target="_blank"> Matthias Koch's Mecrisp</a> they are other downloadable packages, including<a href="http://www.4e4th-ide.org/" target="_blank"> 4E4th </a>(for MSP430) and <a href="http://www.mpeforth.com/xc7lite.htm" target="_blank">VFX/XC7 Lite (for MSP430 or ARM M4)</a> from MPEForth.<br />
<br />
I have focused on the above two architectures MSP430 and ARM, because a Forth implementation of the Forth 16-bit virtual machine is so much simpler - and sensible - on a 16-bit or 32-bit architecture, than on an 8-bit processor. <br />
<br />
4E4th runs on the low cost<a href="http://www.complang.tuwien.ac.at/anton/euroforth/ef12/papers/bruehl.pdf" target="_blank"> MSP430 Launchpad</a> - details of this implementation.<br />
<br />
There is also <a href="http://amforth.sourceforge.net/TG/MSP430.html" target="_blank">AmForth for MSP430</a> - based on Brad Rodriguez's camelForth.<br />
<br />
(Although Amforth and eForth implementations for Ardunio's 8 bit AVR are available).<br />
<br />
Looking at FPGA implementations, there is James Bowman's J1 Forth processor which runs on a Xilinx Spartan 6 device, or also on a Lattice iCE 40 series part - with the tool chain now entirely open source.<br />
<br />
I also recently came across the <a href="http://www.complang.tuwien.ac.at/anton/euroforth/ef12/papers/read.pdf" target="_blank">N.I.G.E Machine</a> - a 100MHz Forth Workstation, again based on low cost FPGA technology.<br />
<br />
If you want to build a workstation type product - suitable FPGA hardware with PS/2 Keyboard & Mouse and VGA/XGA video output is available from Saanlima Electronics in their Spartan 6 <a href="http://www.saanlima.com/pepino/index.php?title=Welcome_to_Pepino" target="_blank">Pepino board</a> and also from Gadget Factory in their <a href="http://papilio.cc/index.php?n=Papilio.PapilioDUOHardwareGuide" target="_blank">Papillio range of FPGA boards</a>. If you are looking at the Gadget Factory - take time to look at their new<a href="http://store.gadgetfactory.net/papilio-fpga-logic-analyzer-kit/" target="_blank"> Logic Analyser Kit</a><br />
<br />
Whilst there are various Forth Interest (FIG) Groups around the world, it is probably the German, <a href="http://www.forth-ev.de/" target="_blank">Forth-Gesellschaft e.V</a>. who are the most active, with regular news and updates on their website<br />
<br />
For anyone with an interest in Forth, why not spend a quiet Sunday morning browsing on what is available?<br />
<br />
You might also wish to look at <a href="http://jeelabs.org/intro/" target="_blank">Jean Claude Wippler's JeeLabs Blog </a>- with his <a href="http://jeelabs.org/2016/02/dive-into-forth/" target="_blank">recent forays into Forth</a>, which inspired me to write this blog post round-up.<br />
<br />
<br />
<br />Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-34901080743724457572016-03-09T17:36:00.001+00:002016-03-20T18:16:13.949+00:00Porting SIMPL to the MSP430FR4133 Launchpad.For the last few days I have been using the entry level, MSP430G2553 Launchpad for my code development.<br />
<br />
This was fine to begin with for basic experimentation with functions, but ultimately I knew that my proposed application would probably use on of the larger FRAM based parts, with built-in segment LCD controller.<br />
<br />
The MSP430FR4133 Launchpad is excellent value at about $16 and it comes with a 6-digit multi-segment display, similar break-out headers to the entry level Launchpad and the means to monitor the mcu power consumption - using Energy Trace Technology.<br />
<br />
My final application is a hand-held, battery powered instrument with LCD - so the MSP430FR4133 target is a good hardware match to the final device.<br />
<br />
The MSP430FR4133 has 15360 bytes of FRAM memory for program storage, plus an additional 512 bytes for Information (calibration data, Identity etc). There is also 2Kbytes of RAM.<br />
<br />
The extra RAM means that SIMPL can be run easily in the RAMspace without having to use the external RAM - most of the time. This makes the user interaction with SIMPL a lot easier, and also allows more functionality to be included.<br />
<br />
<br />
<b>Porting SIMPL to MSP430FR4133</b><br />
<b><br /></b>
The following steps had to be performed to get SIMPL to run on the '4133 Launchpad.<br />
<br />
1. Increase the RAM allocation to make ful use of the 2Kbytes of RAM<br />
2. Convert the uart routines to work with USCA0<br />
3. Convert the spi routines to work with USCB0<br />
4. Modify the ADC initialisation code to work with the onchip ADC_10<br />
5. Correct the interrupt timer routines so that millis() and micros() work correctly<br />
6. Make use of the LCD by diverting some printout to it<br />
<br />
<br />
The code is still a work in progress, with 1, 2 & 3 above, working, and a little progress on 6 - but I have posted the latest code here on this <a href="https://gist.github.com/anonymous/c311dc12afd047ac29f6" target="_blank">Github Gist.</a>Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-10256336271922702892016-03-07T00:02:00.001+00:002016-03-20T18:16:13.928+00:00SIMPLEX - Part 2 - Running SIMPL Code out of External RAM<b>Running SIMPL Code out of External RAM</b><br />
<br />
In part 1 I looked at the bulk access to the RAM chip using streaming mode - which takes about 3uS to access a byte. With single byte access, there is the significant overhead of setting up the read instruction and the 24 bit address - making an access about 100uS.<br />
<br />
For this reason, I propose a block access mode which loads in a block of 32 bytes into the SIMPL input buffer and executes the code at full speed from there.<br />
<br />
Reading in 32 bytes in streaming mode will take around 100uS and then the code will execute at full speed out of internal RAM.<br />
<br />
<b>Writing some Commands</b><br />
<b><br /></b>
A Assemble<br />
B Block Read<br />
C Compile<br />
D Decimal Dump<br />
E Execute (Read and Go combined)<br />
F File<br />
G Go<br />
H Hex Dump<br />
<br />
We need a simple routine to load a block from RAM - based on the existing bulk read.<br />
<br />
I use the B command to signify a Block Read - and it takes a integer block number and loads the block into a temporary internal RAM buffer called block_array[]<br />
<br />
Once the data is in the block_array buffer, it's a simple case of pointing the interpreter at the start of that buffer and letting it execute the code.<br />
<br />
To initiate this process, I use the G (Go) command.<br />
<br />
The great thing about SIMPL is that the commands can be concatenated along a line so to load and run Block 0 you just need to type 0BG. You can then string these together so that multiple blocks are executed one after another 0BG1BG3BG2G etc <br />
<br />
We could now dispense with the BG construct, and just call it E for Execute.<br />
<br />
SIMPL has grown a lot today - and even as I author it, there's a lot of new information and excitement to take in. It's been a long but rewarding day getting the external RAM to work with SIMPL. <br />
<br />
The latest code - with the ability to run code out of SRAM is on this <a href="https://gist.github.com/anonymous/9d77120dc14e6978b917" target="_blank">github gist</a><br />
<br />
In the next part, I look at data entry into the RAM and making a simple line editor.<br />
<br />
<br />
<br />
<br />Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-75466223035437903652016-03-06T19:19:00.001+00:002016-03-20T18:16:13.975+00:00SIMPL meet SIMPLEX - Part 1 - Putting it Together<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwGixpv8uXDlyEy_Q_BNtbpkwWNzOrLHjUXxXjs91qV35w3c_9hv3rFgP-uNjKIgD4x6PG413mHF5VHmWNB06nTEApj3D797P7WGnJPWUq3f5CSkTtGXbr_KN0cJwLOu9ned-3/s1600/Launchpad_G2XX.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwGixpv8uXDlyEy_Q_BNtbpkwWNzOrLHjUXxXjs91qV35w3c_9hv3rFgP-uNjKIgD4x6PG413mHF5VHmWNB06nTEApj3D797P7WGnJPWUq3f5CSkTtGXbr_KN0cJwLOu9ned-3/s320/Launchpad_G2XX.jpg" width="312" /></a></div>
<span style="font-family: "trebuchet ms" , sans-serif;"><b><br /></b></span>
<span style="font-family: "trebuchet ms" , sans-serif;"><b><br /></b></span>
<span style="font-family: "trebuchet ms" , sans-serif;"><b>SIMPLEX - the EXtended Version Of SIMPL</b></span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><b><br /></b></span>
<span style="font-family: "trebuchet ms" , sans-serif;">So I took SIMPL running on a LaunchPad, and added a 23K256 RAM chip with 6 jumper wires and a 10K resistor:</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv2n33Uf9lku6xRtl7CrT0Fyv6jywXwmQarxZ7csqmQWKcOa6MMIkPf0CEv1KTWWCCTV6usFWDZmQckM1T0C2-boS_Mk7U1T95E3aT-ZW2FJBVY3XzRT6NUNP2OpAI2nd3y45k/s1600/ram_detail.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv2n33Uf9lku6xRtl7CrT0Fyv6jywXwmQarxZ7csqmQWKcOa6MMIkPf0CEv1KTWWCCTV6usFWDZmQckM1T0C2-boS_Mk7U1T95E3aT-ZW2FJBVY3XzRT6NUNP2OpAI2nd3y45k/s640/ram_detail.jpg" width="640" /></a></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvyrc_Ex7tBrCPyuFneYFJoD265__myWyO0tkAd7jcsN4zlb8Mj7Ml4iAgD4qMyT1LrfFA3QKscpS08Do-IfvCZ7pCwXIB4y3k6pu5tD54txONL2eZQ528Kurbo-m6qjzsV-59/s1600/simplex_1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="288" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvyrc_Ex7tBrCPyuFneYFJoD265__myWyO0tkAd7jcsN4zlb8Mj7Ml4iAgD4qMyT1LrfFA3QKscpS08Do-IfvCZ7pCwXIB4y3k6pu5tD54txONL2eZQ528Kurbo-m6qjzsV-59/s640/simplex_1.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>Overall View</b></td></tr>
</tbody></table>
<br />
<span style="font-family: "trebuchet ms" , sans-serif;">I'm probably infringing a whole bunch of trademarks but the EXtended version of SIMPL which uses the EXternal SPI RAM will be called SIMPLEX. </span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">Now that's what I call subtle! With a touch of irony.</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">With the RAM expansion comes the need to examine and modify its contents, and so I have written a bit of code to allow the contends of the RAM to be dumped to the screen in both decimal and hexadecimal formats, with ASCII equivalent in a separate column.</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">Whilst the SIMPL kernel code fits into 2Kbytes - and as such may be considered as a smart interactive bootloader, the high level routines to manipulate the RAM extend this limit quite considerably.</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">The code I have produced is "quick and dirty" C, and I am sure it could be written more succinctly at a later date.</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">The decimal-dump D and hex-dump H commands are the start of a new group of high level commands to handle external memory, editing etc.</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">30 or so years ago, "monitor" programs were common place on the early 8-bit micros. They allowed for the direct editing of data within the RAM space of the memory map - and were a means of entering programs - one hex byte at a time. It was a welcome step up from toggle switches!</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">The "Editor" will use the first 8 commands of the User Words, signified by letters A through to H, each representing a high level operation. One allocation of these is as follows:</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">A Assemble</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;">B Block</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;">C Compile</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;">D Decimal Dump</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;">E Edit</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;">F File</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;">G Go (execute from RAM)</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;">H Hex Dump</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">Several of these are really just place-holders for yet to be written command functionality.</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">The first task of being able to examine the RAM contents has been undertaken, now its time to start looking at the process of getting code into the RAM area and then executing it from RAM.</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">The 23K256 has a page size of 32 bytes, which is a useful size for a phrase of SIMPL code.</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">Looking at the Block B and File F commands above, the block command can be used to manipulate the memory 32 bytes at a time - effectively a line of SIMPL code, whilst the File command can be used for handling multiple blocks. </span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">The hexadecimal conversion is used both for 2 digit (<= 255) and 4-digit (256 <= x <= 65535) conversions.</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">I have includes a SIMPL primitive $ which takes an integer x and converts it to either 2 digit or 4 digit hex.</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">The dump formats make use of the modern wider terminal screen. 1K of RAM can be dumped to a single screen - of 32 lines of 32 hex bytes.</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRxqhe8HP4iEdjSy10fiQJRepydlU97FSOzbGvlRry6PXIDr43GhHnpXxgvZTuZLMhZmhAWDlWFt_9RB-lyjbR7SIWSPe0xNRmL_voSusc1jxyCbc57v6FiO4ZlegtNUKPPNoa/s1600/termite_1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRxqhe8HP4iEdjSy10fiQJRepydlU97FSOzbGvlRry6PXIDr43GhHnpXxgvZTuZLMhZmhAWDlWFt_9RB-lyjbR7SIWSPe0xNRmL_voSusc1jxyCbc57v6FiO4ZlegtNUKPPNoa/s640/termite_1.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>The Hex -Dump as it appears on Termite Screen. 1K bytes of RAM data shown per screen</b><br />
<b><br /></b>
<b><br /></b>
<b><br /></b></td></tr>
</tbody></table>
<span style="font-family: "trebuchet ms" , sans-serif;">I have put the code for SIMPLEX_1 on this<a href="https://gist.github.com/anonymous/a2c5381c466760008a65" target="_blank"> Github Gist</a> Please note that the UART is running at a non-standard 100Kbaud instead of 115200. This is to be investigated later. </span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;">In the next post, I'll look at more RAM operations plus actually running SIMPL code out of the external SPI RAM.</span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span><br />
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span>
Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-67185023644392941442016-03-06T11:56:00.002+00:002016-03-20T18:16:13.966+00:00SIMPL for Beginners - Part 1It's almost 3 years since I started on the SIMPL project, it has come a long way since it's early beginnings.<br />
<br />
This first post, in a series, is a "catch-up" for those that have come late to the party.<br />
<br />
<b>Introduction to SIMPL</b><br />
<b><br /></b>
0. <b>SIMPL</b> stands for <b>Serial Interpreted Minimal Programming Language. </b>It is intended as a common, interactive hardware exercising language that will run on almost any low-end, resource limited, microcontroller.<br />
<br />
So far it has been implemented on the following microcontroller platforms<br />
<br />
Arduino<br />
ATmega328<br />
ATmega1284P<br />
<br />
Nucleo<br />
RFDuino nRF51822 Cortex M0 <br />
STM32F103 Cortex M3<br />
STM32F373 Cortex M4F<br />
STM32F407 Cortex M4F<br />
STM32F746 CCortex M7<br />
<br />
LaunchPad<br />
MSP430G2553<br />
MSP430FR5969<br />
MSP430FR5739<br />
<br />
<div>
Teensy 3.0, 3.1, 3.2</div>
<div>
MK20DX256</div>
<div>
<br /></div>
<div>
Future development will include PIC16Fxxxx and PIC32MX devices too - made accessible using <a href="http://www.pinguino.cc/" target="_blank">Pinguino</a> - an Arduino-like IDE for PICs.</div>
<div>
<br /></div>
1. SIMPL is based, unashamedly on Ward Cunningham's excellent Txtzyme "Nano-Interpreter". You can find his work on his<a href="https://github.com/WardCunningham/Txtzyme" target="_blank"> Txtzyme Github </a> This should be the starting point of any SIMPL development. First you port the C code of Txtzyme across to whatever microcontroller you wish to use. Once you have Txtzyme working on your mcu, you can then start to extend it's functionality to include the whole SIMPL featureset.<br />
<br />
2. SIMPL is a text-based interpretive tiny language, which interacts with the onchip hardware allowing simple applications to be developed for a variety of very low cost microcontrollers. It fits into about 2Kbytes of Flash and requires a minimum of 512bytes of RAM - so it will work on the smallest of RAM limited microcontrollers. It needs a uart connection to a PC terminal program - for text input and output. It is primarily aimed at 14 -28 pin low end microcontrollers - but of course, will run on larger parts.<br />
<br />
3. SIMPL originally ran on Arduino. It makes use of the Arduino "Wiring" functions - such as digitalRead, digitalWrite, analogRead, analogWrite, millis, micros, delay, delayMicroseconds and Serial. Provided that your microcontroller can offer similar functions to these, SIMPL will work. SIMPL also runs on the Teensy series of mcu boards.<br />
<br />
4. SIMPL can be developed for other microcontrollers - including ARM, MSP430, RFDuino, ESP8266 etc using the "Arduino-like" IDEs such as <a href="http://www.stm32duino.com/" target="_blank">STM32Duino</a> or <a href="http://energia.nu/" target="_blank">Energia</a> for MSP430 and <a href="http://www.pinguino.cc/" target="_blank">Pinguino</a> for PIC devices. These alternative IDEs will help you with the various "Wiring" functions.<br />
<br />
5. SIMPL has been written in C, to make it portable between various microcontrollers. It uses standard Arduino functions to interact with the hardware - which are perhaps not always the smallest or fastest. These functions can be rewritten for a particular microcontroller to make them both smaler in codesize, more efficient and faster.<br />
<br />
6. SIMPL is not a polished final product, but it offers a framework for experimentation and education. As new hardware or ideas come along, SIMPL can be extended to incorporate them. The core ideas of SIMPL are easy to understand, and it gives a good insight into how computer languages are written to interact with the hardware.<br />
<br />
7. SIMPL has been developed with the same methodology as some of the tiny languages from the mid-1970s - when computing resources were very limited. Tiny BASIC, and FORTH grew out of this period.<br />
<br />
8. SIMPL can be easily extended to allow for external SPI or I2C peripherals - such as SRAM, sensors.<br />
<br />
9. SIMPL needs almost no tools to develop code. Just IDE with serial terminal.<br />
<br />
10. Enjoy SIMPL, extend and modify it if you wish - most of all, have fun!<br />
<br />
<br />
<b>The Command Set</b><br />
<b><br /></b>
SIMPL uses single ASCII characters for its commands and integer numbers for arithmetic - this makes the command interpreter a lot easier to write.<br />
<br />
Lower Case characters are used for the core primitive functions which are generally built into Flash, and should be present for every implementation of SIMPL.<br />
<br />
Punctuation characters and arithmetical symbols are also used as part of the kernel of primitives.<br />
<br />
The choice of primitives was made to make the language memorable and more human readable.<br />
<br />
Upper Case characters are "User Words" - these you can write yourself, test interactively, modify and store in RAM. On some microcontrollers - they may be stored in non-volatile ferro-electric memory FRAM (MSP430FR series) or in non-volatile EEprom.<br />
<br />
Originally Txtzyme offered just these commands - see <a href="https://github.com/WardCunningham/Txtzyme" target="_blank">Ward Cunningham's Read Me</a>:<br />
<br />
a-f Select an I/O port<br />
h help - a summary of commands<br />
i input<br />
k a loop counter - which decrements each time around the loop see {}<br />
m millisecond delay<br />
o output<br />
p print the value of variable x followed by carriage return/line feed<br />
s sample an ADC channel<br />
u microsecond delay<br />
x a 16 bit integer variable<br />
{} code between these braces is repeated as a loop<br />
_ _ characters between the underscores are printed to the terminal<br />
<br />
Once you have got Txtzyme ported across to your microcontroller, and have experimented with it, you are well on your way to working with SIMPL.<br />
<br />
In the next part I look at how Txtzyme is extended to include the SIMPL framework.<br />
<br />
It is likely that this series will be included on a SIMPL wiki - so that all the information is accessible in one place.<br />
<br />Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-86643521504394701122016-03-05T23:43:00.001+00:002016-03-20T18:12:00.166+00:00Interfacing SPI SRAM & FRAM to the MSP430This week I have mostly been experimenting with the low end MSP430 series of microcontrollers using the standard entry level LaunchPad.<br />
<br />
So far, I have looked at serial communications, ADC interfacing and running small applications, written either on Code Composer Studio or using the Energia IDE.<br />
<br />
In this post I look at the SPI interface with a view to accessing SPI memory - including SRAM and non-volatile ferroelectric RAM (FRAM).<br />
<br />
The low cost MSP430 parts are often very limited in their RAM capacity. For most of this week I have been experimenting with the 2553 and 2013 parts which have 512 and 128 bytes respectively. Whilst this has been for sufficient for the smallest of applications to test the various on-chip peripherals, it's not enough for serious tasks.<br />
<br />
I've used serial SRAM in the past, so decided that it would be a good exercise to interface it to the MSP430. I came across Rick Kimball's github gist a couple of days ago - where he had successfully interfaced a 32Kx8 23K256 device to the MSP430F2013 - using it's universal serial interface USI peripheral. <br />
<br />
With this proven and working correctly on a breadboard, I chose to use Rick's code as a guide and make the necessary modifications so that the USCI on the MSP430G2553 could be used too. The '2553 part has two USCIs - one I am already using as a uart for PC communications, leaving USCIB free to work in SPI mode to talk to the SRAM and other devices.<br />
<br />
Whilst I had good success with the '2013 part in my loadcell application, the lack of a proper uart peripheral made it too restrictive for any serious application that needs bi-directional serial communications with the PC, so I have parked '2013 developments for the moment, until I have time to look into implementing some form of software uart or some advanced trickery with the USI.<br />
<br />
Here's the pinout of the MSP430G2553 - this is the most common part used in the entry level Launch Pad<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"> +------U------+</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> 3V3 </span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: Courier New, Courier, monospace;">|VCC GND | OV</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> LED </span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;">|P1.0 XIN | 32768Hz</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> RXD </span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;">|P1.1 XOUT| 32768Hz</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> TXD </span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;">|P1.2 TEST| </span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> ADC </span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;">|P1.3 /RST| </span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> /CE </span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;">|P1.4 P1.7| MOSI</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> SCK </span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;">|P1.5 P1.6| MISO (LED)</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> D0 </span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;">|P2.0 P2.5| D5 </span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> D1 </span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;">|P2.1 P2.4| D4</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> D2 </span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;">|P2.2 P2.3| D3</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;">+-------------+ </span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;"> +------U------+</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">/CE | 23K256 | 3V3</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> MISO | | HOLD </span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> NC | | SCK</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> 0V | | MOSI</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> +-------------+</span><br />
<br />
<span style="font-family: inherit;">The 23K256 is very simple to interface - requiring just 4 wires to the SPI port. The Hold pin shoould be tied to 3V3 as it is not being used in this application.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">The MSP430G2553 benefits from the 20 pin DIL package providing 6 additional port lines from Port 2. I have labelled these D0 - D5 - purely for familiarity with the Arduino way of naming pins, but they may also be used as additional inputs to the 10 bit ADC.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">The firmware to exercise the SPI bus and access the SRAM has been based on Rick Kimballs code - but with changes made so that the USCI can be used. The code was written within Energia - but can easily be adapted for CCS or IAR Kickstart etc.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">I have included the memory test sketch on this<a href="https://gist.github.com/anonymous/cdf7df4d4f457a1703dd" target="_blank"> Github Gist.</a></span><br />
<br />
In the next part of this MSP430 series I will attempt to make use of the SRAM within SIMPL, and make further use of the SPI bus for driving other hardware.<br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><br /></span>
<br />
<span style="font-family: inherit;"><br /></span>Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-5660198741840262142016-03-05T12:47:00.000+00:002016-03-20T18:10:55.895+00:00More Nano Computing - The "Universal Microcontroller"In this post I discuss the idea of a "Universal Microcontroller" - a 40 pin plug in module that can host mcus from a variety of different manufacturers and families. It is based around a standard 40 pin 0.6" wide DIL footprint for convenience and low cost.<br />
<br />
The impetus behind this concept is caused by the fact that there are dozens of new microcontrollers appearing on the market every year and by having a common, low cost easy to use module would be a good way to evaluate some of the various product offerings in a breadboard friendly format.<br />
<br />
<b>Selecting a Small Microcontroller</b><br />
<br />
There are so many selection criteria - so I will try to target a few of the more important ones<br />
<br />
RAM<br />
ROM<br />
<br />
POWER<br />
PERIPHERALS<br />
<br />
SPEED<br />
SIZE<br />
<br />
COST<br />
COMPILER<br />
COMMUNITY<br />
<br />
RAM/ROM - these relate to the size of the on chip memory allocations. Most microcontrollers these days tend to have a lot of flash ROM and a lesser amount of RAM. <br />
<br />
If you are handling arrays and buffers, then RAM is important - and it is very easy to run short if your device has 2K or less. (Notably Arduino ATmega328).<br />
<br />
There are a whole class of tiny microcontrollers, which have less than 1K bytes of RAM. It is more difficult to use these for general purpose applications - and they tend to be used for deeply embedded low end consumer goods, sensors etc.<br />
<br />
POWER<br />
<br />
A lot of applications for microcontrollers have to be battery powered - so there is a large emphasis on tailoring the application in such a way that battery life is maximised - particularly if you are operating from a coin cell or similar. Some microcontrollers are very power efficient, and have multiple low power modes including low voltage operation.<br />
<br />
PERIPHERALS<br />
<br />
The microcontroller manufacturer chooses to fit-out a particular cpu core with a certain set of peripherals and it is these which give the microcontroller it's flexibility and capability in handling various applications. An mcu which is lacking a particular peripheral can be very difficult or impossible to match well to a particular application. A rich peripheral set often minimises the amount of glue-circuitry needed to interface to common external devices.<br />
<br />
Peripherals may be grouped as follows:<br />
<br />
Communications UART SPI I2C USB etc<br />
Timing TIM<br />
Driving PWM <br />
Sensing ADC DAC Comparator<br />
Misc GPIO<br />
<br />
These are the basic building blocks - the larger mcus may have sophisticated peripherals for audio, LCD video and external memory interfaces.<br />
<br />
SPEED<br />
<br />
The clock frequency of microcontrollers has increased steadily over recent years - and many have sophisticated clock control options to allow variable frequency clocking schemes especially for low power operation at much reduced frequency.<br />
<br />
Most modern, general purpose microcontrollers will run at up to 20MHz or so. From then on upwards it could be best described as following a 1,2,5 progression:<br />
<br />
20MHz AVR MSP430 ARM M0<br />
50MHz ARM Cortex M0+<br />
100MHz ARM Cortex M3/M4<br />
200MHz ARM Cortex M4/M7<br />
500MHz ARM<br />
<br />
<br />
SIZE<br />
<br />
This refers to the word size used by the mcu. Originally dominated by the 8-bit families (PIC, AVR, 8051 etc) these low end microcontrollers are being replaced by much more capable and cost-effective 32 bit parts, generally based on the ARM architecture. The 16bit MSP430 is an interesting exception -and will be interesting to see how this family product line fares in the face of competition from ARM. TI have already brought out their own MSP432 range based on 32bit ARM Cortex M4F cores.<br />
<br />
COST<br />
<br />
Microcontrollers range in cost from about 35 cents to about $12. These will have flash memory sizes from 512bytes to 2Mbytes and clock speeds that range from 20MHz to over 200MHz. Package sizes from just 6 pins to over 200 pins. Again it might be worth imposing a 1,2,5 scale on your budget - and see just what parts match your requirements.<br />
<br />
COMPILER<br />
<br />
This is a big factor in choosing a microcontroller. Can I program it easily, and how much does the tool chain cost? Fortunately there are free tools available - including code-size limited or time limited evaluation versions of some of the professional tools. The open source community has done a lot to make microcontrollers more accessible.<br />
<br />
COMMUNITY<br />
<br />
This has become increasingly important. Is there a good online help forum where beginners can get advice. Is the chosen device well supported by a community?<br />
<br />
<br />
<b>The Universal Microcontroller</b><br />
<br />
Having selected our microcontroller how do we achieve universality?<br />
<br />
About a month ago I reviewed a low cost version of the "Arduino" Nano - made in China using the CH340G USB to serial converter IC. The Nano has a lot going for it - in terms of low cost and compact size. The DIL format makes it easy to use. However it's 8 bit mcu is now showing it's age - especially when there are cheaper, faster and more feature rich 16bit and 32bit mcus available.<br />
<br />
Other processors also use this DIL format - such as the "Maple Mini" based on the STM32F103, and my own "ARMiGo" based on the STM32F373 (with 3 x 16 bit differential input ADCS).<br />
<br />
Looking further afield there are the Teensy series of boards based on the Freescale (now NXP) MK20DX series of ARM Cortex M4 mcus, and McHCK! also based on the MK20DX series.<br />
<br />
I am also more interested in the MSP430 reange of 16 bit microcontrolers - now that they have FRAM memory - and are fully supported by Energia - an Arduino IDE "workalike" for the MSP430 and other TI processors.<br />
<br />
Is there a Universal module format that can accept all these different devices? My mission now is to try to develop one<br />
<br />
<b>Progress So Far</b><br />
<br />
In the intervening month, I have had prototype boards back, for a small computing platform, WiNode 5, based on my 50x50mm board format, which uses the CH340G. I can report that the board works perfectly.<br />
<br />
At the centre of the 50x50 pcb is a footprint to accept a 40 pin DIL socketed device, and this was placed with the intention of allowing several microcontroller variants to be used with the WiNode 5 pcb. <br />
<br />
At the moment, the following processor family options are under consideration:<br />
<ol>
<li>ATmega1284 - native on board either as a SMT or as a plug-in DIL 40 packaged part</li>
<li>STM32Fxxx - added in the form of a 40 pin DIL module</li>
<li>MSP430FRxxx - added in the form of a 40 pin DIL module</li>
<li>MK20DXxxx - added in the form of a 40 pin DIL module</li>
</ol>
<div>
Other devices that may be considered in the future include:</div>
<div>
<br /></div>
<div>
nRF51822 Bluetooth Low Energy microcontroller</div>
<div>
ESP8266 WiFi module</div>
<div>
<br /></div>
<div>
Of these options, 1 has been prototyped, 2 is currently in CAD, 3 is at concept stage (pre-CAD) and 4 is a latecomer - prompted by the popularity of the Teensy series of microcontrollers, and a very neat similar product McHCK! that I came across this week.</div>
<div>
<br /></div>
<div>
These options represent 4 of the most common processor families, and by creating a generic 40 pin plug in module should allow easy access to the various devices. </div>
<div>
<br /></div>
<div>
For the newer devices, (STM32Fxxx, MSP430FRxxx and MK20DXxxx) the module will support a 5 pin "programming" header placed at one end of the module. This will allow access to the 2 wire ST-link/SPW/SWD Serial Wire Debug pins - for programming and debug.</div>
<div>
<br /></div>
<div>
The ATmega1284 option was chosen so as to offer full Arduino compatibility - but with extra flash and RAM capacity.</div>
<div>
<br /></div>
<div>
The STM32Fxxx module was designed to accept several members of the STM32F Cortex M3/M4 range (in 48 pin LQFP or QFN packages) to exploit the 32bit architecture, clock frequencies up to 120MHz and 16 bit ADCs - on some devices.</div>
<div>
<br /></div>
<div>
The MSP430FRxxx module allows the use of very low power FRAM based 16bit processors, TI Launchpad compatibility.<br />
<br />
The MK20DXxxx module allows compatibility with the Teensy and McHCK ecosystems. It is essentially a MCHCK device respun into the standard 40 pin footprint.<br />
<br />
<b>Common Hardware</b></div>
<div>
<br /></div>
Each module consists of microcontroller with most GPIO pins broken out to 0.1" headers, and a support system composed of reset circuit, crystal oscillator(s) (HF and 32768Hz if available) and debug/bootloader interface.<br />
<br />
In addition to the above there will be a footprint for a SPI memory device - either FRAM, SRAM or Flash - which may be programmed or accessed from the standard pins. FRAM devices of up to 256Kbytes is the preferred option.<br />
<br />
These modules will have a versatile power supply circuit - allowing options for single cell (eg alkaline AAA or coin cell) and LiPo operation. A high efficiency boost regulator and LiPo charger circuit are included. <br />
<br />
<b>The MSP430 Module</b><br />
<br />
This was perhaps one of the easier to lay out. The 38 pin TSSOP package has a fairly good mapping to the 40 pin DIL. The mcu pinouts are as follows:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">//</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// </span><span style="font-family: "courier new" , "courier" , monospace;"> +---\/---+</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// (P1.4) PB0 1 | | 40 PA0 (P1.3) AI 0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// (P1.5) PB1 2 | | 39 PA1 (P3.3) AI 1</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// [ ] PB2 3 | | 38 PA2 (P3.2) AI 2</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// [ ] PB3 4 | | 37 PA3 (P3.1) AI 3</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// NSS (P2.3) PB4 5 | | 36 PA4 (P3.0) AI 4</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// MOSI (P2.5) PB5 6 | | 35 PA5 (P1.2</span><span style="font-family: "courier new" , "courier" , monospace;">) AI 5</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// MISO (P2.6) PB6 7 | | 34 PA6 (P1.1) AI 6</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// SCK (P2.4) PB7 8 | | 33 PA7 (P1.0) AI 7</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// NRST 9 | | 32 AREF</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// VCC 10 | | 31 GND </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// GND 11 | | 30 AVCC</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// [PJ.7] XTAL2 12 | | 29 PC7 (PJ.5)( Xout) </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// [PJ.6] XTAL1 13 | | 28 PC6 (PJ.4)(Xin) </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// RX0 (P2.0) PD0 14 | | 27 PC5 (PJ.1) TDI</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// TX0 (P2.1) PD1 15 | | 26 PC4 (PJ.0) TDO</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// INT0 (P2.2) PD2 16 | | 25 PC3 (PJ.2) TMS</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// INT1 (P2.7) PD3 17 | | 24 PC2 (PJ.3</span><span style="font-family: "courier new" , "courier" , monospace;">) TCK</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM1B (P3.4) PD4 18 | | 23 PC1 (P1.6) SDA</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM1A (P3.5) PD5 19 | | 22 PC0 (P1.7) SCL</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM2B (P3.6) PD6 20 | | 21 PD7 (P3.7) PWM2A</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// +--------+</span><span style="font-family: "courier new" , "courier" , monospace;"> </span><br />
<br />
<br />
Pins 2, 3 and 12, 13 in square brackets are only used with the larger VQFN 48 package MSP430FR5969. <br />
<br />
<br />
<br />Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-84553075204178912772016-03-04T19:04:00.003+00:002016-03-20T18:10:55.917+00:00MSP430 Serial Communications<b>Fun with the MSP430F2013.</b><br />
<br />
I have been playing about with the MSP430F2013 for a couple of days now - and finding out what a wonderful little microcontroller it can be.<br />
<br />
It really is short of both flash memory and RAM (2K and 128 bytes respectively) - so applications have to be very compact. However it makes up for these shortcomings with some very useful and flexible hardware.<br />
<br />
My first application is to use it as a lower cost alternative to an AD7767 ADC which I currently use in a loadcell interface. <br />
<br />
Although it does not have an on-chip 24 bit ADC, the output resolution of the SD_16 ADC should be sufficient for my immediate needs. This little $1.50 mcu already saves me $10 on not having to buy an AD7767 then service it with another mcu.<br />
<br />
The second useful peripheral is the Universal Serial Interface (USI) - this is a flexible device used for both I2C and SPI communications, and as will be seen below later can also be used for high speed asynchronous uart communications too.<br />
<b><br /></b>
<b>Using the USI</b><br />
<b><br /></b>The universal serial interface is a flexible peripheral that is primarily intended to automate the processing of SPI and I2C communications. With a bit of bit-banging trickery - to add start and stop bits, it can also be used as a Transmit UART. Rick Kimball has also experimented with<a href="https://gist.github.com/RickKimball/1254043" target="_blank"> high speed asynchronous serial </a>from the USI - which is capable of a massive 16Mbaud - but I doubt anything much over 3Mbaud will be accepted over a FTDI cable!<br />
<br />
By way of a test, I hacked together a quick routing to read the ADC and send its 16 bit sample to the USI.<br />
At it's heart it has a variable length shift register which can shift a maximum of 16 bits. By adding in a start and stop bit, and setting the shift register length to 10 bits, the USI has no problem sending asynchronous serial data at up to 2Mbaud. <br />
<br />
With potential serial at the processor full speed - SPI transfer at 16MHz should be possible - and it's definitely worth trying.<br />
<br />
This will allow word length transfers to be made with the serial SRAM, and will be more efficient it setting up longer addresses.<br />
<br />
The SRAM needs a 32 bit control packet to be sent prior to any transfer. This consists of an 8 bit instruction followed by a 24 bit address. The RAM handler code should be able to efficiently set this up and clock it out to the SRAM as two consecutive 16 bit transfers. From there on it just emits clocks (dummy bytes) to accept the data bytes from the RAM. On long sequential transfers about 300Kbytes per second transfers should be possible.<br />
<br />
<b>MSPEZIO</b><br />
<br />
This is a <a href="http://www.ecu.edu/cs-cas/physics/upload/a-quick-programming-guide-for-students-using-the-msp430x2xx-in-laboratory-projects-final2.pdf" target="_blank">collection of useful I/O functions</a> to make your programming life a whole lot easier. Written for physics students at the University of East Carolina. I quote:<br />
<br />
<i><b>This guide is intended to serve as a fast introduction to the use of the msp430x2xx
embedded microcontroller for use by students in Electronics and Advanced Laboratory
environments. The intent is to allow an easy access to calls for I/O applications and serial
communications transmitting data to external computers. It is assumed that the student has
some understanding of c-programming and has been through the introduction to using the
Code Composer Studio or IAR Embedded Workbench Kickstart, IDE’s. </b></i><br />
<i><b><br /></b></i>
<b>16 Bit ADC</b><br />
<i><b><br /></b></i>
With code based on one of the mspezio examples<i style="font-weight: bold;">, </i>I was quickly able to get the SD16 ADC working and sending data out of a bit banged uart. MSPEZIO offers several examples that can be tried with CCS on the basic LaunchPad hardware.<br />
<br />
The SD16 ADC is quite comprehensive - and the mspezio set-up made the initialisation of this peripheral a lot easier. I was able to set it up to read a strain-gauge based loadcell and send readings to the PC terminal application. The MSP430F2013 really only has just enough pins to allow a simple loadcell interface with serial comms. The output of the ADC values can be triggered by sending any character over the serial comms - using the mspezio WaitForSerial() function.<br />
<br />
Much of the progress I have made with the MSP430 has been the result of evenings and weekends looking online at other code examples and good old experimentation. By modern standards the MSP430 is not a complex microcontroller, requiring significantly less initialisation code to get the basics working. I would recommend buying a Launch Pad to anyone who wants to tinker with something a bit different. As stated in a previous post, the board is low cost and there is free access to the CCS Code Composer Studio compiler and also the Arduino like Energia IDE. CCS offers multiple file projects to be built and debugged whilst Energia allows easy entry level to simple sketches.<br />
<br />
<br />
<b>SIMPL on MSP430F2013</b><br />
<br />
The plan now is to get Energia working with the MSP430F2013 so as to allow a cut down version of SIMPL to be run on it. <br />
<br />
Energia allows the SIMPL application to be built up a routine at a time - so that every last byte of precious code space can be efficiently used. This is very important on the '2013 - which only has 2K codespace and 128 bytes of RAM!<br />
<br />
The biggest problem with the MSP430F2013 is that it does not have a proper uart peripheral and whilst uart transmit is possible using the USI module with a bit of trickery, the uart receive function becomes a major challenge - involving either a timer controlled sampling of the incoming bit stream or something as yet unknown.<br />
<br />
The porting of SIMPL and the MSPEZIO helper functions to the '2013 will be the subject of a forthcoming post.<br />
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b><br /></b>
Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-86990334087266900942016-03-03T09:00:00.004+00:002016-03-20T18:10:55.929+00:00More MSP430 MachinationsIn the last few weeks I have been acquainting myself with the MSP430 - as a possible low cost candidate for future projects.<br />
<br />
There are literally hundreds of different variations of the MSP430 - and to the newcomer the range of devices can appear to be quite daunting.<br />
<br />
However, for my initial experiments I have been looking at some of the low end devices - which are particularly accessible in terms of very low cost and ease of use - and available for the MSP430G2XX Launchpad dev-board.<br />
<br />
The low-end devices are interesting because of their low cost and flexibility of peripherals, and the combination of a 16 bit ADC and a high speed universal serial peripheral makes for some novel sensor applications - particularly when applied to strain gauge, loadcell and barometric sensors.<br />
<br />
<b>Low Cost Hardware - and Free CCS Compiler</b><br />
<br />
This entry level Launchpad is available for about £7 (US$11). It comes with integrated programmer/debugger and will accept most of the DIL packaged MSP430 ICs. The free to use Code Composer Studio IDE, consisting of compiler, debugger and other workbench tools may be downloaded from the TI website - after a registration process has been completed. TI has produced dozens of useful code examples - which are a great way to learn the programming techniques of these devices.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxGpV8J0mkYLGUSulvn2rhpziIAh3m9fMN3eek6lMQ8tCnPys8pM8QDlkRQLnNyjh8C1-F3NQTk5mliQ99ZFHiQh4VrZQc12GyFiZi5HGx7wJ2WOhYH7jXb4Kz_ocfGIQnoy2Z/s1600/Launchpad_G2XX.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxGpV8J0mkYLGUSulvn2rhpziIAh3m9fMN3eek6lMQ8tCnPys8pM8QDlkRQLnNyjh8C1-F3NQTk5mliQ99ZFHiQh4VrZQc12GyFiZi5HGx7wJ2WOhYH7jXb4Kz_ocfGIQnoy2Z/s320/Launchpad_G2XX.jpg" width="312" /></a></div>
<br />
<br />
The all round work-horse shipped with the Launchpad is the MSP430G2553 which comes in a 20 pin DIL package and has 16K of program space, but only 512 bytes of RAM. There is also, included with the Launchpad kit an MSP430F2542 with 8K of codespace but only 256 bytes of RAM.<br />
The MSP430G2553 does have a proper uart - but for BSL purposes Rx is on Port 1.5 and Tx is on Port 1.1.<br />
<br />
The other device of current interest is the 14 pin DIL MSP430F2013 - which is a very low cost device but it's unique point of interest is that it is one of the few devices that has a 16 bit SD_16 A ADC and is ideal for sensor applications. However it has even less Flash (2K) and only 128 bytes of RAM! There is however 256 bytes of "Information RAM" - which is handy for storing device identity, calibration factors etc.<br />
<br />
According to TI literature, the MSP430F2013 comes with a uart based bootloader (BSL). This is curious, and yet to be fully confirmed, as the uart is one hardware peripheral missing from the '2013!<br />
<br />
There is a RAM based software BSL described in application note <a href="http://www.ti.com/lit/an/slaa450c/slaa450c.pdf" target="_blank"> SLAA450</a><br />
<br />
These small devices are all resource limited, but as such inspire ingenuity. Programming code for these is not-dissimilar to what programming the first generation microprocessors was like 40 years ago, but with moderately fast 16-bit, very low power processor plus uart or universal serial interface built in.<br />
<br />
<b>SIMPL Revisted </b><br />
<br />
On small devices with perhaps only 2K bytes of flash memory available, I have revisited my implementation of SIMPL on the MSP430, as until now, I have focussed on AVR and ARM implementations. With a bit of help from online code examples - I have managed to eliminate much of the code intensive remnants of "Arduino" and shoehorned a full featured version of SIMPL into just 1868 bytes, putting it well within my self-imposed 2Kbyte limit. This makes it applicable to the '2013, '2452 and '2553 devices.<br />
<br />
With additional functionality and further code optimisation then a 2K limit seems a reasonable size for the SIMPL kernel, especially if there is bootloader support included.<br />
<br />
The code for the MSP430G2553 version is here on this <a href="https://gist.github.com/anonymous/034dd41f108263d09803" target="_blank">Github Gist</a><br />
<br />
I have implemented a 10 bit ADC on P1.3 which is read using the s (sample) command. To read 1000 consecutive ADC samples at 100mS intervals, the following code snippet of a sampling loop with delay can be used<br />
<br />
1000{sq100m}<br />
<br />
q prints the output of the ADC followed by a crlf.<br />
<br />
With a bit of ingenuity it's possible to build up a horizontal bar graph display - of line length proportional to the input on the ADC.<br />
<br />
<br />
:B s{_[_}q<br />
<br />
Sample the ADC using s and print the corresponding number of brackets along a line. The final q prints the ADC value followed by a crlf.<br />
<br />
<b>SIMPLy Short of RAM</b><br />
<b><br /></b>
The smaller MSP430 parts are really quite short of memory with some only 256 or 512 bytes available. This really is a limitation when it comes to writing sketches in an interpreted language, so one possible solution is to add a serially accessed SRAM (or FRAM) on the SPI bus. This will extend the available memory to 32Kx8, 128K x 8 or even 256K x 8 in fast access non-volatile FRAM - (if your budget permits).<br />
<br />
MSP enthusiast, Rick Kimball has written<a href="http://forum.43oh.com/topic/739-interface-23k256-spi-ram-with-usi-spi/" target="_blank"> a library</a> to access the 23K256. A single byte can be accessed in 98uS, but the full 32Kbytes can be streamed in 100mS.<br />
<br />
The beauty of the SPI addressed memory devices is that they interface using just 4 pins - ideal for low pinout devices such as the '2013 and '2553.<br />
<br />
<br />
<b>A Historical Note on Memory.</b><br />
<br />
Ever since the Manchester "Baby" the 1948 small scale experimental computer, the operation of the cpu has been intimately tied to the operating characteristics of the memory. The computer has essentially been designed around the best memory solution available at the time, be it Williams CRT Tubes, mercury delay lines, dekatron tubes or magnetic core memory. The PDP-5 and PDP-8 were designed specifically around the most economical core memory available in the mid-1960s - even though it took half a rack of circuit modules to interface to the core.<br />
<br />
In some ways, the little computer that I am proposing, is the modern day equivalent of the PDP-8 (or possibly the 16 bit PDP-11). It is a compact 16 bit von Neuman architecture cpu with limited on chip storage, tied to a serial RAM, which can be efficiently accessed in pages or blocks of 32 bytes.<br />
<br />
Within SIMPL it should be possible to write some User words to access the off chip serial RAM in an efficient manner - perhaps treating it like a virtual disk.<br />
<br />
<br />
<b>Next time - serial communications.</b><br />
<br />
<br />
<br />
<br />Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-26875615139685719462016-02-26T15:35:00.003+00:002016-04-01T18:14:23.558+01:00The Great MSP430 Bootloader Swindle<b>Bootloading Blues.</b><br />
<br />
<br />
The MSP430 is a great little micro, and with some proper marketing, it could easily have provided an alternative to the AVR and PIC. However unclear, obfuscating, archaic documentation, spread very thinly over the web has made this little micro the poor relation of the microcontroller world.<br />
<br />
I write this having just spend a considerable amount of time in February trying to provide an effective solution for programming one of our products, an MSP430 based force gauge, which is being produced by a new supplier.<br />
<br />
Unfortunately the original programmer from Gessler is no longer available, and so an alternative was needed.<br />
<br />
The solution was actually staring in me in the face - so simple, that it's elegance seems to have been lost in the mists of time, and the desire to make everything a lot more complicated than it needs to be.<br />
<br />
Here I summarise my findings in an attempt to provide a reference that will allow others to benefit from my 3 weeks of frustrating work and false starts.<br />
<br />
As a prologue to the main post - here is an unpublished post from 3 weeks ago - when I first started on this mission<br />
<br />
(Previously unpublished - from Feb 9th 2016)<br />
<br />
<rant></rant><br />
We have an on-going project at work, which needs an MSP430 bootloading over it's serial port with a hex file. So we went out and bought the cheap open source, <a href="https://www.olimex.com/Products/MSP430/BSL/MSP430-BSL/" target="_blank">Rocket BSL programmer from Olimex</a>.<br />
<br />
I then found that I needed the drivers and other software from TI, which I had to register for and then declare to the US Government that I wasn't going to use it against America in any way, shape or form. So far, so good.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2KgE_2RgghTbDYpVEnImnOljgfw2nO0R0hDoSdaUOpbk_TJ2kVtkcklz0nZSbzAtKXPIh3s48kpwOfHJmUVQNm5FGigcGUmxRyR19ceCZ2aH8mwPZNaEtlAIVCmFzmS8fMTw6/s1600/Rocket-BSL.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="219" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2KgE_2RgghTbDYpVEnImnOljgfw2nO0R0hDoSdaUOpbk_TJ2kVtkcklz0nZSbzAtKXPIh3s48kpwOfHJmUVQNm5FGigcGUmxRyR19ceCZ2aH8mwPZNaEtlAIVCmFzmS8fMTw6/s320/Rocket-BSL.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 12.8px;"><b>North Korean? No, just Bulgarian.</b></td></tr>
</tbody></table>
The MSP430-BSL is described as a joint project between Olimex and Texas Instruments. The reality is that no-one really wants to take ownership of it, and there is no one specific site that you can go to that gives you everything you need to get this programmer to work. It's like the code has been fragmented and spread to the four corners of the known cyber world - lest anyone dares try put the fragments together again and unleash the awesomeness of this great force on mankind. What I'm trying to say is that both Olimex and the Mighty TI have this time shot themselves in both feet, and it's no surprise that the MSP430 is languishing in some stagnant microcontroller cul-de-sac.<br />
<br />
After mulling this over for a while, I began to think that proprietary bootloaders often really suck. There should be a simple, low cost universal tool which allows you to squirt code from a hex file into any microcontroller, from any platform. And that got me thinking about the humble USB-serial programming cable - such as those by FTDI, SiLabs or our Chinese friends who make the CH340.<br />
<br />
It also appears that others have had this thought. In my search for an alternative MSP430 programmer, I found this interesting approach from <a href="http://www.flyingcampdesign.com/msp430-bsl-programmer.html" target="_blank">Flying Camp Design</a> - a programmer that is literally not much more complicated than an FTDI cable - just an FT232R on a small pcb.<br />
<br />
Bootloaders are usually designed to be small, and not particularly human-friendly, because they are normally talking to some proprietary application running on the pc. But this doesn't need to be the case, there is sufficient flash space in the boot block of most micros to put a more sophisticated bootloader program - one which is actually capable of running some interpreted commands and presenting a more human friendly face to the user.<br />
<br />
<br />
<br />
<br />
<b>Getting Started</b><br />
<br />
The MSP may be programmed by one or more of the following interfaces:<br />
<br />
1. A Serial Boot Loader - resident on <i>almost</i> all MSP430 devices - known as BSL<br />
2. A JTAG interface/programmer<br />
3. SpyByWire - a 2 wire serialised version of JTAG.<br />
<br />
<br />
<b>The Electrical Interface</b><br />
<br />
Our force gauge product has a 6 pin connector on board intended for a BSL programmer. This has the following signals present - wired to pins on the IC:<br />
<br />
TX<br />
RX<br />
TEST<br />
RESET<br />
0V<br />
VCC<br />
<br />
A combination of signals on the test and reset pins puts the device into bootloader mode. The data is then sent by the PC and received by the Rx pin and acknowledged by the Tx pin.<br />
<br />
<b>The Spec Document</b><br />
<br />
The bootloader is fairly well specified in <a href="http://www.ti.com/lit/ug/slau319k/slau319k.pdf" target="_blank">TI's document SLAU319</a> - and for anyone wishing to understand the bootloader, this should be the starting place.<br />
<br />
When the MSP430 was first designed, the engineers made available a small bootloader program, residing in protected ROM, which allowed serial communication directly to a PC via a couple of pins. The BSL interface also allows you to read the contents of the Flash, erase it, verify and a range of other commands - some protected by a password mechanism - so as to avoid illegal copying of protected IP.<br />
<br />
Towards the middle of the SLAU319 document, a circuit for a programming interface is provided:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWG0iy3xgacx3S4770TulCeRqH2DoswPorDII763WTY3A1Wb6Sm0PfvP5fgPqKN1BHsfJ9Wo6Skuhyphenhyphen4oSVne_tCLVuTGaGKM9tGR7Ol-yDl-QRKuhdDkN9rpfdiysLPo5Wfl7W/s1600/BSL_schematic.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="202" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWG0iy3xgacx3S4770TulCeRqH2DoswPorDII763WTY3A1Wb6Sm0PfvP5fgPqKN1BHsfJ9Wo6Skuhyphenhyphen4oSVne_tCLVuTGaGKM9tGR7Ol-yDl-QRKuhdDkN9rpfdiysLPo5Wfl7W/s400/BSL_schematic.jpg" width="400" /></a></div>
This circuit dates from the early 2000's - when all PCs and laptops came with 9 pin serial COM ports.<br />
<br />
In essence, there are three, level shifted outputs from the COM port to the target device, and one level shifted input back to the PC. Modern RS232 generally puts out +/-6V - and we need 0-3V TTL levels for the MSP430. The circuit is powered by harvesting spare energy from the output lines through diodes and pumping up a capacitor. The raw supply feeds the TL062 op-amp and is then regulated to 3V to provide a stable supply for the 74AHC14 Schmitt inverters.<br />
<br />
This really is a very simple circuit - but sadly off-putting because it uses about 25 components and uses the now obsolete 9 way D-type and COM port.<br />
<br />
What is really needed is a modern equivalent that works with USB and modern software drivers.<br />
<br />
<br />
<b>USB Implementation.</b><br />
<b><br /></b>
There are several low cost USB to serial converter chips to choose from, including FTDI, CP2102 (SiLabs) and the newer Chinese CH340G. All of them have the potential to work in this circuit.<br />
<br />
I covered the CH340G in a <a href="http://sustburbia.blogspot.co.uk/2016/01/nano-computing.html" target="_blank">recent post</a> and the datasheet is <a href="http://cdn2.boxtec.ch/pub/diverse/ch340g-datasheet.pdf" target="_blank">here</a>. The CH340 is low cost and easy to use. I have subsequently used the CH340G on some of my other projects.<br />
<br />
For my experimentation, however, I used a SiLabs CP2102 device mounted on a small pcb - solely because I had it lying about. It breaks out all of the common RS232 signals - including RTS and DTR which we need. These modular devices are available from ebay for a couple of dollars - and a variety to choose from.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdoOd68KVn7hzBIygKrNysogG7WcsQPpw2BiC9eccHnCCKdCBjT8G5VzK3Ti7eFp1ioyTWgKV7G9gxKa3-Dykusp5tvsZOaVen1aKPCVX5u7RLZLfj7HiuNyTyJSBRGp1pL3tD/s1600/CP2102_module.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdoOd68KVn7hzBIygKrNysogG7WcsQPpw2BiC9eccHnCCKdCBjT8G5VzK3Ti7eFp1ioyTWgKV7G9gxKa3-Dykusp5tvsZOaVen1aKPCVX5u7RLZLfj7HiuNyTyJSBRGp1pL3tD/s320/CP2102_module.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>CP2102 module by Baite Electronics </b></td></tr>
</tbody></table>
The one above comes with a set of double ended leads - so you can easily make up your own custom cable.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVemim2X9JiTbFfT7y8UwTna0e2dl-z3tsVHzNkcX9xXZicZrGIrA_Alr2bOlhS1utxs_ghb7Ce9BaUxPMbhQNtI7x1QtTac4atcRO4sdyaLNLniFajByTY8GjK8Jxxe8XXE5b/s1600/CP2102_topside.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="305" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVemim2X9JiTbFfT7y8UwTna0e2dl-z3tsVHzNkcX9xXZicZrGIrA_Alr2bOlhS1utxs_ghb7Ce9BaUxPMbhQNtI7x1QtTac4atcRO4sdyaLNLniFajByTY8GjK8Jxxe8XXE5b/s320/CP2102_topside.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFVYbgpCQR7sSi0qN1KDHlATSaKfs-kXvK8A3zKqfcHxK5LBh6ilnB9D6kBfuY9ZtiV6I81N80C6bgelCxxT4Jkj7RIh_VBFeF3MblZU_8VjFVL2GXnvyqSDPHEVzF1xKj11XF/s1600/CP2102_underside.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFVYbgpCQR7sSi0qN1KDHlATSaKfs-kXvK8A3zKqfcHxK5LBh6ilnB9D6kBfuY9ZtiV6I81N80C6bgelCxxT4Jkj7RIh_VBFeF3MblZU_8VjFVL2GXnvyqSDPHEVzF1xKj11XF/s320/CP2102_underside.jpg" width="320" /></a></div>
<br />
<br />
So to make this work we need to access Tx, Rx, RTS and DTR. RTS and DTR are often available on the 4 way headers down the side of the module.<br />
<br />
The module also conveniently supplies a 3V3 supply from an internal voltage regulator <a href="https://www.silabs.com/Support%20Documents/TechnicalDocs/CP2102-9.pdf" target="_blank">(see datasheet)</a> - this can supply a maximum of 100mA - more than enough for powering most MSP430 dev-boards.<br />
<br />
<b>Programming Application Software</b><br />
<br />
I tried a couple of programming applications, with very little success - until I stumbled <a href="http://kurt.on.ufanet.ru/" target="_blank">MSPFET</a> - from a Russian gentleman Kurt. This did exactly what was needed - allowing a hex file to be loaded into the MSP430.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGWIYfgMy72qhzBsTjcHUUIZQwG253VCu9wo7QBmaLrAWTMnQYjBvZ-A_j-FGx1C-DprurLgehcBOWOaX7k0EMzbVnpBNmz9e_TpMLc-kPTeyn3VKtIOYppPTcmM2w_pdg_rCu/s1600/mspfet.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGWIYfgMy72qhzBsTjcHUUIZQwG253VCu9wo7QBmaLrAWTMnQYjBvZ-A_j-FGx1C-DprurLgehcBOWOaX7k0EMzbVnpBNmz9e_TpMLc-kPTeyn3VKtIOYppPTcmM2w_pdg_rCu/s400/mspfet.jpg" width="400" /></a></div>
<br />
<br />
Programming the MSP430 really is that cheap and easy - using free software and a USB to serial module costing under $2 - finding out how to do it - from the information spread over the web it - was so very much harder.<br />
<br />
<b>Common Myths - Busted</b><br />
<br />
You don't need a <a href="https://www.elprotronic.com/products?show&id=17" target="_blank">$300 JTAG Programmer.</a> In desperation I found a FET-Pro 430 reduced to $50 on ebay.<br />
<br />
You don't need an $11 <a href="https://www.olimex.com/Products/MSP430/BSL/MSP430-BSL/" target="_blank">Olimex MSP-BSP "Rocket" Programmer.</a> I bought two of these from Mouser - I am still trying to find the correct software to make them work.<br />
<br />
<br />
<b>In conclusion</b><br />
<b><br /></b>
The BSL feature that comes with almost all MSP430 devices is great at doing what it was intended for - a very simple means of getting your hex file into the MSP430's flash. <br />
<br />
The resources needed to make this work are trivial, and it could make a great addition to any application that needs the ability to modify the flash memory.<br />
<br />
Unfortunately, the documentation has been obfuscated and made more compex than needs-be by JTAG and SpyByWire (for debugging) - and so few people are aware what a simple facility BSL is to use. The hardware needed in the form of a USB - Serial converter should be part of every hobbyist's or Engineer's toolkit.<br />
<br />
The resources needed to make this work are trivial, and it could make a great addition to any application that needs the ability to modify the flash memory.<br />
<br />
The protocol is simple, as is the 2 signal start-up sequence - and at a pinch, if you didn't have a serial converter that supports DTR (eg FTDI cable) you could hack an Arduino or Launchpad to generate the start-up sequence. You could even make a standalone programmer for repeat programming of boards out in the field using a Launchpad.<br />
<br />
Energia has made the MSP430 more accessible - providing an Arduino like development environment. However, it is still nice to know how the simple low-level bootloader scheme works.<br />
<br />
<b>Update</b><br />
<br />
I have written a follow-up to this post:<br />
<b><br /></b>
<span style="color: #0000ee; text-decoration: underline;"><a href="http://sustburbia.blogspot.co.uk/2016/03/the-great-msp430-bootloader-swindle.html" target="_blank">The Great MSP430 Bootloader Swindle - Part 2</a></span><br />
<b><br /></b>This looks at the hardware and PC applications needed to make the simple BSL work.<br />
<br />
I have also implemented the CH340G bootloader circuit on my <a href="http://sustburbia.blogspot.co.uk/2016/03/chipstick-small-scale-experimental.html" target="_blank">latest MSP430 board</a>. Below, on the left is the CH340G, its accompanying 12MHz crystal and a couple of 22pF capacitors. That's almost all you need for a bootloading interface!<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUZe3P41xk-0pxsdIH_c3oFCi_G3hWOrI_L5UM1OqtUaEWTihnDn_q0FNG9rF9JmBQ2QKaUCDM78__NITU-yOaHpVXSfUIc6ul9zoAh-iQ5en99xRNuQUlk3ZolcF7tQ3vgtfI/s1600/ChipStick_bottom.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUZe3P41xk-0pxsdIH_c3oFCi_G3hWOrI_L5UM1OqtUaEWTihnDn_q0FNG9rF9JmBQ2QKaUCDM78__NITU-yOaHpVXSfUIc6ul9zoAh-iQ5en99xRNuQUlk3ZolcF7tQ3vgtfI/s320/ChipStick_bottom.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>ChipStick - an 11mm x 40mm MSP430FR2433 Dev Board</b></td></tr>
</tbody></table>
<br />
<br />
<br />
<br />
<br />Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com7tag:blogger.com,1999:blog-16736699.post-35076608948223714672016-02-20T13:48:00.004+00:002016-02-20T19:47:55.000+00:00Building WiNode 5 - Part 3<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpp56bK6y7Xq9bPDw-6CbNF4ETxvVQJ0nygUei45j3i-nm-KH1hbBVVDlTSY_pj2SVCp0Q6ZFU-DkP949TOVLHBtmRv6LEVrXy28lMGLTPO2cLOqMO9IyyhvPnXoW7qS5oh01E/s1600/accel_only.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="316" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpp56bK6y7Xq9bPDw-6CbNF4ETxvVQJ0nygUei45j3i-nm-KH1hbBVVDlTSY_pj2SVCp0Q6ZFU-DkP949TOVLHBtmRv6LEVrXy28lMGLTPO2cLOqMO9IyyhvPnXoW7qS5oh01E/s320/accel_only.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
Some five years have passed since the original WiNode design, and WiNode 5 - consider it to be the Anniversary Edition, has tried to build upon some of the changes that have happened over the intervening years. There has been an explosion of low cost wireless modules onto the hobbyist market, WiFi, Bluetooth Low Energy (BLE) and upgraded <1ghz an="" and="" be="" devices="" ism="" latest="" may="" modules="" mounted.="" of="" offers="" onto="" open-platform="" p="" some="" these="" this="" version="" which="" winode=""><br />
<b>More than just an ATmega1284 Platform</b><br />
<b><br /></b>
WiNode comes towards the end of my involvement with 8-bit microcontrollers - as I move towards 16 bit and 32-bit devices. For this reason it was designed with future proofing in mind. <br />
<br />
Whilst a surface mounted ATmega1284 may be soldered to the pcb for the basic board, there is also provision for a 40 pin DIL socket or pair of female header strips to be fitted down the centre of the pcb. If the ATmega1284 is not fitted to the board, then any other mcu of up to about a 48 pin package - suitably mounted on a small carrier pcb that matches the 40 DIL pin-out, may be plugged into the board. The 40 pin "socket" is based around the pin-out of the DIL ATmega1284 - so even one of those can be fitted if necessary.<br />
<br />
This technique allows the use of a range of small processors, including ARM Cortex M, MSP430 and the like. I already have prototype designs for STM32Fxxx and MSP430 microcontroller variants.<br />
<br />
With the upgrade in processor, comes an increase in clock frequency, increase in memory, improvement in peripheral features and speed and often an increase in ADC resolution.<br />
<br />
<b>ARM Cortex M4 Variant</b><br />
<br />
For instance, the STM32F373 - a 72MHz ARM Cortex M4 in a 48 pin LQFP package comes with 3 UARTS, 2 SPI, 2 I2C, up to 256Kbytes of Flash and up to 32Kbytes of RAM, plus a multichannel 12 bit ADC and 3 separate differential input Sigma Delta 16 bit ADCs. The Cortex M4F core comes with floating point and DSP operations. This is the ideal processor for high speed manipulation of analogue sampled data - for example 3 phase energy monitoring. These processors start at £3.33 in 1 off.<br />
<br />
<b>MSP430 Variant</b><br />
<br />
Another interesting processor is the ultra low power MSP430 FR series. These are a 16 bit processor with 24MHz clock frequency, 12 bit ADC channels, 2 UARTs, SPI and I2C. The unique feature of the FR series is that they use non-volatile ferroelectric FRAM memory for program and data storage. This allows exceptionally low power operation, retaining data after power down and capable of very fast write access - for high speed programming or datalogging.<br />
<br />
<b>Other Interesting Options</b><br />
<b><br /></b>
There is an increased interest in the use of FPGAs as a means of providing open source soft core processors. One such option is the J1 Forth processor implemented on a low cost Lattice FPGA - using an open source toolchain. The FPGA is available in an 84 QFN package just 7mm x 7mm which could be fitted onto the DIL 40 carrier board.<br />
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b>The WiNode 5 Hardware and Peripherals</b><br />
<br />
Here I describe the hardware in a little more detail:<br />
<br />
All of the hardware on WiNode 5 is designed to work at a 3.3V Vcc - thus keeping power requirements to a minimum. Think carefully before you connect to any non- 3.3V shield!<br />
<br />
The RFM69 wireless transceiver is still very much fundamental to the design, tracing it's roots to Jean Claude Wippler's JeeNode design - which used the ATmega328 and the RFM12B - and was probably about one of the first commercial wireless connected Arduino variants. <br />
<br />
The RFM69 uses D10 for it's chip select, and the new INT2 interrupt that is available on the ATmega1284 - appearing on D8.<br />
<br />
In addition to the encumbent RFM69, WiNode 5 also offers an un-committed "X-Bee" footprint (XB1) This allows any additional wireless device to be added at a later date - based on a shield that conforms to the X-Bee pinout.<br />
<br />
One of the biggest advances in the last 2 years is the emergence of very low cost WiFi modules based on the ESP8266 device. WiNode provides a 4x2 connector to allow an optional ESP-01 WiFi module to be plugged in directly so that it can communicate with the mcu using the additional UART 1. Note that WiFi support is optional and not central to the WiNode philosophy. Using a pre-built mass-produced plug-in module is the quickest and cheapest way to give it WiFi connectivity.<br />
<br />
The original WiNode used a non-volatile 32Kbyte 23K256 SPI SRAM - backed up by a small super-capacitor. This feature has also been retained with IC3 a SOIC-8 package, but now the device can be an SRAM of up to 128Kbytes or a ferrroelectric FRAM of up to 256Kbytes. Chip selection is by port B0.<br />
<br />
Whilst novel when first introduced on my Nanode RF design of 2011, the micro SD is now common place on many development boards and SBCs. I have retained the same basic uSD socket - soldered to the underside of the pcb and selected using port D9.<br />
<br />
With lower power, yet more capable microcontrollers, there is frequently the need to make portable battery powered devices. With the emergence of cheap Lithium polymer (LiPo) battery technology, WiNode 5 reflects this with support for an external battery. This does not need to be a LiPo as an on-board boost converter, IC6, based on low cost MCP1640 allows a single cell to be boosted up to 3V3 so as to power the board.<br />
<br />
One of the biggest bug-bears 5 years ago was the crippling cost of placing an FT232R device onto the board in order to allow connection to a PC via USB. Fortunately there are now several much lower cost alternatives available, and WiNode 5 uses the CH340G device in position IC7 - which is available for less that $0.50. It needs a 12MHz crystal Y3 for correct USB timing.<br />
<br />
The ATmega1284 provides a whole additional 8 bit port over and above what the ATmega328 supplies. Six of these additional port lines are broken out to a header which is placed below the usual 6 pin Arduino "Power" header. These additional pins are general purpose I/O, but also carry the signals associated with the JTAG interface.<br />
<br />
As WiNode 5 uses several SPI devices, the additional port lines C0-C5 can be used to select additional devices on the SPI bus - this offers an easy route for expansion. More on expansion later.<br />
<br />
<br />
<br />
<b>Board Pin Out Details</b><br />
<b><br /></b>
WiNode 5 has been designed to act either as a stand alone, battery powered, wireless connected controller or monitor, alternatively as part of a larger system. <br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">// _________________________________</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PC-RXD0 (D0) |o A7 (D29) o|A5 (D27)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PC-TXD0 (D1) |o A6 (D28) o|A5 (D26)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// * ESP-RXD1 (D2) |o B0 (D30) o|A3 (D25)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// * ESP-TXD1 (D3) |o B1 (D31) o|A2 (D24)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// KBD_DATA (D4) |o o|A1 (D23)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PD (D5) |o o|A0 (D22)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// MOUSE_CLK (D6) |o |</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// MOUSE_DATA (D7) |o |</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// | o|VIN</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// RFM_INT2 (D8) |o o|0V</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// uSD_CS (D9) |o o|0V</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// RFM_CS (D10) |o o|+3V3</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// MOSI (D11) |o o|+5V</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// MISO (D12) |o o|RES</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// SCK (D12) |o o|C5 (D21)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// 0V |o o|C4 (D20)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// AREF |o Open Hardware o|C3 (D19)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// I2C-SDA (D14) |o WiNode 5 o|C2 (D18)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// I2C-SCL (D15) |o o|C1 (D17)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// ANT |O o|C0 (D16)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// |_________________________________|</span><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFdASoR01YXlyaE1lJM4_2TvdHB1hyphenhyphentG386LYRPj-7LDRd4_buvf1Q3SdjujqqQLGQ9iVYsnGkVGamAF8JvYhQK9fujZKcs2TVNLhFs3IMl_EfJzbV-6fsocIcUPd1pk2wPkwc/s1600/VGA812_Shield.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFdASoR01YXlyaE1lJM4_2TvdHB1hyphenhyphentG386LYRPj-7LDRd4_buvf1Q3SdjujqqQLGQ9iVYsnGkVGamAF8JvYhQK9fujZKcs2TVNLhFs3IMl_EfJzbV-6fsocIcUPd1pk2wPkwc/s400/VGA812_Shield.jpg" width="350" /></a></div>
<br />
<br />
One of the first applications is that of a retro-computer system using the EVITA graphics driver board (above). EVITA provides 1024x768 full 24bit colour graphics and an interface for PS/2 keyboard and mouse. It also allows a Wii Nunchuck controller to be plugged in.<br />
<br />
With just WiNode 5 and EVITA, you have a complete retro-computing work/play station capable of driving a large screen monitor in just 2 small pcbs. For portability you can use a Gameduino2 shield and a LiPo battery.<br />
<br />
The slight conflict yet to be resolved here is when using the PS/2 keyboard with the ESP-01 WiFi. The keyboard generates a clock which needs to interrupt the mcu via INT1 (D3).<br />
<br />
If used with a Gameduino 2 - INT 0 (D2) is also required. This kind of precludes the use of the ESP-01 WiFi - unless a work around is possible.<br />
<br />
<b>PCB Layout</b><br />
<br />
WiNode was designed from the start to be smaller than the standard Arduino (Uno) - always considered to be too bulky and "Arty" rather than a simple rectangular board with sensible pin spacing and mounting holes. At 55x64mm it was intended to fit into a readily available plastic case with a battery enclosure. WiNode used predominantly through hod mounted components wherever possible.<br />
<br />
WiNode 5 takes advantage of surface mounted components - as it was found that even the through hole parts presented too much of a soldering challenge to the average user. This means that the circuitry can have a greater density - thus a smaller pcb and be cheaper to assemble - using pick and place machines and reflow soldering ovens. It is really geared up for the modern electronics pcb assembly processes. As a result, WiNode 5 packs a lot more functionality into a 50mm x 50mm pcb - some 71% of the board area of it's predecessor.<br />
<br />
Whilst WiNode 5 can be hand soldered - it will take a few hours and you really need to be proficient at surface mount detailed soldering, have good light and good magnification available.<br />
<br />
The board is based on a 50 mm x 50 mm standard footprint - with the aim of retaining Arduino header compatibility on the smallest pcb possible. WiNode takes advantage of pre-built plug in modules - such as the ESP-01, the adxl 335 accelerometer module and the X-Bee module. These can be bought on ebay cheaper than they can be built.</1ghz>Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-20124427011911654942016-02-20T10:59:00.001+00:002016-02-29T00:07:45.882+00:00Building WiNode 5 - Part 2<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Pin Mapping</span></b><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">WiNode 5 is the successor to earlier WiNodes that were based on the 28 pin DIL ATmega328. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">The ATmega1284 offers significantly more features and GPIO pins, 32 compared to the 20 of the ATmega328 - and these all have to be mapped out in a way that makes sense on the PCB. There is also a constraint of 28 header pins - so four of the GPIO appear elsewhere on the pcb - for specific functions - see later. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">There is no common standard, with several commercial ATmega1284 boards doing their own thing - generally based on the 40 pin DIL version of the ATmega1284.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span><span style="font-family: "arial" , "helvetica" , sans-serif;">Reverting to good ol' ASCII Art - Here is one mapping scheme from "Mighty1284P"</span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">// +---\/---+</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// (D 0) PB0 1| |40 PA0 (AI 0 / D24)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// (D 1) PB1 2| |39 PA1 (AI 1 / D25)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D26)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM (D 3) PB3 4| |37 PA3 (AI 3 / D27)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM/SS (D 4) PB4 5| |36 PA4 (AI 4 / D28)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D29)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM/MISO (D 6) PB6 7| |34 PA6 (AI 6 / D30)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM/SCK (D 7) PB7 8| |33 PA7 (AI 7 / D31)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// RST 9| |32 AREF</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// VCC 10| |31 GND </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// GND 11| |30 AVCC</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// XTAL2 12| |29 PC7 (D 23)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// XTAL1 13| |28 PC6 (D 22)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// RX1/INT0 (D 10) PD2 16| |25 PC3 (D 19) TMS</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// TX1/INT1 (D 11) PD3 17| |24 PC2 (D 18) TCK</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM (D 12) PD4 18| |23 PC1 (D 17) SDA</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM (D 13) PD5 19| |22 PC0 (D 16) SCL</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM (D 14) PD6 20| |21 PD7 (D 15) PWM</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// +--------+</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">This is a fairly logical approach, with pins numbered starting from Pin 1 of the package and just following the package around. However it does not tie in well with the mapping on the Arduino or WiNode 5 board:</span><br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">The Bobuino pin mapping is much more like the original Arduino - preserving D0 to D13 in their old familiar positions and functions, plus the analogue inputs mapped to D14 to D21, and the additional (Port C) pins following on as D22 to D29. This just puts SCL and SDA a little bit off beat as D22 and D23. The mapping scheme is better but not perfect:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">//</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// +---\/---+</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// (D 4) PB0 1 | | 40 PA0 (D 21) AI 7</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// (D 5) PB1 2 | | 39 PA1 (D 20) AI 6</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// INT2 (D 6) PB2 3 | | 38 PA2 (D 19) AI 5</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM (D 7) PB3 4 | | 37 PA3 (D 18) AI 4</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM/SS (D 10) PB4 5 | | 36 PA4 (D 17) AI 3</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// MOSI (D 11) PB5 6 | | 35 PA5 (D 16) AI 2</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM/MISO (D 12) PB6 7 | | 34 PA6 (D 15) AI 1</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM/SCK (D 13) PB7 8 | | 33 PA7 (D 14) AI 0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// RST 9 | | 32 AREF</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// VCC 10 | | 31 GND </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// GND 11 | | 30 AVCC</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// XTAL2 12 | | 29 PC7 (D 29) </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// XTAL1 13 | | 28 PC6 (D 28) </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// RX0 (D 0) PD0 14 | | 27 PC5 (D 27) TDI</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// TX0 (D 1) PD1 15 | | 26 PC4 (D 26) TDO</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// INT0 RX1 (D 2) PD2 16 | | 25 PC3 (D 25) TMS</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// INT1 TX1 (D 3) PD3 17 | | 24 PC2 (D 24) TCK</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM (D 30) PD4 18 | | 23 PC1 (D 23) SDA</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM (D 8) PD5 19 | | 22 PC0 (D 22) SCL</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM (D 9) PD6 20 | | 21 PD7 (D 31) PWM</span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">// +--------+</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">My problem is that pins B0 and B1 are not routed to the regular headers but appear on the upper H-bridge connector JP4 and the "X-Bee" shield. Additionally Analogue inputs A6 and A7 are used on board for battery volts and battery temperature monitoring. These rogue pins need to be accounted for in the mapping scheme.</span><span style="font-family: "arial" , "helvetica" , sans-serif;">This therefore gives rise to the modified arrangement:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">//</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// </span><span style="font-family: 'courier new', courier, monospace;"> +---\/---+</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// (D 30) PB0 1 | | 40 PA0 (D 22) AI 0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// (D 31) PB1 2 | | 39 PA1 (D 23) AI 1</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// INT2 (D 8) PB2 3 | | 38 PA2 (D 14) AI 2</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM0A (D 9) PB3 4 | | 37 PA3 (D 25) AI 3</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM0B/SS (D 10) PB4 5 | | 36 PA4 (D 26) AI 4</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// MOSI (D 11) PB5 6 | | 35 PA5 (D 27) AI 5</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM3A/MISO (D 12) PB6 7 | | 34 PA6 (D 28) AI 6</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM3B/SCK (D 13) PB7 8 | | 33 PA7 (D 29) AI 7</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// RST 9 | | 32 AREF</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// VCC 10 | | 31 GND </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// GND 11 | | 30 AVCC</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// XTAL2 12 | | 29 PC7 (D 21) </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// XTAL1 13 | | 28 PC6 (D 20) </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// RX0 (D 0) PD0 14 | | 27 PC5 (D 19) TDI</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// TX0 (D 1) PD1 15 | | 26 PC4 (D 18) TDO</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// INT0 RX1 (D 2) PD2 16 | | 25 PC3 (D 17) TMS</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// INT1 TX1 (D 3) PD3 17 | | 24 PC2 (D 16</span><span style="font-family: "courier new" , "courier" , monospace;">) TCK</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM1B (D 4) PD4 18 | | 23 PC1 (D 14) SDA</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM1A (D 5) PD5 19 | | 22 PC0 (D 15) SCL</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM2B (D 6) PD6 20 | | 21 PD7 (D 7) PWM2A</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// +--------+</span><span style="font-family: "courier new" , "courier" , monospace;"> </span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">With any pin-mapping , it is clearly a compromise between physical and logical arrangement. These changes can be incorporated into the pins_arduino.h header file. We achieve a mapping that is reasonably familiar with existing Arduino pin-out and ties in well with the physical layout of the pcb:</span><br />
<span style="font-family: "verdana" , sans-serif;"><br /></span>
<span style="font-family: "verdana" , sans-serif;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">// _________________________________</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// RXD0 (D0) |o </span><span style="font-family: "courier new" , "courier" , monospace;">A7 </span><span style="font-family: "courier new" , "courier" , monospace;">(D29)</span><span style="font-family: "courier new" , "courier" , monospace;"> o|A5 </span><span style="font-family: "courier new" , "courier" , monospace;">(D27)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// TXD0 (D1) |o </span><span style="font-family: "courier new" , "courier" , monospace;">A6 </span><span style="font-family: "courier new" , "courier" , monospace;">(D28)</span><span style="font-family: "courier new" , "courier" , monospace;"> o|A5 </span><span style="font-family: "courier new" , "courier" , monospace;">(D26</span><span style="font-family: "courier new" , "courier" , monospace;">)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// RXD1 INT0 (D2) |o B0 (D30) o|A3 </span><span style="font-family: "courier new" , "courier" , monospace;">(D25)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// TXD1 INT1 (D3) |o B1 (D31) o|A2 (D24)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM1B (D4) |o o|A1 (D23)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM1A (D5) |o o|A0 (D22</span><span style="font-family: "courier new" , "courier" , monospace;">)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM2B (D6) |o |</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM2A (D7) |o |</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// | o|VIN</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// INT2 (D8) |o o|0V</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM0A (D9) |o o|0V</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM0B/SS (D10) |o o|+3V3</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// MOSI (D11) |o o|+5V</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM3A MISO (D12) |o o|RES</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// PWM3B SCK (D13) |o <b> </b> o|</span><span style="font-family: "courier new" , "courier" , monospace;">C5 (D21)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// 0V |o o|</span><span style="font-family: "courier new" , "courier" , monospace;">C4 (D20)</span><span style="font-family: "courier new" , "courier" , monospace;"> </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// AREF |o Open Hardware o|</span><span style="font-family: "courier new" , "courier" , monospace;">C3 (D19)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// SDA (D14) |o </span><b style="font-family: 'Courier New', Courier, monospace;">WiNode 5 </b><span style="font-family: "courier new" , "courier" , monospace;"> o|</span><span style="font-family: "courier new" , "courier" , monospace;">C2 (D18)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// SCL (D15) |o o|</span><span style="font-family: "courier new" , "courier" , monospace;">C1 (D17)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// ANT |O o|</span><span style="font-family: "courier new" , "courier" , monospace;">C0 (D16) </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">// |_________________________________|</span><br />
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">This makes for a neat, logical arrangement, where the pairs of complimentary PWM outputs are located next to one another - and in a neat group D4-D7.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">SCL and SDA are on the end of the upper digitals - where you would expect them on an R3 shield. </span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">The JTAG lines (TCK,TMS, TDI,TD0) are in a neat group on the extended headers C0-C5. C4 and C5 may be used for active signalling to the shield through the Arduino I/O and NC pins on the end of the power header.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">ANT is the antenna connection to the RFM69 wireless transceiver module.</span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">In part 3 we further name and map these pins to suit the EVITA graphics shield and the Open Inverter H-bridge module.</span></div>
Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-42542346097813599492016-02-20T00:25:00.004+00:002016-02-20T19:55:34.573+00:00Building WiNode 5 - Part 1<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwoFI9q4Ggk2EwPbVPFUg3UxjLSaxyp3AWZYGRqVfeE5vtiINOTGAmE0fXdlog39M5GLG8LQz2_YyBPFCO2sdE6QrALVplTnkTdqaj1AZm54fNlMJ5P2Yj71_s9K3Qx52JXeGu/s1600/bare_board.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwoFI9q4Ggk2EwPbVPFUg3UxjLSaxyp3AWZYGRqVfeE5vtiINOTGAmE0fXdlog39M5GLG8LQz2_YyBPFCO2sdE6QrALVplTnkTdqaj1AZm54fNlMJ5P2Yj71_s9K3Qx52JXeGu/s320/bare_board.jpg" width="319" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>Bare Board, 2 layer, 50mm x 50mm</b></td></tr>
</tbody></table>
<br />
Two weeks ago, you may remember I finished the pcb layout for a new microcontroller board - WiNode 5 - based on my 50 x 50mm standard board footprint.<br />
<br />
<b>Minimum Build.</b><br />
<b><br /></b>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWfpT5vZuewaHtrbUYApPiu83vMLAfNwBIGUJi1ZU2s7IzpNoyr5Wjni11IYcdTu0hsL504ElNdfUb0KwCNmJfQS9x74EB9uj1Jl5pyWvLVqV8aiVhlUYsyYj_zhWWe4Wa-Hgn/s1600/WiNode5_min_build.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWfpT5vZuewaHtrbUYApPiu83vMLAfNwBIGUJi1ZU2s7IzpNoyr5Wjni11IYcdTu0hsL504ElNdfUb0KwCNmJfQS9x74EB9uj1Jl5pyWvLVqV8aiVhlUYsyYj_zhWWe4Wa-Hgn/s320/WiNode5_min_build.jpg" width="297" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>With mcu, reset and crystal fitted, the board runs "Blink"code</b></td></tr>
</tbody></table>
<b><br /></b>
<b><br /></b>
For this I suggest fitting the ATmega1284 SMT package, the 16MHz crystal and its two 22pF capacitors C14 and C15.<br />
<br />
Also the 10K reset resistor R1 and the FTDI 6way right-angled header JP1.<br />
<br />
A 3.3V MCP1702 regulator should be fitted in position IC4 along with C2, C4 and C5 its input and output capacitors.<br />
<br />
Fit the four 100nF decoupling capacitors around the main microcontroller, C3, C7, C12 and C19.<br />
<br />
The 3x2 pin ICSP programming header JP6 should also be fitted.<br />
<br />
For LED output fit green LED1 and its 100R series resistor R10.<br />
<br />
With this minimum build you may power the board from the FTDI cable and now program the bootloader using ICSP. If this is successful, loading the blinky sketch should run and the LED should flash.<br />
<br />
Now we add the USB chip IC7 (CH340G) the USB connector and the 12MHz USB crystal. Add the 22pf capacitors C18 and C20 and the 100nF decoupling capacitor C20.<br />
<br />
Fit capacitors C8, C9 and resistor R2 to provide a filtered AVCC supply.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5l7NypYD7pO-319ael8HOOpKTSuIORiTse8E8zrmxnNZ9lWAlfdGbczxGIZmN4f60kdKDhZvVFVld88z7r6KNL0UJ_C44QkMHBnp-EZoo3FFa9njpMHBq4oowPMH9JLKbFYv9/s1600/ESP_USB_fitted_1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5l7NypYD7pO-319ael8HOOpKTSuIORiTse8E8zrmxnNZ9lWAlfdGbczxGIZmN4f60kdKDhZvVFVld88z7r6KNL0UJ_C44QkMHBnp-EZoo3FFa9njpMHBq4oowPMH9JLKbFYv9/s320/ESP_USB_fitted_1.jpg" width="279" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: 12.8px;"><b>Add the RFM69 Wireless, the USB and the ESP-01 WiFi</b></span></td></tr>
</tbody></table>
<br />
The RFM69 wireless module and the ESP-01 WiFi connector and module can be added at this stage.<br />
<br />
Finally - fit the four female shield mounting headers.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH44T5l7DVniJCm1kBymeknApqyzk5WQ9HNg-I9xbYUwDz52Sd2DyV9MeMbBNlJSFaB3YrySpwpZ8llv_fEeWCUKpmyOxifxDSm5Vlut7HxW5bG3kvbu1zP77Rlae67NR79pCw/s1600/USB_Wireless_fitted.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH44T5l7DVniJCm1kBymeknApqyzk5WQ9HNg-I9xbYUwDz52Sd2DyV9MeMbBNlJSFaB3YrySpwpZ8llv_fEeWCUKpmyOxifxDSm5Vlut7HxW5bG3kvbu1zP77Rlae67NR79pCw/s320/USB_Wireless_fitted.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>Fit the "Arduino" style female socket strips</b></td></tr>
</tbody></table>
<br />
These allow complete shields to be added, or small modules like the accelerometer module - which is powered by and connected to the Analogue Input port<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinteDjBzUmDyjHiDxyLMZhcFxB1m4VNkGpYreAB8BXDB3P98_SxvGICPiVKPmHJ4-k0fPP2NVnVu5oCUX5g_0Av2EZmpItYg80Txf_sLuiHM-fb9GmRJCYIpPPY33yD_-cfGME/s1600/accel_only.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="316" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinteDjBzUmDyjHiDxyLMZhcFxB1m4VNkGpYreAB8BXDB3P98_SxvGICPiVKPmHJ4-k0fPP2NVnVu5oCUX5g_0Av2EZmpItYg80Txf_sLuiHM-fb9GmRJCYIpPPY33yD_-cfGME/s320/accel_only.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>With axdl 335 Accelerometer module fitted</b></td></tr>
</tbody></table>
<b><br /></b>
<b>Programming and Firmware</b><br />
<br />
The Optiboot loader and Arduino "board" files for this project are located at the <a href="https://github.com/maniacbug/mighty-1284p" target="_blank">Mighty1284 Github repository</a> - with more information about the <a href="https://maniacbug.wordpress.com/2011/11/27/arduino-on-atmega1284p-4/" target="_blank">ATmega1284P implentation of Arduino</a> here.<br />
<br />
With the new 1284 board files loaded into the hardware directory of the Arduino IDE, you are now ready to program the Optiboot loader into some chips.<br />
<br />
<br />
Having got the basics of the board in place, and proven that all was working so far, it was at a stage where it could be left and I could get some sleep.<br />
<br />
The final construction stages were to populate the boost converter, fit the FRAM (or SRAM) IC and fit the micro SDcard socket to the underside of the board.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicMx5cnIbvjhxGkn_GSRSk4ST2OaOtjsDuW13GWCozTVmyp3bz2LUu-LT6JWtKgzzWUcMx5QTDebqvPF3PXVI5FjUDOeQmqPl0LCrowiJJC2DRRupUs9mpOY6k65ME4oQKSCwu/s1600/WiNode+5+Topside+Complete.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="306" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicMx5cnIbvjhxGkn_GSRSk4ST2OaOtjsDuW13GWCozTVmyp3bz2LUu-LT6JWtKgzzWUcMx5QTDebqvPF3PXVI5FjUDOeQmqPl0LCrowiJJC2DRRupUs9mpOY6k65ME4oQKSCwu/s320/WiNode+5+Topside+Complete.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>WiNode 5 virtually complete - topside view</b></td></tr>
</tbody></table>
Above - the boost converter components, IC, 5 resistors, 2 capacitors and an inductor are added to the lower right corner of the board.<br />
<br />
Just above the mcu is the SOIC-8 FRAM IC.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhONmP7AjQduBK3L8qUEs_V2a1ANiuOurWxkTCmkkt7N6bPJeWxmGn7sztHWdDaygg62UUFhdJXzOT43rRBTw5xJ1_VrOVGQQ_J86u2noeTSi0sHBO4HYhAfbkE5xng6ijGAKPy/s1600/WiNode+5+Underside.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhONmP7AjQduBK3L8qUEs_V2a1ANiuOurWxkTCmkkt7N6bPJeWxmGn7sztHWdDaygg62UUFhdJXzOT43rRBTw5xJ1_VrOVGQQ_J86u2noeTSi0sHBO4HYhAfbkE5xng6ijGAKPy/s320/WiNode+5+Underside.jpg" width="310" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>The microSD card socket is added to the underside of the pcb.</b></td></tr>
</tbody></table>
<br />
And a final word from our sponsors..... <a href="http://www.ragworm.eu/" target="_blank">Ragworm</a> provided additional boards at no extra charge and couriered them over in time for some weekend fun, as my job is putting the first few boards together.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb_J4ORCElxzMOQpp-NJBIdzT2zdXWLu0JlRvtvE_krKi4FKnt1XpvTcrBzYTStGlGE94Ascf3cbRQcR3BferJUeRn0LlbibiQFP1iVuMyF2mXIDSEz-d3H2g3rTbljLl7zrTA/s1600/fragworm_wl.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="166" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb_J4ORCElxzMOQpp-NJBIdzT2zdXWLu0JlRvtvE_krKi4FKnt1XpvTcrBzYTStGlGE94Ascf3cbRQcR3BferJUeRn0LlbibiQFP1iVuMyF2mXIDSEz-d3H2g3rTbljLl7zrTA/s320/fragworm_wl.jpg" width="320" /></a></div>
<br />
<br />
<br />Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-69637369721356838242016-02-17T22:58:00.000+00:002016-03-20T18:10:55.906+00:00Experimenting With New Devices - Part 2<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBUbXbVg-ktG3f5lCyejUn8NHhqWLV5lhA_I1BZY8gXNMHANQc42gMZidR-1_8HwXYNy3rM1IyvjnD80NGfMfb0LpHUk6EbAqY2bIdNFhG7fgZ7IlsTxzqA2sArT-nInYmu2Bn/s1600/5969LaunchPad.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBUbXbVg-ktG3f5lCyejUn8NHhqWLV5lhA_I1BZY8gXNMHANQc42gMZidR-1_8HwXYNy3rM1IyvjnD80NGfMfb0LpHUk6EbAqY2bIdNFhG7fgZ7IlsTxzqA2sArT-nInYmu2Bn/s400/5969LaunchPad.jpg" width="290" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>The '5969 Launch Pad - an ideal experimenting platform for FRAM</b></td></tr>
</tbody></table>
<br />
In this post I look at ways in which to get the most performance out of a small computer system based around the MSP430FR5xxx with external serial RAM and FRAM.<br />
<br />
<b>MSP430 Performance</b><br />
<br />
The MSP430 being a 16 bit architecture is pitched performance-wise somewhere between AVR and ARM. <br />
<br />
If you are doing a lot of 16 bit maths operations, then it will be quicker than the AVR as these are single cycle operations on registers, rather than having to combine two 8 bit operations.<br />
<br />
<a href="http://www.ti.com/lit/an/slaa205c/slaa205c.pdf" target="_blank">This report compares execution time</a> and code size for a number of common microcontrollers, in particular comparing MSP430 with ARM and AVR.<br />
<br />
The speed up factor over an ATmega328 Arduino is as follows:<br />
<br />
Simple Maths 1.27<br />
FIR Analysis 3.29<br />
Dhrystone 1.83<br />
Whetstone 2.56<br />
<br />
Average 2.24<br />
<br />
When this is combined with a 24MHz clock - rather than the normal 16MHz clock on the Arduino the average speed improvement is approximately 3.35.<br />
<br />
Code execution is fastest from RAM, so an important speed improvement will be achieved by copying all commonly used code from FRAM to SRAM at initialisation time. This copying process is extremely fast with 1Kbytes of FRAM memory contents copied to SRAM in approximately 128uS.<br />
<br />
<b>SIMPL on the MSP430</b><br />
<br />
I tried SIMPL back in 2014 on a very low spec MSP430 value line device in a 20 pin DIL package with only 512 bytes of memory. The C code for SIMPL was compiled using the Energia IDE. There was no difficulty porting what had been an Arduino sketch to Energia - what runs under Arduino runs on an MSP430 under Energia, with zero or very little modification to the sketch. Only the lack of RAM on the MSP430G2553 device was a little problem.<br />
<br />
<b>Porting SIMPL to a FRAM Device.</b><br />
<br />
Boosted by the initial success with the MSP430 Launchpad, in getting a basic version of SIMPL to run, I decided to invest in a couple of FRAM based devices.<br />
<br />
First, I tried identical sketches on the ATmega328 and the MSP430FR5969. This was purely so that I could prove that they both ran as expected, and so I could compare the codesize and execution time for each implementation.<br />
<br />
For the same clock frequency of 16MHz, the MSP version used about 80% of the codesize and executed simple loops containing integer maths at about 25% improved time.<br />
<br />
It was now time to reduce the Arduino supplied UART routines (Serial.xxx) to self coded putchar, getchar and printlong. This process removed 2200 bytes of code from the implementation - down to 3720 bytes from a starting point of 5920.<br />
<br />
The other large chunk of code is the array allocated to holding the initial word definitions. This is a 26 x 48 character array (1248 bytes) - which when removed brings SIMPL down to about 2472 bytes.<br />
<br />
The other thing I noticed was that whilst the UART routines take just less than 300 bytes to implement, when they are combined with setup(), the whole thing bloats out to about 640 bytes. This needs further investigation because without this bloating, SIMPL could reside in just 2Kbytes of memory.<br />
<br />
<b>Making Use of the FRAM.</b><br />
<br />
The question now is what new features can SIMPL leverage off the back of the MSP430's FRAM?<br />
<br />
The write speed of FRAM is well matched to the higher baudrates of the USB to serial converter. Instead of 9600, we can now upload source code at 921600 baud or higher. Using a hex file format, a full 16Kbytes of code could be sent over the serial link in about 0.25 seconds.<br />
<br />
The FRAM may be written to at 125nS per 16 bit word, so the whole FRAM storage space could be updated in about 1 milisecond.<br />
<br />
The 10 bit ADC could send data back to the PC at almost 100ksps.<br />
<br />
Execution from RAM is 3 times faster, so the primitives and the SIMPL kernel are loaded from flash into RAM during initialisation.<br />
<br />
The MSP430 has a 20 bit address space, so up to 64 blocks of code could be swapped into FRAM when required.<br />
<br />
Off chip storage could be uSD card or even serial FRAM - such as the <a href="http://www.mouser.co.uk/ProductDetail/Cypress-Semiconductor/FM25V20A-G/?qs=sGAEpiMZZMtsPi73Z94q0NgxFDRNs5jAFWc8uJcmBTA%3d" target="_blank">Cypress 25LV20 </a> which is a 256Kx8 SPI FRAM device in an 8 pin SOIC package. The SPI bus runs at a maximum of 10Mbit/s - so a "block load" of 1Kbytes is approximately 1mS or the time to load a full 16K block from external FRAM via SPI is 14mS. This is effectively 1uS access time to a large non-volatile solid state drive.<br />
<br />
For faster access either dual SPI or Quad SPI would need to be employed. This can be done using bit-banging techniques using quite elementary code.<br />
<br />
See the <a href="http://ww1.microchip.com/downloads/en/AppNotes/00001791A.pdf" target="_blank">Microchip App Note AN1791</a> for details. A datarate of 8Mbyte/s should be achievable. This would allow the 23LC1024 to be fully read in about 16mS.<br />
<br />
To be continued...... soon<br />
<br />
<br />
<br />
<br />
<br />Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0tag:blogger.com,1999:blog-16736699.post-60956554361477804182016-02-17T22:04:00.002+00:002016-03-20T18:10:55.903+00:00Experimenting with New Devices - Part 1If you were to summarise the developments in microcontrollers over the last few years, you might suggest the movement to 32-bit, mainly through ARM devices, and the rise in open source hardware and software.<br />
<br />
Another less well known development is the incorporation of Ferroelectric RAM or FRAM as an alternative to flash memory in the Texas Instruments (TI) range of MSP430 microcontrollers.<br />
<br />
Using FRAM instead of Flash memory opens up some interesting possibilities:<br />
<br />
FRAM is non-volatile - it retains it's content after power down<br />
It is low power - it can be programmed at low voltages<br />
It has a fast write speed - up to 8Mbytes per second - about 100 times faster than flash<br />
It can be used repeatedly like RAM - it does not wear out after some 10,000 cycles like Flash<br />
<br />
Whilst I did gain some experience of the MSP430 some 12 years ago, the introduction of FRAM and modernised peripherals makes them an attractive proposition. <br />
<br />
So I decided to invest a little time and money in exploring the new architecture and the new opportunities presented by FRAM technology.<br />
<br />
This post and subsequent posts will look at these topics and make a comparison between the more familiar AVR and ARM based devices. <br />
<br />
<b>MSP430 Family.</b><br />
<br />
The MSP430 is a 16-bit RISC type microcontroller, with a Von Neuman architecture. This is unusual for microcontrollers (most are Harvard architecture), as it combines both the instruction store and the data store into one unified memory area.<br />
<br />
It arose from an early 1990's devices, which was an 8 bit processor, the TSS400-S2, for interfacing to sensors. This <a href="http://www.farnell.com/datasheets/84067.pdf" target="_blank">early datasheet</a> gives some insight into the heritage from 25 years ago.<br />
<br />
The memory architecture is further simplified, as the FRAM and SRAM blocks can essentially be treated as the same codespace for program execution, although execution from RAM is at up to 24MHz, whereas executing from FRAM is limited to 8MHz.<br />
<br />
<b>Energia - "Arduino" for the MSP430</b><br />
<br />
The MSP430 range has been supported with low cost "Launch Pad" development boards since 2010, providing an alternative to the AVR or ARM based Arduino or mbed boards. This support extends to the open source Energia IDE project - which is essentially an Arduino compatible IDE (and lookalike) aimed at the various TI microcontroller families. With Energia you can take an existing Arduino sketch and run it directly on MSP430 hardware, with no or few changes. Arduino is certainly becoming a lingua-franca of these small dev-boards.<br />
<br />
<br />
<b>A look at the MSP430 FRAM devices</b><br />
<br />
The two devices I wanted to explore are the MSP430FR57xx series and the MSP430FR59xx series. The <a href="http://energia.nu/pin-maps/guide_msp430fr5739/" target="_blank">MSP430FR5739</a> is available as as an Experimenter board - below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgio91Q7MH58MTniKIyiDnLa8fHdqMBIeMBjv3kxvze-F1wATYOn5XmyQiVuPmu_1V6-5JcrD3kK-1dVfPoFcUh2rAVsxySJg-ebKQ3zRZ3KBZRPLTEOD3tRT8reBiat6r_RjJn/s1600/5739devboard.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="460" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgio91Q7MH58MTniKIyiDnLa8fHdqMBIeMBjv3kxvze-F1wATYOn5XmyQiVuPmu_1V6-5JcrD3kK-1dVfPoFcUh2rAVsxySJg-ebKQ3zRZ3KBZRPLTEOD3tRT8reBiat6r_RjJn/s640/5739devboard.jpg" width="640" /></a></div>
<br />
<br />
The FR57xx series is the smaller of the two with 16Kbytes of FRAM and 1Kbytes of RAM and a maximum clock of 24MHz. It costs about £1.50 in 1off from <a href="http://uk.farnell.com/texas-instruments/msp430fr5739idar/mcu-16bit-fram-msp430-24mhz-tssop38/dp/2325741" target="_blank">Farnell</a> and has the potential as being an alternative to Arduino (Nano beater) - with very few other system components required. It has 30 GPIO lines which makes it a very good fit for the WiNode 5 format pcb with the extended Arduino headers. Available in a 38pin TSSOP package, which makes it a little easier for home construction.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdHZcSZnNKWqGAwqFn-2UUoi2KyhQamLTZ93JkMVI15rCXiLAUwqNII6ykURmfvHRwbxHpdfir7PlZU7b7E-75BkNEIfNrdxQ7yY8Ibvu98fHGnfsHU9D2_du3jgtKO6Pp8k2i/s1600/5969LaunchPad.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdHZcSZnNKWqGAwqFn-2UUoi2KyhQamLTZ93JkMVI15rCXiLAUwqNII6ykURmfvHRwbxHpdfir7PlZU7b7E-75BkNEIfNrdxQ7yY8Ibvu98fHGnfsHU9D2_du3jgtKO6Pp8k2i/s400/5969LaunchPad.jpg" width="290" /></a></div>
<br />
<br />
The FR5969 has 64kB of FRAM, 2K of RAM and a 16MHz clock.<br />
<br />
It offers 40 GPIO pins, plus the ability to use both high frequency (16MHz) and low frequency (32768Hz) crystals.<br />
<br />
It comes in 40 pin QFN and 48pin QFN packages. A slightly smaller device- with marginally less I/O, the '5959 is available in a 38 pin TSSOP, making it compatible with the '57xx parts but with the beneffit of 64K FRAM and 2K RAM<br />
<br />
The MSP430FR5969 is available as the <a href="http://energia.nu/pin-maps/guide_msp430fr5969launchpad/" target="_blank">MSP-EXP430FR5969</a> as a Launch Pad board - for about <a href="http://www.mouser.co.uk/ProductDetail/Texas-Instruments/MSP-EXP430FR5969/?qs=sGAEpiMZZMurtJ7VwBTl0WTeviemQhvwq18O9p9iCgE%3d" target="_blank">£12 from Mouser.</a> This is exceptionally good value, and it has a number of accessory shields available.<br />
<b><br /></b>
<b>Basic Features.</b><br />
<b><br /></b>
16 bit Von Neuman RISC architecture with 16Kbytes / 64Kbytes FRAM<br />
16MHz (24MHz *) clock frequency<br />
1.8V to 3.6V operation<br />
100uA/MHz low power operation.<br />
0.25uA RTC<br />
Multiple low power modes of operation<br />
32 bit hardware multiplier<br />
Choice of 10 bit or 12 multichannel ADC<br />
2 UARTS, SPI, I2C<br />
5 Timers<br />
Low power oscillator<br />
Optional external 32kHz crystal<br />
Optional HF Crystal<br />
16 bit CRC<br />
128 bit/256 bit AES Encryption/decryption processor<br />
31, 33 or 40 GPIO lines depending on package.<br />
Available in 38 pin TSSOP, 40QFN, 48QFN packages.<br />
<br />
* Whilst the data sheet says 16MHz, it is perfectly possible to get the digitally controlled oscillator DCO to run at 24MHz. This might be good for a "Turbo-Boost" mode - when power is available.<br />
<br />
<a href="http://www.ti.com/lit/ds/symlink/msp430fr5969.pdf" target="_blank">Datasheet is here.</a><br />
<br />
<b>Tools & Equipment</b><br />
<br />
The Launch Pad and Experimenter boards come with an on-board programmer section, which allows a hex file to be programmed into memory and allows debugging.<br />
<br />
The TI Code Composer compiler and tool chain is distributed free of charge for working with these small boards.<br />
<br />
If you want to try an open source compiler there is<a href="https://sourceforge.net/projects/mspgcc/" target="_blank"> MSPGCC</a>, and if you are seriously into command line hardcore development , you could try <a href="https://www.mikekohn.net/micro/naken_asm.php" target="_blank">Michael Kohn's naken_asm</a> which is a cross assembler for a wide variety of microcontrollers.<br />
<br />
There are several free tools for loading the hex file into the MSP430. One that I tried is Elprotronics <a href="https://www.elprotronic.com/productdata" target="_blank">FET Pro-430 Lite</a> which worked well with the on-board eZ-FET programmer on the launch pad board.<br />
<br />
With the above tools I managed to flash a LED using assembly language and also drive a port line at about 2.5MHz square wave.<br />
<br />
<b>In Summary & Conclusion</b><br />
<b><br /></b>
The MSP430 are a fascinating family of microcontrollers. They have utilised every trick to achieve flexibility and very low power operation. The clocking and low power modes are a study in their own right - but TI through their Launch Pad series of dev boards have made a feature of low power operation - and encourage users to measure the operational current under various modes of working.<br />
<br />
Not only is it a 16 bit machine, but it has a universal storage space - both code and data in one memory - which is all the more interesting for being non-volatile, high speed FRAM.<br />
<br />
Although a RISC machine, the ISA is surprisingly versatile with a rich set of instructions and addressing modes.<br />
<br />
Just exploring a new instruction set is fun in itself.<br />
<br />
The 16 bit architecture is an ideal platform for developing Forth like languages - as these are often based on a 16 bit virtual machine. <a href="https://gitlab.com/Jean-Michel/FastForthForMSP430fr5xxx" target="_blank">Jean-Michel Thooren's "Fast Forth"</a> written in assembly language for the MSP430FR5969 may be of interest to Forth Fans.<br />
<br />
Here is a very interesting device - it has a 16 bit architecture, 12 bit A to D and a Von Neuman architecture. It reminds me a bit of the PDP-8. More exploration needed.<br />
<br />
In Part 2 I'll be looking at porting some existing code to the MSP430 and leveraging some Arduino sketches using Energia.<br />
<br />
<br />Ken Boakhttp://www.blogger.com/profile/01168707285621954181noreply@blogger.com0