Aug 132016
 

Sometimes I wonder.  Take this evening for example.

I recently purchased some microcontrollers to evaluate for a project, some Atmel ATTiny85s, because they have a rather nice PLL function which means they can do VHF-speed PWM, and some NXP LPC810s, because they happen to be the only DIP-package ARM chip on the market I know of.

The project I’m looking at is a re-work of my bicycle horn… the ATMega32U4 works well, but the LeoStick boards are expensive compared to a bare DIP MCU, and the wiring inside the original prototype is a mess.  I also never got USB working on them, so there’s no point in a USB-capable MCU.

I initially got ATMega1284s owing to the flash storage, but these being 40-pin DIPs, they’re bigger than anticipated, and the fact they’ve got dual USARTs, lots of GPIOs and plenty of storage space, I figured I’d put them aside for another project.

What to use?  Well I have some AT89C2051s from way back (but no programmer for them), some ATTiny24As which I bought for my solar cluster project, an ATMega8L from another project, a LeoStick (Arduino Leonardo clone).  The LeoStick I’m in the process of turning into a debugWire debugger so that I can figure out what the ADCs are doing in my cluster’s power controller (ATTiny24A).

I started building a programmer for the ‘2051s using my ATMega8L last weekend.  The MAX232 IC I grabbed for serial I/O was giving me jibberish, and today I confirmed it was misbehaving.  The board in general is misbehaving in that after flashing the MCU, it seems to stay in reset, so I’ve got more work to do.  If I got that going, I was thinking I could have PCM recordings in an I²C EEPROM and use port 1 on the ‘2051 with an R2R ladder DAC to play sound.  (These chips do not feature PWM.)

Thinking this morning, I thought the LPC810 might be worth a shot.  It only has 4kB of flash, half that of the ATTiny85, and doesn’t have as impressive PWM capabilities, but is good enough.  I really need about 16kB to store the waveforms in flash.  I do have some I²C EEPROMs, mostly <2kB ones that are sourced off old motherboards, but also a handful of 32kB ones that I had just bought especially for this… but then left behind on my desk at work.

I considered audio compression, and experimenting with ADPCM-style techniques, came to the conclusion that I didn’t like the reduced audio quality.  It really sounded harsh.  (Okay, I realise 4-bits per sample is never going to win over the audiophiles!)

Maybe instead of PCM, I could do a crude polyphonic synthesizer?  My horn effect is in fact synthesized using a Python script: the same can be done in C, and the chip probably has the CPU grunt to do it.  It’d save the flash space as I’d be basically doing “poor man’s MIDI” on the thing.  Similar has been done before on lesser hardware.

I did some rough design of data structures.  I figured out a data structure that would allow me to store the state of a “voice” in 8 bytes, and could describe note and timing events in 8-byte blocks.  So in a 2kB EEPROM, I’d store 256 notes, and could easily accommodate 8 or 16 voices in RAM, provided the CPU could keep up at 30MHz.

So, I pull a chip out, slap it in my breadboard, and start hooking it up to power, and to my shiny new USB-TTL serial cable.  Fire up lpc21isp and, nothing, no response from the chip.  Huh?  Check wiring, probe around, still nothing.  Tried different baud rates, etc.  No dice.

This stubborn chip was not going to talk to lpc21isp.  Okay, let’s see if it’ll do SWD.  I dig out my STLink/V2 and hook that up.

OpenOCD reports no response from the device.

Great, maybe a dud chip.  After a good hour or so of fruitless poking and prodding, I pull it out of the breadboard and go to get another from the tube it came from when I notice “Atmel” written on the tube.

I look closer at the chip: it was an ATTiny85!  Different pin-out, different ISP procedure, and even if the .hex file had uploaded, it almost certainly would not have executed.

Swap the chip for an actual LPC810, and OpenOCD reports:

Open On-Chip Debugger 0.10.0-dev-00120-g7a8915f (2015-11-25-18:49)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 10 kHz
adapter_nsrst_delay: 200
Info : Unable to match requested speed 10 kHz, using 5 kHz
Info : Unable to match requested speed 10 kHz, using 5 kHz
Info : clock speed 5 kHz
Info : STLINK v2 JTAG v23 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.979527
Warn : UNEXPECTED idcode: 0x0bc11477
Error: expected 1 of 1: 0x0bb11477
in procedure 'init'
in procedure 'ocd_bouncer'

I haven’t figured out the cause of this yet, whether the ST programmer doesn’t like talking to a competitor’s part. It’d be nice to get SWD going since single-stepping code and peering into memory really spoils a developer like myself. I try lpc21isp again.

Success!  I see a LED blinking, consistent with the demo .hex file I loaded.  Of course now the next step is to try building my own, but at least I can load code onto the device now.

Jul 222016
 

Seems spying on citizens is the new black these days, most government “intelligence” agencies are at it in one form or another. Then the big software companies feel left out, so they join in the fun as well, funneling as much telemetry into their walled garden as possible. (Yes, I’m looking at you, Microsoft.)

This is something I came up with this morning. It’s incomplete, but maybe I can finish it off at some point. I wonder if Cortana has a singing voice?

Partial lyrics for the ASIO/GCHQ/NSA song book

Jul 112013
 

Some time back I actually got to look at Windows 8 first hand.  What intrigues me about this, is it seems to be more a knee-jerk reaction of the rise of the tablet, and less a careful considered re-work of a user interface.

In fact, what I hear on the grape vine, they don’t seem to have any real road map forward.  This has scared the likes of Rockwell Automation, who have started baking their SCADA systems into their hardware to remove their dependence on the OS.

All this to chase the tablet and smart phone market.

It makes me wonder what their road map actually is.  Perhaps they’ve taken a leaf out of Mental as Anything’s song book?  Sure looks that way…

New Windows released last night
You could call it a blight
It’s such a shame, We never thought it was
Gonna be so bad!  They wished for something good.

They’ve had enough of that
at other times in days gone by.
Changed so much I know…
Mmm just enough, enough to make you cry.

If you leave me, can I come too?
We can always stay
But if you leave me, can I come too?
And if you go, can I come too?

We let it happen again!
‘Cause that they couldn’t take.
Ooh once was quite enough
It’s easy to forgive, harder to forget

If you leave me, can I come too?
We can always stay
But if you leave me, can I come too?
And if you go, can I come too?

(Original lyrics credit: Chuck Krumel, Jeff Raymond, James Stewart)

Nov 042012
 

Mexico to Apple: You WILL NOT use the name ‘iPhone’ here

We don’ need no stinkin’ badge lawsuits

Apple has lost the right to use the word “iPhone” in Mexico after its trademark lawsuit against Mexican telco iFone backfired.

http://www.theregister.co.uk/2012/11/02/iphone_ifone_mexico_trademark/

Not so nice when the shoe’s on the other foot now is it, Apple? Now if only other law courts had such common sense.

Mar 292011
 

It was entertainment night at the Senior Citizens Centre.

Claude the hypnotist explained: “I’m here to put you into a trance;
I intend to hypnotize each and every member of the audience.”

The excitement was almost electric as Claude withdrew a beautiful antique pocket watch from his coat.
“I want you each to keep your eye on this antique watch.
It’s a very special watch.
It’s been in my family for six generations”

He began to swing the watch gently back and forth while quietly chanting,   “Watch the watch, watch the watch, watch the watch. .. .” The crowd  became mesmerized as the watch swayed back and forth, light gleaming off its polished surface.
Hundreds of pairs eyes followed the swaying watch, until, suddenly, the chain broke, it slipped from the
hypnotist’s fingers and fell to the floor, breaking into a hundred pieces.

“SHIT!” said the Hypnotist.

It took three days to clean up the Senior Citizens Centre.
Claude was never invited back to entertain

Oct 312010
 

I stumbled upon this looking up information on magnetic receiving loops.  Content is below, with my comments added.

1. When you look at a full moon and wonder how much antenna gain you would need.

2. When a friend gets a ride from you and remarks that you have a lot of CBs in your vehicle, it turns in to an hour long rant on how ham radio is not CB radio.  (Not quite… but I have had people ask if that’s a “CB” on my bike, and I’ve responded no, it’s an amateur set.)

3. When someone asks for directions, you pause, wondering if long or short path would be best.

4. When you can look at a globe and be able to point to your antipode (and you know what an antipode is).

5. Your cell phone ring tone is a Morse code message of some kind. (Yep… my phone taps out “VK4MSL”)

6. You have accidentally said your Amateur Radio call sign at the end of a telephone conversation. (Almost did this once leaving a phone message back when I had a F-call… almost blurted out “VK4FSJL clearing the frequency”)

7. Your favourite vacation spots are always on mountain tops.

8. You notice more antennas than road signs while driving your car. (I do notice antennas a lot more these days when I’m riding the bike)

9. You have driven onto the shoulder of the road while looking at an antenna.

10. Porcupines appear to be fascinated with your car. (We don’t get porcupines in Australia and echidnas are rare in suburbia.)

11. If you ever tried to figure out the operating frequency of your microwave oven.

12. When you look around your bedroom of wall to wall ham gear and ask: Why am I still single? (This bloke can see his bedroom wall?!)

13. The local city council doesn’t like you.

14. You actually think towers look pretty.

15. Your family doesn’t have a clue what to get you for Christmas, even after you tell them.

16. Your HF amplifier puts out more power than the local AM radio station.

17. The wife and kids are away and the first thing that goes through your head is that no one will bother you while you call “CQ – DX” a few hundred times.

18. When you pull into a donut shop and the cops there on their coffee break ask if they can see your radio setup.

19. You refer to your children as your “Harmonics”.

20. Your girlfriend or wife asks: “You’re going to spend $XXXX on what???

21. You plan family vacations around hamfest dates.

22. When you see a house with a metal roof, and your only thought is what a great ground plane that would be.

23. You have pictures of your radio equipment as wallpaper on your computer’s desktop.

24. Every family vacation includes a stop at a Ham radio store.

25. The first question you ask the new car dealer is: “What is the alternator’s current output”?

26. You buy a brand new car based on the radio mounting locations and antenna mounting possibilities.

27. You have tapped out Morse code on your car’s horn. (I may try this if I ever mount a horn on the bike)

28. A lightning storm takes out a new Laptop, Plasma TV, and DVD Recorder, but all you care about is if your radios are okay. (Good riddance to the Plasma… they should be banned… I too have more concern for my radios…)

29. Your wife has had to ride in the back seat because you had radio equipment in the front seat.

30. Your wife threatens you with divorce when you tell her that you are going on a “fox” hunt.

31. Your wife says ‘the kids need to be fed’ and you first wonder what their impedances are.

32. When house hunting, you look for the best room for a radio shack and scan the property for possible tower placement.

33. When house hunting, you give your realtor topographical maps showing local elevations.

34. The real estate agent scratches his head when you ask if the soil conductivity is high, medium, or low.

35. You have Ham radio magazines in the bathroom.

36. When your doorbell rings, you immediately shut down the amplifier.

37. Fermentation never enters your mind when “home-brew” is mentioned.

38. Instead of just saying no, you have said “negative”.

39. You have used a person’s name to indicate acknowledgement.

40. You become impatient waiting for the latest AES catalog to arrive.

41. You have found yourself whistling “CQ” using Morse code.

42. You always schedule the last full weekend in June for vacation.

43. You walk carefully in your back yard to avoid being close-lined. (Make that step carefully around back deck to avoid tripping over feedlines)

44. You have deep anxiety or panic attacks during high winds or heavy ice.

45. You and the FedEx/UPS men are on a first name basis.

46. You really start to miss people that you’ve never seen.

47. Your exercise machine is a Morse code keyer.

48. You walk through the plumbing section at the hardware store and see antenna parts.

49. Your neighbours thought you were nuts when you ripped up your lawn to bury chicken wire.

50. Your next door neighbour thinks that your wife is a widow.

51. Your wife has delivered meals to your Ham shack.

52. If you sold all your Ham radio equipment, you could pay off your mortgage.

53. Removing snow from the roof of your car requires working around the antenna and wires.

54. You have never seen a Meteor Shower because you are inside on 6 meters when they occur.

55. If your radio equipment has a more advanced processor than your PC.

56. You hear about a pileup on the local news and you run to your radio equipment and start calling CQ.

57. If you install ferrite beads and place shrink tubing on your toaster appliance cords.

58. If your wife puts something on and asks “Does this make me look too fat?” and you reply with: “Honey you have an excellent front to back ratio with appreciable forward gain on the front lobes.”

59. If you think the half human / half machine individuals on a Borg Cube are really just a friendly group of electronic experimenters with similar interests.

60. You have no idea as to the weather forecast for tomorrow, but know the solar forecast for the next month.

61. If your blood type is RF positive.

62. You sell your dog to buy an amplifier.

63. Your XYL says communication is important in a marriage…so you buy another radio for the shack.

64. You doodle Hartley and Colpitts oscillators during boring meetings.

65. ..your boss asks if you understand? And you reply “QSL” !!!

66. You have been going to the library since you were three and the only shelf you ever go to has Dewey Decimal number 621.

67. You have invested more on your radio equipment than on your kids education.

68. You hire a babysitter to come over, and then you never leave the house-you just go to the shack so you can contest undisturbed.

69. You occasionally buy a Playboy magazine and let your Mum find it , just so she can think that you are ‘normal’.

70. You’ll spend hundreds of dollars on a new rig, and then wander the hamfest pausing each time you pass the booth selling those $7 embroidered call-sign hats thinking “I wonder if they’ll take $6?”

71. When shopping for a new vehicle the first think you look for is space to mount the radios – you end up sitting in the front seat staring blankly at the dashboard area, feeling underneath seats, and poking around the back seat for ways to route the coax. If caught looking under the hood for holes in the firewall for your power cables, you tell your wife, “Nothing honey, just checking things under here.”

72. Your family has a special annual garage sale just to get rid of the boxes of wire, coax, and power adapters-but you pay your friends to “buy” the stuff and get them to quietly return it to you the following weekend.

73. The $10 bargain you got at the flea market that smoked up the whole house when you turned it on is one of your prized possessions.

74. Your wife has called you three times for dinner – then she calls you on the repeater.

75. When going on vacation, the first thing you think about packing is your hand-helds, chargers, scanner and frequency book.

76. The total number of radio related books in your home are five times the total number of all other books and magazines.

77. You visually check your outdoor antennas and coax once a week, regardless of the weather.

78. You have more certificates and licenses on the wall than your local veterinarian or dentist.

79. All the local cops know your vehicle on sight – “it’s the blue Ford with six antennas”. (“It’s that bike with the 6′ whip”)

80. You think an upside to gaining weight is more belt space for radios.

81. You immediately think of `tower’ when someone says the word – `erection’.

Some additions I’d add to the above list

82. When naming kids, you immediately think: Charlie, Juliet, Mike, Oscar, Romeo and Victor.

83. You prefer the grandkids call you Papa.

84. You plan your week around regular nets. (“C’mon, they’ll be expecting me on 3.590MHz in 15 minutes”)