tag:blogger.com,1999:blog-8650071347332734392024-02-02T00:40:10.595-05:00Sensicomm LLC - Signals, sensors, commsI'm a consultant in the field of digital signal processing.
This blog contains comments related to my work.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.comBlogger46125tag:blogger.com,1999:blog-865007134733273439.post-57784870363279741672017-07-13T17:59:00.000-04:002017-07-13T17:59:34.395-04:00Local 3D printing optionThis is somewhat offtopic, but I have a few Palm foldable keyboards sitting around that I would like to make use of. First problem: the keyboard uses a proprietary 10-pin connector. Solution: download a cad file from <a href="https://github.com/cy384/ppk_usb">github.com/cy384/ppk_usb</a> and 3D print it. Second problem: I don't own a 3D printer, so how do I print it?<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjccHy2VeJxT14eVDM6-RojkTluKHnW_NCAKYiK3nRTfjBiOo99G4NZ8CvVC2fi4x0-qddQ-v0NHtiypHrj8NM6UfNgExpIBioZCu3CkMZSs2PGFApyI07w8-Kk7eNwMNMOQJr30HB5Pug/s1600/library_printer.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="530" data-original-width="570" height="185" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjccHy2VeJxT14eVDM6-RojkTluKHnW_NCAKYiK3nRTfjBiOo99G4NZ8CvVC2fi4x0-qddQ-v0NHtiypHrj8NM6UfNgExpIBioZCu3CkMZSs2PGFApyI07w8-Kk7eNwMNMOQJr30HB5Pug/s200/library_printer.jpg" width="200" /></a></div>
I found that our local library <a href="http://rodgerslibrary.org/">(rodgerslibrary.org</a>) has a 3D printer, and will print things for 10 cents per gram. The cost of printer filament alone often runs 2-3 cents per gram, so that's a really good price. It's a <a href="http://www.tki3d.com/">TKI 3D</a> printer, and they have a selection of PLA filament in various colors. To use it, I converted the cad file to .stl, and took it to the library on a USB stick, where Linda processed it and set up the printer. Library personnel do all the actual handling of the printer - no gefingerpoken by the lookenspeepers. This object was about 2 grams, so it cost me all of 20 cents to get it printed. It took about 25 minutes - could have been faster, but she decided to run the printer at low speed for something this small. It's a library, so there's plenty to look at while waiting.<br />
<br clear="all" />
<br clear="all" />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7xLZ4_1hMB25KByQZx0_-QyTXz4xYdllFq0pTmmsHbQQ2rMOd3Aln9IsihjgQtDnOeca-e5YSAwF-0bNmRavhjrms8j9jDl18AJVo-EI-Pn2IXx6KFuO7Mq6VKAD2tT59RgUffsKzjdg/s1600/palm-V-adapter.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="332" data-original-width="509" height="130" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7xLZ4_1hMB25KByQZx0_-QyTXz4xYdllFq0pTmmsHbQQ2rMOd3Aln9IsihjgQtDnOeca-e5YSAwF-0bNmRavhjrms8j9jDl18AJVo-EI-Pn2IXx6KFuO7Mq6VKAD2tT59RgUffsKzjdg/s200/palm-V-adapter.png" width="200" /></a></div>
First step was to download the appropriate cad file from cy384's github site. It's designed in openscad, which is in the Debian repository, so I installed that. Importing the *.scad file and exporting an .stl file took only a few seconds. The longest dimension is about 3 cm.<br />
<br clear="all" />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifF14sj9kRbR3S27UcVJgVh8AI1IHHBFrt83-ac2KsNhDlRpw42CHSWNnA4GYiO8TbXQ7kE_pIbLkknZ9ltZcRx3W_1PcB2eavd_gtBAq31OQ77blGNbgv28w4bhuJUzFhlIZMW_TaBww/s1600/printedpart.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="357" data-original-width="621" height="114" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifF14sj9kRbR3S27UcVJgVh8AI1IHHBFrt83-ac2KsNhDlRpw42CHSWNnA4GYiO8TbXQ7kE_pIbLkknZ9ltZcRx3W_1PcB2eavd_gtBAq31OQ77blGNbgv28w4bhuJUzFhlIZMW_TaBww/s200/printedpart.jpg" width="200" /></a></div>
And here's the finished product, with a penny for size reference. The object is flipped in this photo: the front in the openscad screenshot is the back in this photo. The printer software automatically added the panel so it would stick to the base while printing, and it added the supports so the ears could be printed properly.<br />
<br clear="all" />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2_8u9_3YpjmrWiqEZ8LNkIGEllWtvIrZ6uBoYyouJDozj81GzlrVw10OSZzNRmyixnpbgUWNWfIJNC7KNdwV5gQHMdiCqHqqG8-lRxnkUOGq4SwbULha6ssRnhQb7hWghq3A5wYK6ZEQ/s1600/plugjack.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="426" data-original-width="636" height="133" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2_8u9_3YpjmrWiqEZ8LNkIGEllWtvIrZ6uBoYyouJDozj81GzlrVw10OSZzNRmyixnpbgUWNWfIJNC7KNdwV5gQHMdiCqHqqG8-lRxnkUOGq4SwbULha6ssRnhQb7hWghq3A5wYK6ZEQ/s200/plugjack.jpg" width="200" /></a></div>
Here it is sitting on the keyboard connector after a little bit of trimming with a sharp knife.<br />
<br clear="all" />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBLmcK5RuL_ne41oeeuGIWPihW-0ORA0Swh_qTIbWv3D-YfmQr7zHHPhJeaaLqDfMcIfPAp2F2dQLUsT0a0COn1E6YvJR7BRuj9EzIXS9qudylWRNjQvVPlrF2rhWiI8p09dX8C9VCuTY/s1600/plugged.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="259" data-original-width="408" height="126" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBLmcK5RuL_ne41oeeuGIWPihW-0ORA0Swh_qTIbWv3D-YfmQr7zHHPhJeaaLqDfMcIfPAp2F2dQLUsT0a0COn1E6YvJR7BRuj9EzIXS9qudylWRNjQvVPlrF2rhWiI8p09dX8C9VCuTY/s200/plugged.jpg" width="200" /></a></div>
And here it is fully plugged in. Fits snugly and perfectly, so the design was good, and the printer did its job well. Next step is to wrap wires in the slots to make contact with the pins, and then I can start working on the software.<br />
<br />
<br clear="all" />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxbyCuLgJb8kEHmDCTZLcfL5OrW_9LxkJ8nG00zjvWKAjez-5QnPTFDAmnJ4zJSbcfHJtw0kT_F4JXl1bmVxA63XJSQKkh7XAVaaRFu8TqO5XQ8PjkgJ3r3f5BxexFm7pil_NVQnuoLGI/s1600/library_spools.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="255" data-original-width="345" height="147" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxbyCuLgJb8kEHmDCTZLcfL5OrW_9LxkJ8nG00zjvWKAjez-5QnPTFDAmnJ4zJSbcfHJtw0kT_F4JXl1bmVxA63XJSQKkh7XAVaaRFu8TqO5XQ8PjkgJ3r3f5BxexFm7pil_NVQnuoLGI/s200/library_spools.jpg" width="200" /></a></div>
So if you're within driving distance of the Hudson, NH library and have an occasional need for 3D printing, it's a great resource. They have a shelf full of PLA filament in various colors. Check the library website for days and times the printer is available. The librarian did say they only run the printer when the library is open, so make sure your print jobs take less than 12 hours.<br />
There's only one machine and printing takes a long time, so there might be a queue. I went in on a Monday night and there was no wait - your mileage may vary.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-29216107333775283672016-11-17T16:25:00.000-05:002016-11-17T16:25:30.002-05:00STM32F042 USB quirks with libopencm3<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgz8b34BFRE2HRvbZSTVOe5aJOBpW9C4y5DbIXEuIoF1ivuUvzXkY9zcmZrW8TMyUnz7vPFVipNXUfTxKhGSKDkxKbr7VJtvETDvS1ebHHJZPhU5EUcpq_0XObRl8OKcUYb8gmQGUvky2I/s1600/x.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="138" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgz8b34BFRE2HRvbZSTVOe5aJOBpW9C4y5DbIXEuIoF1ivuUvzXkY9zcmZrW8TMyUnz7vPFVipNXUfTxKhGSKDkxKbr7VJtvETDvS1ebHHJZPhU5EUcpq_0XObRl8OKcUYb8gmQGUvky2I/s320/x.jpg" width="320" /></a></div>
Needed a simple microntroller for an RF project, so picked the STM32F042F6P6 from ST. It's cheap, comes in a 20-pin package, and has a built-in full speed USB device interface. It has an internal oscillator that can be synced to the USB signals from the host, so it doesn't even need a crystal.<br />
It has a built-in DFU bootloader (among other programming options), so it requires no additional hardware to load the program.
<br />
After getting a simple LED blinker program to run, I decided to run some USB demo programs from the LIBOPENCM3 package. None of the demos are for this exact chip, but some are for the STM32F072, which is similar. Tried the <code>tests/gadget-zero</code> sample and ... No Go. The program loads and the LED's blink, but the USB device does not show up.<br />
Turns out, there are a couple of subtle differences between this chip and the ones in bigger packages<br />
<ul>
<li>The USB interface pins are shared with two other pins, and by default the USB pins are not connected to the outside world. Need to set a configuration bit so they can be used.</li>
<li>The peripheral clock needs to be turned on for the SYSCFG subsystem. I'm not sure whether that's a difference in the chips, or a quirk in libopencm3, but it's needed.</li>
</ul>
The setup calls at the beginning of the program for crystal-less USB operation are:<br />
<blockquote class="tr_bq">
<pre><code>rcc_clock_setup_in_hsi48_out_48mhz();<span style="background-color: #f6b26b;">
rcc_periph_clock_enable(RCC_SYSCFG_COMP);
SYSCFG_CFGR1 |= SYSCFG_CFGR1_PA11_PA12_RMP;</span>
crs_autotrim_usb_enable()
rcc_set_usbclk_source(RCC_HSI48)</code></pre>
</blockquote>
where the highlighted lines had to be added. With those two lines, gadget-zero shows up as a USB device in Linux. I was also able to the a cdc_acm demo working.<br />
<h4>
Acknowledgments</h4>
Several websites mention the pin-remapping issue, but the IFUSB project (<a href="https://github.com/julbouln/ifusb">github.com/julbouln/ifusb</a>) was where I found the clock-enable issue and solution. IFUSB looks like a nice little peripheral, by the way.<br />
Libopencm3 is at <a href="https://github.com/libopencm3/libopencm3">github.com/libopencm3/libopencm3</a><br />
For programming, I use dfu-util: <a href="http://dfu-util.sourceforge.net/">dfu-util.sourceforge.net</a>. It's already included in Debian and probably other distributions.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-9258496932966159612016-09-28T12:19:00.001-04:002016-09-28T12:19:40.423-04:00Offtopic: phone scam<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dwxbmt1lN-UqGsCA2xglm9y5abHMij8Dgx8TV6zNWn2bJVPCwqM__s6uqRTaF0g3MH9uGgKZcP-XCCCKeOhLA' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
<b><span style="font-size: small;"><span style="background-color: #ea9999;">NOTE: the phone number below is what they said on the message. It might be fake, so whoever has that number might be totally innocent.</span></span></b><br />
<br />
This was interesting. I got a scam phone call this morning. My best attempt at a transcription as follows:<br />
<blockquote class="tr_bq">
<span style="background-color: #f9cb9c;">Hi, my name is Keith Jordan, and this message is intended to contact you regarding an enforcement action executed by the United States Treasury,</span><br />
<span style="background-color: #f9cb9c;">intending your serious attention. </span><br />
<span style="background-color: #f9cb9c;"> </span><br />
<span style="background-color: #f9cb9c;">Ignoring this will be an intentional second attempt to avoid initial appearance before a magistrate judge or a grand jury for a federal criminal offense.</span><br />
<span style="background-color: #f9cb9c;">My number is 817 533 9843</span><br />
<span style="background-color: #f9cb9c;">I repeat it's 817 533 9843</span><br />
<span style="background-color: #f9cb9c;">I invite you to cooperate with us and help us to help you.</span><br />
<span style="background-color: #f9cb9c;">Thank you.</span></blockquote>
I recorded this to my computer by holding the phone in front of the microphone while playing back the message, and then merging the audio with a photo of the caller id using:<br />
<span style="background-color: #cfe2f3;">ffmpeg -i /tmp/x.jpg -i scam.wav -acodec copy /tmp/simple.mov</span><br />
I can display and play the result using mplayer on Debian Linux, not sure how it works anywhere else.<br />
<br />
Us Treasury says to report this sort of thing:<br />
<a href="https://www.treasury.gov/services/report-fwa/Pages/Report-Email-Scams.aspx">www.treasury.gov/services/report-fwa/Pages/Report-Email-Scams.aspx</a><br />
We'll see what happens.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-6472682092479415572016-08-22T15:17:00.000-04:002016-08-22T15:17:01.026-04:00Presentation: Codecs for Land Mobile Radio<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDDC9xDsHIlBuyvYsOUY9XajJrtLt72_XCPWevFGU9AmRplKblooxf3spS72Mhyphenhyphenz-O_n_F5GmeIVj1zuYNTjBbV9jN5rngdz0PjhnN6siNe1GOT_boIeN6lcAHO7O5lZ79bMj7D11ECJU/s1600/crop3704_33.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDDC9xDsHIlBuyvYsOUY9XajJrtLt72_XCPWevFGU9AmRplKblooxf3spS72Mhyphenhyphenz-O_n_F5GmeIVj1zuYNTjBbV9jN5rngdz0PjhnN6siNe1GOT_boIeN6lcAHO7O5lZ79bMj7D11ECJU/s1600/crop3704_33.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Marina in front of Wentworth on the Sea.</td></tr>
</tbody></table>
On August 19 2016 I presented a talk to the "Enhanced Digital LMR Seminar" at Wentworth on the Sea, New Castle, NH (near Portsmouth).<br />
<br />
The talk is an overview of speech codecs and their application in digital Land Mobile Radio systems. It's intended for an audience of radio system users and specialists rather than voice codec experts. <br />
<br />
Slides for the presentation are online at:<br />
<a href="https://joe1505.github.io/talks/index.html">joe1505.github.io/talks/index.html</a>Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-113327964790028192016-02-23T13:36:00.000-05:002016-02-23T13:36:16.889-05:00Mobile-friendly web pageDecided it's time to make my websites mobile-friendly, since Google seems to consider that important these days. So I ran the tester at<br />
<ul>
<li><a href="https://www.google.com/webmasters/tools/mobile-friendly/">https://www.google.com/webmasters/tools/mobile-friendly/</a></li>
</ul>
which identified about 30 errors, including "Links too close together" and "Text too small to read" on multiple items. The latter error is particularly interesting because I typically use not-too-fancy html+css, and I <i>don't set the font size anywhere</i>. One of the main features of html is the separation of content and presentation, so decently written html should not require much tweaking for different displays. The html markup tells what things are, and the browser should be able to figure out a reasonable way of displaying those things.<br />
<br />
After a little digging, I found the first step in mobilifying a web page is to add the magic incantation:<br />
<ul>
<li> <code><meta name=viewport content="width=device-width, initial-scale=1"></code></li>
</ul>
to the <head> section of the html file.<br />
<br />
As it turns out, that's the last step as well: All the other error messages went away when I added that one line. As I understand it, that line basically tells the browser "just use html the way it's intended to be used" and then everything is fine.<br />
<ul>
</ul>
Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-27070033088194020992016-02-23T12:13:00.001-05:002016-02-23T12:13:49.560-05:00Reorganizing this blog.I decided it's time to reorganize the domain name setup for this blog. Previously, it was accessible via two web addresses:<br />
<ul>
<li><a href="http://blog.sensicomm.com/">blog.sensicomm.com</a> </li>
<li><a href="http://sensicomm.blogspot.com/">sensicomm.blogspot.com</a> </li>
</ul>
One side effect of this setup is that the blog's cookies are set up under my sensicomm.com domain. I decided that I don't like the idea of scripts that I didn't write and don't control running under the identity of a domain that I do control.<br />
<br />
So in the new setup this blog is still accessible and will appear unchanged using the blogspot address. The sensicomm address contains static copies of all previous postings, but not any comments made on those postings.<br />
<br />
If you have a web site containing a like to an old blog post, you might want to update the link. For example,<br />
<ol>
<li><a href="http://blog.sensicomm.com/2015/09/pebble-watch-programming.html">http://blog.sensicomm.com/2015/09/pebble-watch-programming.html</a></li>
<li><a href="http://sensicomm.blogspot.com/2015/09/pebble-watch-programming.html">http://sensicomm.blogspot.com/2015/09/pebble-watch-programming.html</a></li>
</ol>
The old address of this post[1] now points to the static copy of that post, while the new address[2] contains both the post and any comments.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-53554661150379889322015-10-29T11:23:00.002-04:002015-10-29T11:23:35.209-04:00Lattic iCEcube2 on DebianI recently started looking at Lattice chips for a project that needs a fairly small FPGA. They have small devices that are significantly lower in cost than the larger Xilinx Spartan chips I've used in the past. To explore further, I ordered the ICE40HX1K eval board ($22) and downloaded the free iCEcube2 IDE for my Debian stable(Jessie) 64-bit PC.<br />
The first try at installing the IDE hit issues:<br />
<span style="font-family: "Courier New",Courier,monospace;">error while loading shared libraries: libXext.so.6: cannot open shared object file: No such file or directory</span><br />
The library is installed, so obviously the IDE wants the 32-bit version. I haven't tried to work with 32-bit stuff since Debian went to the multiarch approach, so that led to a new learning experience. Previously one would install ia32 versions of the needed libraries. After a bit of googling, I found that the current approach is (as root, or using sudo):<br />
<span style="font-family: "Courier New",Courier,monospace;">dpkg --add-architecture i386</span> # Include 32-bit stuff<br />
<span style="font-family: "Courier New",Courier,monospace;">apt-get update</span> # Add in the lists of 32-bit packages.<br />
<span style="font-family: "Courier New",Courier,monospace;">apt-file search libXext.so.6</span> # Find out what package I need - libxext6 in this case.<br />
<span style="font-family: "Courier New",Courier,monospace;">apt-get install libxext6:i386</span> # Add the 32-bit version of thepackage.<br />
Now, the install fails because it's missing <span style="font-family: "Courier New",Courier,monospace;">libpng12.so.0</span>, so repeat the <span style="font-family: "Courier New",Courier,monospace;">apt-file search</span> and <span style="font-family: "Courier New",Courier,monospace;">apt-get install</span> steps for that. In Total I ended up installing <span style="font-family: "Courier New",Courier,monospace;">libpng12-0:i386, libsm6:i386, libxi6:i386, libxrender1:i386, libxrandr2:i386, libxfixes3:i386, libxcursor1:i386, libxinerama1:i386, libfreetype6:i386, libfontconfig1:i386, libglib2.0-0:i386.</span><br />
With that, iCEcube2 installs and runs.<br />
<br />
Now I can start playing with the eval board when it shows up.<br />
<br />
<br />
<h4>
Notes:</h4>
<a href="https://hackaday.io/project/6592-dipsy/log/24272-installing-icecube-2-on-ubuntu-14042-lts">hackaday.io/project/6592-dipsy/log/24272-installing-icecube-2-on-ubuntu-14042-lts</a> Pointed me in the right direction to complete the install. Their Dipsy project uses the Lattice chip, and looks interesting.<br />
<br />Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com1tag:blogger.com,1999:blog-865007134733273439.post-31575641380954551782015-10-05T11:32:00.003-04:002015-10-05T11:34:12.732-04:00Pebble watch programming to extend battery life.<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihEyRxwuhPl7mpASGwfSvJVbc3sC1jUcF9qHP4WV_WFjY6uKceQgbjQfWSuCFoEH7R6Mg_nDdiTgDhzCdPlpksCP17LKlwlpkOG3QpXixM2L5PM7KZsbX3opyQZdpmlRLKwkj25IFJFRU/s1600/battlevel.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihEyRxwuhPl7mpASGwfSvJVbc3sC1jUcF9qHP4WV_WFjY6uKceQgbjQfWSuCFoEH7R6Mg_nDdiTgDhzCdPlpksCP17LKlwlpkOG3QpXixM2L5PM7KZsbX3opyQZdpmlRLKwkj25IFJFRU/s1600/battlevel.png" /></a></div>
These are my observations to date on battery life with the Pebble classic watch. I figure the data will be of interest to other watch face developers. <br />
<br />
For my own Pebble watchface I wanted:<br />
<ul>
<li>Simple digital display with seconds counter.</li>
<li>Show current date. </li>
<li>Large characters to be readable in poor light conditions.</li>
</ul>
Once it was running, I wanted to measure and optimize battery life. The watch reports battery state in 10% increments, so I track the level changes as a function of time.<br />
Pebble has some hints online at <a href="http://developer.getpebble.com/guides/best-practices/battery-perform-guide/">developer.getpebble.com/guides/best-practices/battery-perform-guide/ .</a> Basically, they say to do as little as possible when servicing the timer ticks, and minimize the portion of the screen that's updated.<br />
The plot here was obtained with the watchface shown in my previous post: <a href="http://blog.sensicomm.com/2015/09/pebble-watch-programming.html">blog.sensicomm.com/2015/09/pebble-watch-programming.html</a> . The green lines are the first version: I call the routines to update everything on the screen every second. For the blue line, I update the seconds display every second, but the rest of the display only updates every minute. For the red line, I update the seconds every second (obviously), the hour and minute update when the minute changes, and the day updates every hour. The short magenta line is like red, except I turn the backlight off (instead of auto) and turn the watch off at night. Bluetooth was off in all cases.<br />
Observations:<br />
<ul>
<li>The time from end-of-charging to 90% battery level varies widely, from a few minutes to many hours. My guess is that the battery keeps trickle charging even after the display shows charge is complete: the shortest times to 90% were when I took the watch off charge immediately, and the longest were when it was connected for an hour or so after the indicated completion of charge.</li>
</ul>
<ul>
<li>That said, minimizing unnecessary screen updates appears to make a significant difference in power use: an additional day or so before the battery drops to 40% remaining power.</li>
</ul>
<ul>
<li>I probably won't bother keeping the backlight off or turning the watch off at night: the savings don't seem that great and the inconvenience is significant.</li>
</ul>
<ul>
<li>The screen backlight was in auto mode: it comes on for a few seconds when the watch shakes. It did occasionally come on during all tests (except magenta). No sure how much difference it made. </li>
</ul>
Again, this is for the Pebble Classic; no idea how it works on other Pebbles.<br />
<br />Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-83942131749195361002015-09-22T14:33:00.000-04:002015-09-22T14:33:08.907-04:00Pebble watch programming.<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVQoLJAXkQ4JUmxJseSWORaPgQNv3W5jEa0brQZwVlILTqcGMRdCFDkUib9fNhWeLlerOVys_3UFpNji2FnHeVknlgdrIP-BAOW1hTLqgSgI0lecpMQ6mcknCoET6-IvVetKoIKSjQziw/s1600/x8.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVQoLJAXkQ4JUmxJseSWORaPgQNv3W5jEa0brQZwVlILTqcGMRdCFDkUib9fNhWeLlerOVys_3UFpNji2FnHeVknlgdrIP-BAOW1hTLqgSgI0lecpMQ6mcknCoET6-IvVetKoIKSjQziw/s1600/x8.jpg" /></a></div>
Time for a new watch. I chose the Pebble classic because I like the idea of a daylight-readable (e-paper) display and multi-day battery life between charges. The fact that several were available on ebay at good prices didn't hurt either.<br />
Yes, I do love the display. It's a crisp and clear monochrome, easily readable in sunlight. In the photo, you may notice a bit of "rainbow" effect to the left of the time and date. That seems to be a polarization effect: it's noticeable when wearing polarized sunglasses or with indirect illumination from a clear sky. In direct sunlight or artificial light the rainbows go away.<br />
<h3>
Programming </h3>
The watch has an ARM chip in it, so of course I have to develop my own watch face. Pebble has an online development platform, but I decided to install the SDK on my Debian PC. I got the SDK from <a href="http://developer.getpebble.com/sdk/">developer.getpebble.com/sdk/</a> and installed it per the instructions, which includes installing several libraries and python packages. A couple of notes:<br />
<ul>
<li>The "pip install -r requirements.txt" command takes a long time to run -- several minutes.</li>
<li>I did not install the Pebble-supplied ARM compiler: it requires a later version of glibc than I have installed. I already had a compiler installed<a href="http://blog.sensicomm.com/2014/02/stm32-on-linux-again.html"> (blog.sensicomm.com/2014/02/stm32-on-linux-again.html</a>), and it seems to work fine.</li>
<li>To tell the SDK where the existing compiler is:</li>
<ul>
<li>cd $HOME/pebble-dev/PebbleSDK-3.3/</li>
<li>ln -s /opt/gcc-arm-none-eabi arm-cs-tools</li>
</ul>
</ul>
And it works. I was able to compile a sample program using the "pebble build" command and install it using Bluetooth and an Android phone.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-25287354796536619742014-12-31T15:34:00.000-05:002014-12-31T15:34:59.051-05:00HDMI-VGA adapter for Raspberry Pi<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJbyAp2YQIF-aqIEdEtpbrR0Y8zrAOJE_ysqTdebWHNB2Av49FnKaOs2vz90VNrFWYW_FkX8lLdyFFKXlZe5nW9GylwDlxIgtCx0-OMAf9YFEPHhXhRQw-l5igijCLqXvO0yiP1wyDXPs/s1600/hdmi2vga.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJbyAp2YQIF-aqIEdEtpbrR0Y8zrAOJE_ysqTdebWHNB2Av49FnKaOs2vz90VNrFWYW_FkX8lLdyFFKXlZe5nW9GylwDlxIgtCx0-OMAf9YFEPHhXhRQw-l5igijCLqXvO0yiP1wyDXPs/s1600/hdmi2vga.jpg" /></a>This year Santa left an HDMI to VGA adapter under the christmas tree. I have an old LCD monitor with only a VGA input while the Raspberry Pi and Beagleboard/Beaglebone boards only have HDMI outputs.<br />
The specific adapter is under $10 from <a href="http://www.seeedstudio.com/">seeedstudio.com</a>, although I see a bunch of others on ebay and other sites that look similar.<br />
Setup on the Raspberry Pi was pretty easy - only one Google search. Had to edit the /boot/config.txt file to force the Pi to use the HDMI output and to set the screen resolution (both VGA and HDMI can report screen resolution back to the host, but it doesn't seem to happen with this setup).<br />
Configuration info was found at <a href="http://www.raspberrypi.org/forums/viewtopic.php?p=269212">www.raspberrypi.org/forums/viewtopic.php?p=269212</a>.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjECxkVnJqhrYsLAPkAZYrN4viXcRbd1fQ04UOeabzL-RGBAUhBDmhuFIjfIHIIHtVjSxbC1e52evvckhrvn8JLuqCwxwJVxuylxi2Gj2R5cXxPLlw-8qJTrUVHbJhfz_6eKRVX2cDKTes/s1600/3352crop.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjECxkVnJqhrYsLAPkAZYrN4viXcRbd1fQ04UOeabzL-RGBAUhBDmhuFIjfIHIIHtVjSxbC1e52evvckhrvn8JLuqCwxwJVxuylxi2Gj2R5cXxPLlw-8qJTrUVHbJhfz_6eKRVX2cDKTes/s1600/3352crop.jpg" height="265" width="320" /></a>Internally the adapter is just a Chrontel CH7101A chip to do the HDMI-VGA conversion, and an Everest Semiconductor ES7144LV audio output chip. My unit pulls about 180 milliAmps from the +5 volt output of the HDMI connector. That's way more than the 50 mA maximum (according to Wikipedia), but the Pi is driving it without any problems. I haven't tried the adapter with Beagles yet, but research so far indicates that they require an externally powered adapter because they can't supply enough current via HDMI.<br />
<span style="background-color: #ffe599;"><span style="color: #cc0000;">Caution: poking around inside will most likely void the warranty and might smoke the adapter and/or the Beagleboard. You're on your own if you try something like this:</span></span><br />
Interestingly, there's space on the lower right corner of the PCB for a USB connector as an alternate +5 input. I took out the zero-ohm resistor (R1, just to the left of the USB connector footprint), and brought out 3 wires: Ground, HDMI +5 out, and +5 power in. Now I can just connect the +5's together for the Pi and should be able to use external power for the Beagles.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjECxkVnJqhrYsLAPkAZYrN4viXcRbd1fQ04UOeabzL-RGBAUhBDmhuFIjfIHIIHtVjSxbC1e52evvckhrvn8JLuqCwxwJVxuylxi2Gj2R5cXxPLlw-8qJTrUVHbJhfz_6eKRVX2cDKTes/s1600/3352crop.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJbyAp2YQIF-aqIEdEtpbrR0Y8zrAOJE_ysqTdebWHNB2Av49FnKaOs2vz90VNrFWYW_FkX8lLdyFFKXlZe5nW9GylwDlxIgtCx0-OMAf9YFEPHhXhRQw-l5igijCLqXvO0yiP1wyDXPs/s1600/hdmi2vga.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<br />Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com1tag:blogger.com,1999:blog-865007134733273439.post-32519241381112990152014-11-13T17:08:00.000-05:002014-11-13T17:08:54.636-05:00Debian on BeagleBoard classic.I have one of the original beagleboards with the omap3 processor, which is ARM+DSP coprocessor. Originally it used the Angstrom Linux distribution, which uses bitbake to build the kernel and all related software tools. I saw recently that Debian is now supported on this device; I like to run Debian on everything including my PC's, BeagleBone Black, and Raspberry Pi (raspbian - almost Debian), so why not on the beagleboard as well?<br />
My hardware setup is a USB-serial adapter from a Linux (Debian, of course) host to the serial port of the Beagleboard. I also have a Sabrent USB-Ethernet adapter on the Beagleboard.<br />
The "official" instructions seem to be at <a href="http://elinux.org/BeagleBoardDebian">elinux.org/BeagleBoardDebian</a>, which I found from <a href="http://beagleboard.org/project/debian">beagleboard.org/project/debian</a>. Per those instructions, I downloaded the netinstall package from <a href="https://github.com/RobertCNelson/netinstall">github.com/RobertCNelson/netinstall</a> (using git of course), and put it on a 16GB SD card using the command:<br />
<pre>sudo ./mk_mmc.sh --mmc $SDCARD --dtb omap3-beagle --distro wheezy-armhf --firmware --serial-mode</pre>
On my PC I have SDCARD=/dev/sdb, because that's where the memory card shows up when it's plugged in. <span style="color: #990000;">MAKE SURE you get this right</span>, because you could wipe out a disk on the PC if you get it wrong. I decided to uses the --serial-mode option to work from the serial port and avoid any HDMI display issues.<br />
Moved the SD card from the PC to Beagleboard, powered up, and got a typical Debian install menu on the serial port! I used<br />
<pre>minicom -D /dev/usb/prolific2303 -b 115200 -o</pre>
to connect to the USB-serial port. The Beagleboard serial port does not use the modem control lines, so had to turn off the "Hardware Flow Control" and "Modem has DCD" options in minicom.<br />
The netinstall process was just like installing Debian on a PC: select some options and wait for it to download a bunch of packages. It found the Sabrent ethernet and used it with no problem; device usb0 shows up as a network device as well, so it should be possible to install by using a USB connection to the PC host, but I didn't try that.<br />
Finished the install, rebooted the Beagleboard, aaaannnd - nothing happened!!! Load process just stopped in uboot. After a few hours of screaming, hair-pulling, and spelunking in uboot macros, I found the problem:<br />
<span style="color: #274e13;">I had set up /boot as a separate partition.</span><br />
The uboot macros look for /boot/uEnv.txt on each partition and then boot Linux using that partition as the root partition. Made /boot a normal directory instead of a mount point, patched up /etc/fstab, and uboot brought up Debian with no problem.<br />
Did my usual Debian tweaks (<a href="http://sensicomm.blogspot.com/2013/01/my-debian-tweaks.html">sensicomm.blogspot.com/2013/01/my-debian-tweaks.html</a>) and everything seems to be working as expected.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-11389642292287957062014-08-22T11:44:00.000-04:002014-08-22T11:44:44.571-04:00Goats and Coffee<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwXZ8Y3UnIvPZfZPG-VZ5YMKKrWwJgEiRF75hA0ulEh8zwqFcZtCnbrdFpoqwE88SFfrsz_LC-ycP1VJb91eSt6FQRENHgQtaSQcKD2la5HLaJky1uWfjRJIdRgNHRwRC_m-8jRfhfITU/s1600/crop_2956_67.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwXZ8Y3UnIvPZfZPG-VZ5YMKKrWwJgEiRF75hA0ulEh8zwqFcZtCnbrdFpoqwE88SFfrsz_LC-ycP1VJb91eSt6FQRENHgQtaSQcKD2la5HLaJky1uWfjRJIdRgNHRwRC_m-8jRfhfITU/s1600/crop_2956_67.jpg" /></a></div>
OK, this post is way off normal topics. Last month my wife and I were part of a team that visited a non-government organization working on economic development in Guatemala. The project related to raising goats and fighting the coffee rust fungus that's been causing so many problems in Central America.<br />
I put together a writeup that gives more background on the problem and how it's being approached: <a href="http://www.rothweiler.us/guatemala-2014/index.shtml">www.rothweiler.us/guatemala-2014</a> .<br />
It's outside my area of expertise, but looks like an interesting approach that makes good use of local resources. Comments (positive or negative) from folks with more experience are welcome.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-22328237712930828512014-07-11T21:45:00.000-04:002014-07-11T21:45:48.999-04:00Parallel port jtag<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIZpDgVqgpH0UJrbnNpo7yaj7manY5VAxACGKA9YgEqo-ZQdTRdfUvONvz8ZlsQAC0PnLhADLtpnSGuseVjFnwi3-l5i4bSsTHIEHzcEAj265r7DBoZa39JulM5tmm7mgskrh-K_h07oo/s1600/thumb_i.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIZpDgVqgpH0UJrbnNpo7yaj7manY5VAxACGKA9YgEqo-ZQdTRdfUvONvz8ZlsQAC0PnLhADLtpnSGuseVjFnwi3-l5i4bSsTHIEHzcEAj265r7DBoZa39JulM5tmm7mgskrh-K_h07oo/s1600/thumb_i.png" /></a></div>
I've been using a homebrew version of the Xilinx DLC5 parallel port jtag adapter for programming my fpga boards. The DLC5 is no longer supported by Xilinx, but some Linux jtag programmers still support it.<br />
Recently I moved to a new PC, and my DLC5 hack no longer works with that parallel port. I can see on the scope that the right pins are moving, but the chip won't program. I suspect that either the rise and fall times are too slow, or there's noise on the signal lines.<br />
Anyway, I had a sample of the SiLabs si8663 digital isolator, so I decided it's time to build a new interface. The Si8663 is a hex isolator (3 signals each direction), that's spec'ed to operate up to 150 Mbps bit rate (WAY more than needed for this app). Another neat feature is that the drivers on each side work from 2.5 to 5.5 volts, providing a level shifter at no extra charge.<br />
Board is available on OshPark (www.oshpark.com) for anyone interested. Project name is "isopartag 140513". Circuit's simple: chip + 4 bypass caps on the bottom. The design includes resistors to tap power from unused pins of the parallel port, but they haven't been added yet, to that feature is untested. For now I just tap 5 volts from an unused keyboard or mouse port.<br />
<span style="font-size: large;"><b>Caution:</b></span>The Si8663 comes in two versions: a wide body for safety isolation, and a narrow body intended more for electrical noise isolation. I'm using the narrow version, and the board is not designed with wide separation between the input and output sides. In other words, this design is for <span style="color: #cc0000;"><span style="background-color: #ffd966;"><b>low voltages only, don't use it where safety is an issue.</b></span></span><span style="background-color: #e06666;"><b><span style="background-color: #ffd966;"><span></span></span></b></span>Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-20586732157271558772014-07-03T15:24:00.000-04:002014-07-03T15:24:28.309-04:00via-rhine in Debian WheezyThis blog post is only of interest to a small handful of people, but since you found it, it might be you :). As always with system changes, there's a chance of damage or data loss. So check your backups first.<br />
<br />
I have an old Averatec notebook that I use for travel and when I don't want to take risks with my main PC. I'm planning a trip so it's time to update to the latest debian distribution. After the update, everything seems to work, except the via-rhine wired ethernet.<br />
The symptoms appear similar to Debian bug report <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=708757">708757</a> . After a lot of hacking and experimenting, I finally upgraded to the latest kernel in wheezy-backports and the problem went away.<br />
<h4>
Details:</h4>
lspci shows the device as:<br />
00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II]
(rev 74)
<br /><br />
It does work with Debian kernel packages:<br />
linux-image-2.6.32-5-686 # Old, from previous Debian distribution.<br />
linux-image-3.14-0.bpo.1-686-pae # Very latest, bleeding edge.<br />
<br />
And does not work with<br />
linux-image-3.2.0-4-686-pae # debian stable kernel for my system.<br />
<h4>
Fix: </h4>
To get the very latest kernel, you need the backports repository. Best instructions I found were: <br />
<a href="https://scottlinux.com/2013/11/23/how-to-install-newer-kernel-from-debian-wheezy-backports/">scottlinux.com/2013/11/23/how-to-install-newer-kernel-from-debian-wheezy-backports</a><br />
Basically,<br />
1) add wheezy-backports to /etc/apt/sources.list<br />
2) apt-get update<br />
3) apt-get -t wheezy-backports install linux-image-3.14-0.bpo.1-686-pae<br />
4) done. reboot to use the new kernel.<br />
<br />
<h4>
Cleanup:</h4>
One side effect of the bug is that it returns a wrong and somewhat random MAC address for the ethernet controller. Recent versions of Debian try to ensure that each MAC address is always associated with a consistent eth* number. So each random mac address gets assigned to a new eth* number. If this is happening the output of dmesg will show messages like:<br />
<pre><code>udev: renamed network interface eth0 to eth7</code></pre>
Every time udev sees a new MAC address it adds it to <code>/etc/udev/rules.d/70-persistent-net.rules,</code><br />
so the fix is to edit that file and remove all the junk MAC addresses.<code><br /></code>Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-53277062313585959222014-06-30T09:02:00.001-04:002014-06-30T09:02:47.051-04:00Xilinx Spartan-3 I/O timing<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp0TEsHHfA8kWdLGaQHOyrVlQJc2fYr_g32s1agGaAiHEeajfzbHrONL9lFG5cxaQOGierrISi6tL94Kq-1Y_rZnsSbGVz65C7bIwrY-j1-W1rWZ-kH_Fqw3IrDAxg1rKOxNJmIfjvIX4/s1600/externclk.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp0TEsHHfA8kWdLGaQHOyrVlQJc2fYr_g32s1agGaAiHEeajfzbHrONL9lFG5cxaQOGierrISi6tL94Kq-1Y_rZnsSbGVz65C7bIwrY-j1-W1rWZ-kH_Fqw3IrDAxg1rKOxNJmIfjvIX4/s1600/externclk.png" /></a></div>
Working on updating the <a href="http://mhz100q.sourceforge.net/">MHZ100Q</a> project, and one significant design issue is I/O delay. To review, the Xilinx Spartan-3A FPGA generates a 100MHz clock using an internal DCM block, and this clock drives an external 100MHz A/D converter. The total delays through the output buffer, A/D clock to output pins, and FPGA input buffer add up to 9 to 16 ns, while the clock cycle time is 10 ns. So aligning the clock and data at the input latch is tricky.<br />
Per the A/D data sheet, the value on the output pins is stable for about 5ns (minimum) and the FPGA data sheet says the latches need about 1ns to capture the value (setup+hold times from the clock edge). So we have a 4 ns window in which everything will work right.<br />
It's hard to measure the actual offset at the internal latch input of the FPGA, so for initial setup I would like to be able to adjust the phasing of the A/D clock relative to the internal latch clock over the full 10 ns range.<br />
First option is to use the built-in delays. The *.ucf file supports the per-pin specifications IFD_DELAY_VALUE and IBUF_DELAY_VALUE which put variable amounts of delay between the input pin and the logic (the former applies when using the latch built-in to the I/O Block, and the latter applies when the I/O Block is just used as a buffer). Total adjustment range is about 2 ns, which might be enough.<br />
Next step up in complexity is to use the Digital Clock Module (DCM) to adjust the phase of the generated clock. The DCM can produce essentially any clock phase, but for this application, I think I can just use the 4-phase quadrature outputs. That gives me effectively 0 2.5, 5, 7.5 ns adjustment points, and combined with the IFD_DELAY_VALUE, I can get within 0.5 ns of any required timing offset.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-14562990890467606322014-03-03T15:43:00.003-05:002014-03-03T15:45:27.616-05:00WidgetsJust posted a couple of little designs: a switching power supply and a wideband preamp. Blank pcb's are available from Oshpark <a href="http://www.oshpark.com/profiles/sensicomm">www.oshpark.com/profiles/sensicomm</a> , and my documentation is at <a href="http://mhz100q.sourceforge.net/widgetries.shtml">http://mhz100q.sourceforge.net/widgetries.shtml</a> . Mostly for my own tests and experimentation, but others might find them useful.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-64644951953350056982014-02-13T11:46:00.000-05:002014-02-13T11:46:55.585-05:00STM32 on Linux, again.Starting another project using the STM32 micro, so time to update and reinstall the toolchain. This is an update to my previous post on the topic at <a href="http://blog.sensicomm.com/2012/01/stm32-stm32f4discovery-arm-eval-board.html">http://blog.sensicomm.com/2012/01/stm32-stm32f4discovery-arm-eval-board.html</a><br />
<br />
<h3>
Compiler</h3>
Previously I used the summon-arm gersion of GCC <a href="http://summon-arm-toolchain.org/">http://summon-arm-toolchain.org/</a><br />but the git repo says it's "not under active development" any more. They recommend <a href="https://launchpad.net/gcc-arm-embedded">https://launchpad.net/gcc-arm-embedded</a> , which seems to be an offically ARM-supported<br />version.<br /><br />It looks like Debian has packaged the launchpad version into the "unstable" branch: <a href="http://packages.debian.org/sid/gcc-arm-none-eabi">http://packages.debian.org/sid/gcc-arm-none-eabi</a> but I'm running "stable" so I got it directly from launchpad instead. Install was simple:<br />
<ul>
<li>Download gcc-arm-none-eabi-4_8-2013q4-20131204-linux.tar.bz2</li>
<li>unpack in /opt,</li>
<li>add to PATH</li>
<li>Create symlink: cd /opt && ln -s gcc-arm-none-eabi-4_8-2013q4 gcc-arm-none-eabi</li>
</ul>
<br />
That's my setup, the chosen directory is just a matter of personal preference.<br />
<h3>
Programming tools:</h3>
I'm using the STM32F4DISCOVERY board for development, so there are two ways to get code<br />into the chip:<br />
<ol>
<li>Use the st-link USB input to the built-in programming hardware.</li>
<li>Connect directly to the USB port of the STM32F4 chip and use dfu-util.</li>
</ol>
I used dfu-util before. That's now in Debian, and should still work but I haven't retested it.<br />
<br />
<br />
<br />
Code for the st-link interface is available and built with no problem: <br />
<ul>
<li>git clone git://github.com/texane/stlink.git stlink</li>
<li>cd stlink && ./autogen.sh && ./configure && make && make install</li>
</ul>
Programs are installed in /usr/local/bin: st-flash st-info st-term st-util<br />
<br />
An example was successfully placed in flash using:<br />
st-flash write *.bin 0x8000000<br />
<h3>
Libraries:</h3>
<br />The open source libraries and examples at <a href="http://libopencm3.org/wiki/Downloads">http://libopencm3.org/wiki/Downloads</a> built without problem using the launchpad compiler. My build command was:<br />PATH=/usr/bin:/bin:/opt/gcc-arm-none-eabi/bin DESTDIR=/opt/libopencm3 make install<br /><br />ST has standard peripheral library source code on their website, but it doesn't come with Makefiles. A USB serial example at <a href="http://vedder.se/2012/07/usb-serial-on-stm32f4/">http://vedder.se/2012/07/usb-serial-on-stm32f4/</a> includes some (all?) of the ST libraries and compiles fine with the launchpad compiler. I downloaded and unpacked STM32F4_USB_CDC.zip and "make" ran without problems. I only had to change the top-level Makefile so that BINPATH points to the directory that arm-none-eabi-gcc is in<br />
(BINPATH=/opt/gcc-arm-none-eabi/bin for my install).<br />Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com1tag:blogger.com,1999:blog-865007134733273439.post-91775495716333134832014-02-05T09:36:00.000-05:002014-02-05T09:36:28.600-05:00HDMI Breakout Part 2<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPUPr2f6EsNYS-AzsVtPN-05CI-fkaGVzuPTLWNETT11Omf3MUxv_k1qZikvsSkXivODfadaWQNF_ETIBJfyrEEpv0mDCwmNvLVtrhvA6EdLlDYsFFcDOXvVzLITCUcCOeVrVswlkwfe0/s1600/hdmibreak_brd.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img alt="Layout of the PCB" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPUPr2f6EsNYS-AzsVtPN-05CI-fkaGVzuPTLWNETT11Omf3MUxv_k1qZikvsSkXivODfadaWQNF_ETIBJfyrEEpv0mDCwmNvLVtrhvA6EdLlDYsFFcDOXvVzLITCUcCOeVrVswlkwfe0/s1600/hdmibreak_brd.png" height="200" title="HDMI Breakout PCB" width="158" /></a></div>
I see the PCB in my Nov 6, 2013 post is getting some interest, so here's more info about it. The image to the left is a Kicad screenshot. The breakout connector (P1, CONN_5X2) is at the top, and pin 1 is the top right pad. Odd-numbered pins on top, and even-numbered on the bottom.<br />
Top connections are:<br />
1 Ground<br />
3 HOTP-J<br />
5 DCC_D-J1<br />7 DCC_C-J1<br />
9 CEC-J1<br />and the bottom connections are:<br />
2 +5V (J1 and J2 both)<br />
4 HOTP-J2<br />6 DCC_D-J2<br />8 DCC_C-J2<br />10 CEC-J2<br />
<br />
So to use the board as a passthrough connection, add jumpers connecting 3-4, 5-6, 7-8, and 9-10. Obviously, it's NOT a good idea to have a jumper connecting 1 and 2 (ground and +5V).<br />
<br />
Here's the schematic. Pin 20 is the metal shell of the connector, not a real pin.<br /><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7oyiMEWQtE6Vx97AZn-gHlojb6kF4bgkq6-bFD96tqmnTnkeN3PKvHKQs9oIqr2MZ2Ye3jk3sRf8aP8on1Pc9zMrkgs4TZ4JhrxY3uoPsDRwEE8blDoJCHorftzpBt_Isqw67VjpUzN0/s1600/hdmibreak_sch.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7oyiMEWQtE6Vx97AZn-gHlojb6kF4bgkq6-bFD96tqmnTnkeN3PKvHKQs9oIqr2MZ2Ye3jk3sRf8aP8on1Pc9zMrkgs4TZ4JhrxY3uoPsDRwEE8blDoJCHorftzpBt_Isqw67VjpUzN0/s1600/hdmibreak_sch.png" /></a></div>
<br />Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com3tag:blogger.com,1999:blog-865007134733273439.post-62350948292218289572013-11-06T11:51:00.000-05:002013-11-06T11:51:19.701-05:00HDMI breakout PCB<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgpXwdd8k1euvm1vwsTzgMDoZqsTTtd9CyRJ1mnV-Z9kqNS9ONfcqJ43tegS6sXfs1ph0tUsl1JWysC1Gt3YfdGZhUXChduQsNhZ1Zr9OuhpGOYl9u3LIrfegikAnockLh4oLzYBU6T0c/s1600/hdmibreakout.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img alt="HDMI breakout pcb" border="0" height="172" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgpXwdd8k1euvm1vwsTzgMDoZqsTTtd9CyRJ1mnV-Z9kqNS9ONfcqJ43tegS6sXfs1ph0tUsl1JWysC1Gt3YfdGZhUXChduQsNhZ1Zr9OuhpGOYl9u3LIrfegikAnockLh4oLzYBU6T0c/s200/hdmibreakout.jpg" title="HDMI control signal breakout pcb" width="200" /></a></div>
This is probably only useful to a small handful of people, but if you're and engineer developing HDMI products that might include you.<br />
For some work developing HDMI-compatible FPGA code, I needed to observe the control signals with a scope. So I built up this little breakout PCB. The high-speed video TMDS signals are routed directly through from one connector to the other. I tried to keep them equal length and as short as possible. Don't have any way to verify impedance and reflections, but it works ok on one TV with short HDMI cables.<br />
The low speed (CEC, SCL, etc) signals are brought out to the header in the back in the photo. Jumpers allow the signals to pass through, or they can be disconnected to test and modify them.<br />
The PCB is shared on OshPark. See <a href="http://oshpark.com/profiles/sensicomm">http://oshpark.com/profiles/sensicomm</a> if you want to use this design. It uses standard HDMI female connectors, available from DigiKey and many other vendors. Soldering the fine-pitch surface mount pins on the connectors is a bit of a challenge. I tried soldering individual pins, but ended up using the flood it with solder and mop up the excess with solder-wick method. Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com3tag:blogger.com,1999:blog-865007134733273439.post-66190742920697574222013-04-08T13:41:00.000-04:002013-04-08T13:42:26.504-04:00Linux system clock and hardware clock accuracy?This is a followup to the "my Debian Tweaks" post on on Jan 21. Briefly, my PC tends to spend a lot of time disconnected from the Internet, and the default clock management as implemented in <span style="font-family: "Courier New",Courier,monospace;">/etc/init.d/hwclock.sh</span> doesn't work very well in that case.<br />
<h4>
Debian timekeeping background </h4>
Linux on Intel-based PC's has two timekeepers, often referred to as the system clock and the hardware clock. The system clock is based on a high frequency crystal oscillator and is mainly intended for timing and scheduling programs and such. It doesn't run when the system is turned off, so it needs to be initialized with the current time when the PC is powered on. The hardware clock is a battery-backed circuit that keeps time even when the PC is off; it provides a value to initialize the system clock at power up and is rarely used for anything else. Debian systems assume the system clock is more accurate than the hardware clock, and they update the hardware clock every time the system is powered down (see <span style="font-family: "Courier New",Courier,monospace;">/etc/init.d/hwclock.sh</span>).<br />
<h4>
So how accurate are the crystal oscillators for system and hardware clocks?</h4>
Relative accuracies of these clocks depend on the specific PC. The only spec I found in a quick search is 500 parts per million (PPM) in the <a href="http://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/software-developers-hpet-spec-1-0a.pdf">Intel HPET timer spec software-developers-hpet-spec-1-0a.pdf</a>. The system clock may or may not be related to the HPET timer. Timing crystals are usually spec'ed at 100 PPM or better even for cheap crystals, so 500PPM sounds like a really loose spec.<br />
The PC hardware clock typically uses a 32.768 kHz watch crystal and a battery-backed timing circuit (you can see the coin cell battery in the photos in my Dec 24 2012 posting). Watch crystals are readily available with 20 PPM accuracy specs, and the frequency is generally stable with time and temperature. For example, the CFS206 available from <a href="http://www.digikey.com/">Digikey</a> and other distributors is 20PPM accuracy, 3PPM per year max drift and .034 PPM per degree C temperature sensitivity. So timekeeping accuracies of a few PPM should be feasible with some calibration.<br />
The US National Institute of Standards and Technology did an interesting study of wristwatches, <a href="http://tf.nist.gov/general/pdf/2276.pdf">tf.nist.gov/general/pdf/2276.pdf</a>, and found that even a cheap[2] ($30) modern watch can achieve better than 1 PPM timekeeping accuracy. Older quartz watches were orders of magnitude worse, which implies that manufacturers have started calibrating the crystals in the last few years. So a PC's hardware clock should be capable of similar performance.<br />
<h4>
How good are the clocks in my PC?</h4>
Here's a quickie experiment with my main PC, an Acer Aspire 5253 notebook with hardware clock updating disabled in hwclock.sh. I set the hardware clock on Feb 13, 2013, and it hasn't been touched since. The hardware clock lost 6.227 seconds in 4609045 seconds (about 53 days), which is an average frequency offset of 1.35 parts per million (PPM).[1] In contrast the Linux system clock lost 0.44 seconds in 9103 seconds (about 2.5 hours), which is 48 PPM.<br />
I checked a couple of older systems and their hardware clocks are in
the 6 to 10 PPM range. So newer PC's are probably being calibrated like
newer watches are. I suspect that the hardware clock is still more
accurate than the system clock on the older PC's, but the difference
should be less pronounced.<br />
<br />
<h4>
My Setup</h4>
The hardware clock in the Acer Aspire is more accurate than the system clock by a factor of 35, so that's why I don't let hwclock.sh update the hardware clock on shutdown; instead I manually set the time using ntpdate-debian every month or so, and manually update the hardware clock at that time. That keeps me within 3 seconds or so of true time, which is more than adequate for my purposes.<br />
There are routines (adjtimex and such) that attempt to improve the calibration of the hardware clock and/or the system clock. They generally assume the oscillators are off by a fixed percentage from the true rate and that frequency changes due to temperature and drift are insignificant. In the 1 PPM range I doubt that that's true, so I don't bother with adjtimex and friends. <br />
<h4>
Side Notes</h4>
[1] I checked my Timex DataLink USB watch at the same time, and it lost about 2 seconds over the same interval. So it's averaging around 0.5 PPM.<br />
[2] And if you want to spend a few thousand dollars, you can get a <a href="http://www.grand-seiko.com/collection/9f-quartz/SBGX059.html">Grand Seiko SBGX059</a> which is spec'ed at less than 10 seconds per year, or about 0.3 PPM. Nice, but I think I'll stick with my sub-$100 Timex.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com1tag:blogger.com,1999:blog-865007134733273439.post-44689709353749248772013-02-10T19:38:00.000-05:002013-02-10T19:38:05.326-05:00ARM presentation at Consultants Network of NHOn February 6 I made a presentation to the IEEE Consultants Network of New Hampshire (<a href="http://www.consultantsnh.org/">www.consultantsnh.org</a>) entitled "Beagles and Berries: the World of Low-Cost ARM Computing," about the history of the ARM architecture and describing and demonstrating the Texas Instruments Beagleboard (<a href="http://www.beagleboard.org/">www.beagleboard.org</a>) and the Raspberry PI (<a href="http://www.raspberrypi.org/">www.raspberrypi.org</a>).<br />
My slides are available for download at<a href="https://sites.google.com/site/sensicommllc/Home"> https://sites.google.com/site/sensicommllc/Home</a> .Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-73254635866713647602013-01-21T16:48:00.000-05:002013-01-21T16:52:52.475-05:00My Debian tweaksWhen doing a new Debian Linux installation, there are a set of basic configuration changes that I nearly always make. While the issues do not apply to everyone, I think they are common enough that many others may find them useful. As always, your mileage may vary, use at your own risk, etc.<br />
My system is Debian Testing installed on a laptop that is typically shut down at night and that often runs disconnected from the Internet. So here are the problems I often see and my solutions: <b><br /></b><br />
<ol>
<li><b>PC locked by fsck</b>. The fsck partition check program typically runs every 30 reboots or so on EXT2/EXT3 filesystems (and maybe others). This automatically happens during the boot process and, per Murphy's law, it usually happens while setting up a critical demo or presentation. The problem is that it can't be interrupted, so the group gets to spend several minutes watching the progress bar slowly move. The fix is to add the lines:<br />[options]<br />allow_cancellation = true<br /> to the file /etc/e2fsck.conf. One site that discusses this fix and potential issues is <a href="https://wiki.archlinux.org/index.php/Fsck">wiki.archlinux.org/index.php/Fsck</a></li>
<li><b>Boot pauses due to exim.</b> When booting while not connected to the Internet, the exim mail handling program may hang for 60 seconds. I found that adding<br />MAIN_HARDCODE_PRIMARY_HOSTNAME = mypc.example.com<br /> to /etc/exim4/exim4.conf.localmacros gets rid of the hang, where mypc.example.com should be changed to whatever is appropriate for that PC. Depending on other configuration options, this line might belong somewhere in /etc/exim4/conf.d instead.</li>
<li><b>Annoying computer beep.</b>For some reason, many programs seem to think a loud "beep" on errors is a helpful feature. I'm one of the legions that disagree, so I disable the pcspkr device by adding<code><br />blacklist pcspkr<br />blacklist snd_pcsp<br></code>to a file in the <code>/etc/modprobe.d/blacklist</code> directory. See <a href="http://www.thinkwiki.org/wiki/How_to_disable_the_pc_speaker_%28beep%21%29">www.thinkwiki.org/wiki/How_to_disable_the_pc_speaker_%28beep!%29</a> for example.</li>
<li><b>Hardware Clock.</b> Normal PC's have a hardware clock that keeps track of the date and time of day even when the PC is powered off, and Linux also has a system clock that keeps time when running. This system clock is initialized from the hardware clock while booting. In normal Debian setups the /etc/init.d/hwclock.sh script also copies the system clock back to the hardware clock during system shutdown. That's a problem in my system because it's using the less accurate clock to reset the more accurate clock. One fix is to install the ntpdate package; then the system time gets set whenever an Internet connection comes up. Another option I use sometimes is to edit hwclock.sh to disable the hardware clock update, and just set it manually. I'm planning a more detailed post on this issue.</li>
</ol>
<br />Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0tag:blogger.com,1999:blog-865007134733273439.post-9125942970606906582012-12-24T14:35:00.000-05:002012-12-24T14:40:06.344-05:00Acer 5253 disk upgrade <i><span style="color: #783f04;">I'll start with the usual
warnings: I'm not a PC repair expert; this is what I did, I'm reporting
it in case it turns out to be useful for others. It might work for you
or it might destroy your PC, wreck your marriage, or give you acne.
Proceed at your own risk.</span></i><br />
<br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCvyX2r8TOR6KpPHEpp01Q6Jh2ZoAomHJop0NTOv1gcpNFGw2lcNUce9Ffm8vIqJaWuvViS1CKAkz62huU2qumu_lcGfw1EgrGs8bA7zgxHQz8Pa9QXvJ-ZONsxJk6bexxnQT2Fb6_P1s/s1600/crop2595.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img alt="pc with disk drive bay cover removed." border="0" height="235" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCvyX2r8TOR6KpPHEpp01Q6Jh2ZoAomHJop0NTOv1gcpNFGw2lcNUce9Ffm8vIqJaWuvViS1CKAkz62huU2qumu_lcGfw1EgrGs8bA7zgxHQz8Pa9QXvJ-ZONsxJk6bexxnQT2Fb6_P1s/s640/crop2595.jpg" title="Acer 5353 notebook pc." width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Acer 5353 drive/memory bay. The holes for the locking tabs are clearly visible.</td></tr>
</tbody></table>
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBsVgPbsKwPDcNqehH2xXYBhv-SJL3toEs-M4-hov5_cD9CPKvkICeTMHnABvpHujz2sxBAZyce7xznANr7NVkoO5yua41V2sMI6USi2kNe1i5I5Q5eVFOE3BNApS2r8g4QmCvrJII5c0/s1600/crop2601.jpg" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="154" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBsVgPbsKwPDcNqehH2xXYBhv-SJL3toEs-M4-hov5_cD9CPKvkICeTMHnABvpHujz2sxBAZyce7xznANr7NVkoO5yua41V2sMI6USi2kNe1i5I5Q5eVFOE3BNApS2r8g4QmCvrJII5c0/s200/crop2601.jpg" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">A locking tab looks like this if you pry too hard.</td></tr>
</tbody></table>
<br />
Found a good price on a new hard drive so I decided to upgrade my Acer 5253 notebook PC. The back of the PC has a cover with disk and memory symbols that's held on with 2 screws, so it looks obvious: remove the screws and replace the drive. Nope: take out the screws and pry, and the cover doesn't move. A Google search shows that lots of other folks have had the same problem: there's a series of small molded tabs that have to be pried loose. I used some cheap miniature screwdrivers to pry the tabs back. Only one of the tabs broke, which I think is a decent record.<br />
<br />
Next step is to get the old drive out: it's mounted in a metal frame that's held in by one screw at the lower right and one small tab at the upper left. I took out the screw and slid the drive to the right. I found that it took a really hard push to get the drive to move: it seemed to hang up on the silvery tape under the top right frame end. After getting it out the first time, the drive slid in and out quite easily. For reassembly, I just reversed the steps: put the metal frame on the new drive (4 screws), engage the tab on the frame with the slot at the upper left edge of the mounting bay, slide into position, put the mounting screw back in, and finally put the plastic cover back on. <br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI9sgGz9ftJtwxCFApvhY3IXG6jhZyL9L3tWCzbg48nEh1IAY_wvNUuIOriC16bKDaXeANPIgVgt0l4Y2fzrIskWBZMsMcC2NcpxvHQc2u-zEhVnL_LRDuLde_jYrlDTNQqmTEFsQuef0/s1600/crop2598.jpg" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="154" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI9sgGz9ftJtwxCFApvhY3IXG6jhZyL9L3tWCzbg48nEh1IAY_wvNUuIOriC16bKDaXeANPIgVgt0l4Y2fzrIskWBZMsMcC2NcpxvHQc2u-zEhVnL_LRDuLde_jYrlDTNQqmTEFsQuef0/s320/crop2598.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">This tab at the upper left helps hold the drive in. </td></tr>
</tbody></table>
I found this YouTube video <a href="http://www.youtube.com/watch?v=ox1OkNVGBlg">http://www.youtube.com/watch?v=ox1OkNVGBlg</a> showing the whole process; it's a different model but the process looks about the same. Removing the cover and the old drive looks a lot easier for him than it was for me, though.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT-whmGevuAyuJYZX8E0q-O29F_w1hhpxyAlNpM5WkImQPw4LuHNd5FTKxkLQXgdF5H6-86iJlYj5LKq9RZPg2EEfgEr9SMVlLeDY0GlA4FDa0A6talr2b9Wsqv04hfeE3TssBacqVrXw/s1600/crop2599.jpg" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="251" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT-whmGevuAyuJYZX8E0q-O29F_w1hhpxyAlNpM5WkImQPw4LuHNd5FTKxkLQXgdF5H6-86iJlYj5LKq9RZPg2EEfgEr9SMVlLeDY0GlA4FDa0A6talr2b9Wsqv04hfeE3TssBacqVrXw/s320/crop2599.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The tab slides down into this slot and then right.</td></tr>
</tbody></table>
The new drive is a white label unit from <a href="http://goharddrive.com/">goharddrive.com</a>, who I found via the <a href="http://pricewatch.com/">pricewatch.com</a> website. Just a one-time purchase from them, but shipping was prompt and the drive has been working fine so far.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com1tag:blogger.com,1999:blog-865007134733273439.post-22546586578320589722012-01-27T12:54:00.000-05:002012-01-27T12:54:25.887-05:00STM32 STM32F4DISCOVERY arm eval board and Linux<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz1zAufHgwJ2bsJxMfqIosCeG1o4X31rcKfv6QbLI0Z1PbSZXz_QxPgfHS1YvOEXaeuprW-MGXqd6LWLqKRaHeVTRFkpJVIKPk-M_ozLXkPOljKJLntvDdmcyPYL_MYyrOsEBxnkBu6YQ/s1600/dscn0002edit.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz1zAufHgwJ2bsJxMfqIosCeG1o4X31rcKfv6QbLI0Z1PbSZXz_QxPgfHS1YvOEXaeuprW-MGXqd6LWLqKRaHeVTRFkpJVIKPk-M_ozLXkPOljKJLntvDdmcyPYL_MYyrOsEBxnkBu6YQ/s320/dscn0002edit.jpg" width="190" /></a></div>Picked up this eval board at the last Embedded Systems Conference, and finally starting to work with it. The chip is a 168MHz ARM Cortex M4 with 12-bit A/D and D/A's . The eval board includes an accelerometer, microphone, and separate audio D/A chip, among other things. Pricing is really interesting. Here are Digikey quantity-1 prices:<br />
STM32F4DISCOVERY $19.50<br />
STM32F407VGT6 $16.00<br />
STM32F103C8T6 $ 5.71<br />
(The F407 is the main ARM chip, and the F103 is a smaller ARM chip used as a programming interface). So the eval board is actually cheaper than the chips on it.<br />
<br />
The F407 chip has a built-in program loader using either the serial port or the USB port. Both are supported by Linux tools, so I'm ignoring the F103-based programming port and using the F407's USB port.<br />
<br />
Connections: I have USB cables from my Linux box to both the F103's mini-USB connector at the top and the F407's micro-USB connector at the bottom. The mini-usb is just used to supply power to the board, and isn't necessary if an external supply is used.<br />
<br />
The programming tool is dfu-util, from <a href="http://dfu-util.gnumonks.org/">dfu-util.gnumonks.org</a> . I downloaded and built the latest version from the git repository. To test it, I used the miniblink example program from the libopencm3 package at <a href="http://www.libopencm3.org/wiki/Downloads">www.libopencm3.org/wiki/Downloads</a> . libopencm3 uses the summon-arm toolchain, so I downloaded and built that as well so the example would compile easily. (This also means I now have 5 different versions of GNU GCC for ARM on my system: summon-arm (linaro-based), 2 from CodeSourcery, one from openembedded, and a built-from-scratch GCC. One of these days I'll simplify that).<br />
<br />
To program, I connect a jumper between the 3V and boot0 pins on connector P2. After hitting the black reset button, lsusb shows USB devices connected as:<br />
Bus 001 Device 011: ID 0483:df11 SGS Thomson Microelectronics STM Device in DFU Mode<br />
Bus 001 Device 012: ID 0483:3748 SGS Thomson Microelectronics ST-LINK/V2<br />
To use it without being root, I also added the line:<br />
SYSFS{idVendor}=="0483", SYSFS{idProduct}=="df11", MODE="666" GROUP="plugdev" SYMLINK+="usb/stm32_dfu"<br />
to plugdev (in Debian, I just created a new file in the /etc/udev/rules.d directory with this single line in it. Locations may be slightly different in other Linux distributions).<br />
With that done, the command:<br />
dfu-util --device 0483:df11 --alt 0 \<br />
--dfuse-address 0x08000000 \<br />
--download /miniblink.bin<br />
works. I removed the jumper and hit reset again, and a single LED blinks, as expected.<br />
<br />
So that's "Hello, World" for the STM32F4DISCOVERY. Now I can start doing real work with it.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com2tag:blogger.com,1999:blog-865007134733273439.post-83859194604421583592011-11-23T16:29:00.000-05:002011-11-23T16:29:26.651-05:00Desampling using a Cascaded Integrator Comb filter<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvDVtMuVUu-Qu2n3B2LGP2o41r8hWrm6frZAlbAyMe87HAb2T-Dcfch0NHIFh0JDdWQXJdtB-Ur0yQRTdYhiMRKhLVnjKYPBA3LSMimzBenVQAeI5s42jEoVsF6-ZmS1I_QC3p3nxTb4A/s1600/eqcic3_v1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="45" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvDVtMuVUu-Qu2n3B2LGP2o41r8hWrm6frZAlbAyMe87HAb2T-Dcfch0NHIFh0JDdWQXJdtB-Ur0yQRTdYhiMRKhLVnjKYPBA3LSMimzBenVQAeI5s42jEoVsF6-ZmS1I_QC3p3nxTb4A/s320/eqcic3_v1.png" width="320" /></a></div>Been working with a <a href="http://www.beagleboard.org/">BeagleBoard</a> for the last few months. Can't say much about the project but the Beagle is a nice ARM Linux platform. Finishing up, so now I have more time to update the <a href="http://mhz100q.sourceforge.net/">MHZ100Q </a>sourceforge project page.<br />
I've now added a page describing the ideas behind the Cascaded Integrator-Comb (CIC) filter, and why it makes such a nice desampling filter for a high-rate data acquisition system. Input is 100MHz at 8 bits, and the output is any integer submultiple down to about 1kHz. The hardware resources in the FPGA are low: a set of 64-bit adders and registers, along with a reasonable amount of control logic.<br />
The first version of the page is general description and overview. I plan to put more details of the math behind the CIC. In researching math and html, I found <a href="http://www1.chapman.edu/%7Ejipsen/mathml/asciimath.html">asciimathml.js</a> . It's an open source JavaScript package that lets one embed equations into a webpage's text using simple LaTeX-like strings. I've used it internally and it's really nice to use. Should be live on the mhz100q page in the near future.Joe Rothweilerhttp://www.blogger.com/profile/07215509695497889602noreply@blogger.com0