JTAG may be almost 30 years old with little change, but that doesn't mean most people really understand what it does and how. This workshop will start with a brief introduction to what JTAG really is, then quickly dive into some hands-on practice with finding, wiring, and finally exploiting a system via JTAG. For this workshop, we'll target a Raspberry Pi with an ARM microprocessor. In order to interact with the system, we'll use a JTAG interface cable from FTDI. We won't do any hardware modifications, but we will hook up wires in weird and wonderful ways to make the Raspberry Pi do things it otherwise shouldn't. Sunday, February 28th, 2016 1pm at Control-H, 7608 N. Interstate, Portland, OR 97217 Instructor: Joe FitzPatrick Free, (donate to Ctrl-H if you can!) Limited to 20 people (or groups of people) RSVP to email@example.com No equipment needed, everything is provided. Upcoming workshops! Sunday, 27MAR2016 at Control-H, Build your own FuzzFace Guitar Pedal with Jim Titus Sunday, 24APRIL2016 at Control-H, Advanced Microcontroller Audio with Paul Stoffregen Sunday, 29MAY2016 at Control-H, GLOBAL SYNCHRONIZED AUTONOMY with Rich and Friends
xnorman has added a photo to the pool:
Elijah and Karl are setting me up with a phone. Elijah and I plugged it in and realized that the star and pound keys didn't work.. Elijah dismantled it and we found that those keys were physically disabled with little pieces of post-it notes!
Recently I put some work into efficiently generating sine wave data intended for testing 24 bit audio hardware. Here's a quick message about this new work, in case anyone's interested....
Normally sine waves are generated on microcontrollers using a table lookup. That's perfect if the sine wave happens to be an exact division of the sample rate. But if you want to generate waveforms at any frequency, you end up needing points on the waveform that are "between" two entries in the table. The 2 common approaches are to simply use the nearest or prior table value, or to grab the nearest 2 values from the table and use linear interpolation.
But if you want a sine wave with extremely low distortion, where 16 or 20 or more bits are within +/- 1 from an ideal sine wave, you'd need an extremely large table!
Sine can be computed using Taylor series approximation. The formula is: (where x is the angle, in radians)
sin(x) = x - (x^3)/3! + (x^5)/5! - (x^7)/7! + (x^9)/9! - (x^11)/11! + ....
This series goes on forever, but each extra terms makes the approximation rapidly converge to the true value. In doing quite a lot of testing, I discovered the C library function on Linux for sin() uses this approximation, to only the (x^7)/7! term. I also found a few sites talking about going to the (x^9)/9! for "professional quality" audio.
If you're still reading by this point, you're probably shaking your head, thinking this couldn't possibly be practical in a microcontroller. That's a complex equation with floating point numbers, and huge values in x^11 and 11!, since 11 factorial happens to be 39916800.
The code I'm sharing here implements this equation to the (x^11)/11! term using 32 bit integers, using only 12 multiply instructions, which execute in a single cycle on Cortex-M4. The add & subtract take zero CPU time, since those multiply instructions also come in flavors that do a multiple and accumulate, either positive or negative accumulate.
The Cortex-M4 multiplies perform a 32x32 to 64 bit multiply, and then discard the low 32 bits, with proper round off. That turns out to be exactly the right thing for managing the huge values of x raised to an increasing power, and the huge numbers of the factorials. Since those divisions are by constants, it's possible to multiply by the reciprocal to get the same effect.
So, here's is the optimized code:
On top of the 12 cycles for multiplies, there's a few bit shifts, and a quick conditional test which subtracts from a constant. That's necessary because the Taylor series approximation applies only if the angle is between -pi/2 to +pi/2. For the other half of the sine wave, that subtract maps back into the valid range, because the sine wave has symmetry.
This function takes a 32 bit angle, where 0 represents 0 degrees, and 0xFFFFFFFF is just before 360 degrees. So the input is perfect for a DDS phase accumulator. The output is a 32 bit signed integer, where 0x7FFFFFFF represents an amplitude of +1.0, and 0x80000001 represents -1.0.
This code will never return 0x80000000, so you don't need to worry about that case.
I did quite a lot of testing while working out these constants and the bit shifts for correct numerical ranges. I believe the top 25 bits are "perfect". Six of the low 7 bits are very close, but the approximation does diverge slightly as the angle approaches pi/2 magnitude. The LSB is always zero, since the computation needs to have extra overhead range to accommodate values representing up to ~1.57 (pi/2) before the latter terms converge to the final accurate value.
For 8 bit AVR, this approach probably isn't practical. It probably isn't practical on Cortex-M0+ either, since there's no 32x32 multiply with 64 bit result. Cortex-M3 does have such a multiply, but not in the convenient version that rounds off and discards the low 32 bits. On Cortex-M4, this code runs very fast. In fact, when executing at 100 MHz or faster, it might even rival the table lookup, since non-sequential flash accesses (for the table) usually involve a few wait states for a cache miss. Then again, this code does have 6 integer constants, for the conversion to radians and the factorial coefficients... and depending on compiler flags and flash caching behavior, loading those 6 constants might be the slowest part of this algorithm?
I'm sure most people will still use table lookups, and maybe linear interpolation between 2 table entries. But I wanted to take a moment to share this anyway. Hope you find it interesting.
The audio workshop at Hackaday's Supercon was a huge success.
The FFT part was used by "most over the top" badge hacking winner!
Here's a walkthrough of the workshop:
I just thought I'd post some random photos and projects from the last DorkbotPDX meeting. Lots of fun stuff.
Tom Hudson brought his shaking haunted house. He worked on it with his coworkers at OMSI. It uses a saber saw as the shaking mechanism. Pretty sweet. He's posted an Instructable about it if you're more interested.
Mykle Hansen brought his Teensy Synth project. It made some sweet, crunchy sounds. I think it is based off of this project.
Mathew Lippincott brought his Portal Gun from Rick and Morty. It used an 800 lumen flashlight to project the portal! Very cool!
Scott Dixon brought a new robotics platform that he's playing around with. It's not hooked up to his Bluetooth Barbie steering wheel yet, but maybe soon. I didn't catch what the platform actually is, maybe he'll chime in on the comments.
Here were some folks playing with using balloons to diffuse LEDS. Reminds me of this project.
Fun projects, great to see so many projects on display!
DorkbotPDX is happy to offer a free workshop as an introduction to Pure Data (Pd).
When: Sunday, November 15th, 2015. 1-5pm
Where: Ctrl-H Hackerspace, 7608 N. Interstate, PDX, OR (map)
Bring: A laptop and headphones
Instructors: Jesse Mejia, Alex Norman, Jason Plumb
In this 4-hour course, students will learn the basics of Pd and will have fun developing foundational Pd patching skills.
Pure Data (Pd) is a free, open-source, community supported data flow language and coding environment with an emphasis on sound, music, and multimedia. It was originally written by Miller Puckette (also the original author of Max/Max MSP) and runs on Linux, Mac OSX, Android, and Windows.
Pd has been used widely in the creation of art -- such as music, sound art, visual art, generative, new-media, and interactive art. Pd interfaces readily with MIDI equipment and many popular microcontrollers.
Beginners are welcome. No prior computer programming or sound programming experience is required!Notes:
Students should attempt to install Pd prior to the workshop...but if not, no biggie. We can help with that!
Seating is limited to 20 participants. Please RSVP to firstname.lastname@example.org to reserve a spot.
Attendees will respect The DorkbotPDX code of conduct and will be asked to donate.Workshop Links/Notes/Materials
Best book ever written: http://www.amazon.com/Designing-Sound-Andy-Farnell/dp/0262014416
band limited oscillators and other useful things: https://github.com/dotmmb/mmb
bzztbomb has added a video to the pool: