Blog Archives
In learning how to use the Bus Pirate, I started with the one-wire area of the demo board.
First off, important notes:
- I’m using the v 3.8 Bus Pirate. The pinout is different than some of the others.
- I’m using a Sparkfun Bus Pirate cable.
My cable is as follows:
Black: Ground
White: 5V
Grey: 3V3
Purple:VPU
Blue: ADC
Green: AUX
Yellow: CS
Orange: MISO
Red: CLK
Brown: MOSI
The first part of this is based on using the DS2431 1,024 bit (1 kilobit?) EEPROM. The second part is using the DS1822 temperature sensor.
1K EEPROM
I used the instructions on Dangerous Prototypes as a guide.
I hooked the ground (black) to the ground, the 5V (white) to Vin (the 3.3-5V pin), and MOSI (brown) to One Wire. Then, open the bus pirate and get into one-wire mode (m {enter} 2) and turn on the power (W). Then, issue the search macro ( (240) ).
Writing to the EEPROM to a Temporary Location
To write some values to the EEPROM, I used the following:
(0x55) (2) 0x0f 0 0 8 7 6 5 4 3 2 1
(0x55) is the macro to ‘match 64 bit address’
(2) is the macro to the address of the EEPROM I’m writing to
0x0f is the command to write to the devices scratch pad
0 0 is the location to write to
8 7 6 5 4 3 2 1 is the data that I’m writing
Reading (Verifying) What I Wrote
To read the string of numbers, I used the following
(0x55) (2) 0xaa r:3 r:8 r:2 r:2
The first two are similar to above – (0x55) to match the address and (2) for the macro to the address I wrote to.
0xaa is the read scratch pad command
r:3 reads the authorization code (needed to permanently write the data)
r:8 reads the data I wrote in the last step
r:2 reads the CRC
r:2 this is all ‘1’s
The final r2 returns 0xFF, which is 2 bytes of 1s, in decimal this is ‘11111111’ ‘11111111’.
Permanently Writing the Data
To permanently (well, permanent until I rewrite it) write the data to the EEPROM, I used the following:
(0x55) (2) 0x55 0x00 0x00 0x07
(0x55) (2) is the same as above
0x55 is the command to write the scratch pad to memory
0x00 0x00 0x07 is the authorization code from above
Verifying the Write
To verify the write, I used the following:
(0x55) (2) 0xaa r:3
(0x55) (2) is the same as above
0xaa is the read command (same as above)
r:3 means read three bytes. The data that is returned is 0x00 0x00 0x87, which is different from before
Reading Back the Data
To read the data, I used:
(0x55) (2) 0xf0 0x00 0x00 r:8 r:8
(0x55) (2) is the same as above
0xf0 is the read command, but this is read from the memory, not the scratch pad
0x00 0x00 is the address
r:8 r:8 reads 8 bytes, twice
The first string returned is 0x08 0x07 0x06 0x05 0x04 0x03 0x02 0x01, which is the data we wrote. The next string is 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00, which is data that was never written, so it is all zeros.
That’s it! I read and wrote to a small EEPROM. If it isn’t obvious from the picture above, this is about the same size as a small BJT transistor.
Reading from a DS1822 Temperature Sensor
The DS1822 is a one-wire temperature sensor that is also the size of a BJT transistor. Reading from it is pretty easy and was described on Hack-A-Day by Ian back in 2008.
This is in the same setup as above, so looking in the screenshots above, the proper address for this device is (1).
To read from the device, two commands must be entered:
(0x55)(1) 0x44
(0x55)(1) 0xbe r:9
The first command is a “Convert temperature” command, which basically tells the sensor to read the temperature.
The second command reads 9 bytes from the sensor. The important part are the first two bytes. In the example above, the first two bytes are 0x71 0x01. This translates into being read as 0x171 (see note). That 0x171 needs to be converted into decimal, in this case 369. That number then needs to be multiplied by the resolution, which if never changed is 0.0625. That comes out to a temperature of 23.06C, or 73.5F.
-…-
This is the first of a multi-part series. Next installment in this series (hopefully next week) will be the I2C bus, although depending on the length (there are several chips there), it may be broken into two parts.
-73-
A few weeks ago, I got a Free PCB from Dangerous Prototypes for a Bus Pirate. This is a pretty cool hardware swiss army knife that I’m still learning how to use.
I had a few issues with the build (none a fault of Dangerous Prototypes or the PCB manufacturer). First off, I didn’t get the LEDs on correctly the first time, and I’m pretty sure I didn’t get the USB one right the second time, either. Also, I didn’t get good solder joints on the PIC24. I was seeing problems that were identical to these reported on the DP Forum, and feared that the FTDI chip was fake. After removing the FTDI chip and pulling one from another FTDI board I had, I tried sjaak’s advice of pushing on the chips and found that if I pushed on one part of the PIC24, the VREG light came on, so I reflowed the solder on both chips and voila!
I also learned that PIC chips aren’t as easy as Arduinos to burn, and after initially finishing the PCB, I had to order a PICKit3 to burn the chip. It wasn’t a big deal to order the PICKit, but it was a nearly week delay as I inadvertently (and unknowingly) selected a shipping option that used UPS for the long haul from Ft. Worth to Cincinnati and then used the postal service to deliver it the last 2 miles from the post office to my house (to use another ham’s quote, “you get the incredible slowness of the ground services + the normal 2 day delivery of USPS. you save cents. yay!?” … yeah, that’s about right – 100 cents to add two days to the delivery time).
I did slightly deviate from what I think was intended with this – this was built for a USB Micro connector, but I put a USB Mini connector on it. It hangs off a little, but I’m fine with that (I have minor personal reasons too, but it really boils down to preference).
I also deviated on the connector. I didn’t look back in my order history to get the correct connector, and ended up with an incorrect connector. So I put header pins on it and called it done.
A final thing I learned was the value in over-ordering. Since I’m not a pro in this, my parts orders tend to be small, and normally there is a price break at 10. Having extras on hand means that as soon as I get a PCB, I can start building right away.
Thanks to Dangerous Prototypes for the PCB! I’m already learning a lot about using it and I’m (of course) using my last free PCB build to learn more about using it.
-73-
For anyone on the Amateur Repairs (*cough* yahoo *cough*) group or who follows me on G+, YouTube, or Twitter, you’ve likely seen posts related to my IC-706 mkIIG. I’ve pulled the radio out of service because of problems primarily on VHF-FM (at least it seems that’s where the problems are at). In fact, since early December, I’ve been sporadic with transmitting with it, and I haven’t transmitted with it at all since mid-January.
The problem I’m having is extreme static even with very strong signals. I’ve checked the likely (hopeful?) culprits of power cords and antenna connections. Since things seem to be fine on those – I’ve tried two power cords and three power sources and two different antenna setups – I’ve moved on to checking internals.
My first check was for anything obvious. Like this, this, or even this. Nothing. I don’t know if I should say “fortunately” or “unfortunately”.
My second check was to poke around inside. I first looked at some of the audio waveforms at the NB test point and the WFM test point. Pretty interesting to see on a scope, and they didn’t react to volume (that’s a good thing, as this is likely before the audio amp!).
(PS in the video above: yes, I’m checking that with an oscilloscope probe. It works, even if it isn’t necessarily ‘right’… or maybe it is, I don’t know).
My second test was to do something more … practical. I know from some of the reading I’ve done in the ARRL Handbook, the owners and service manual for the rig, a video from Kenneth Finnegan (from The Life of Kenneth blog that I follow), and some comments from Mike M. on Google+ that maybe I should check the PLL board. And besides, checking stuff is easy, right?
The first check is the 60 MHz reference frequency. After finding and fixing a messed up power switch on my antenna analyzer and after checking it with the scope to ensure I wouldn’t blow up my analyzer, I probed it and found exactly 60.000 MHz. Good.
The second test was of the PLL Loop Lock Voltage. Initially, I found that it was around 300 mV. This was too far outside of the required 2.0 V at 0.03 MHz. I thought for a moment that it might be a typo, although those things NEVER happen…
…and moved on to test the Main Loop Lock Voltage. It was far less than the spec 4.0 V on the first test (at 129.99999 MHz), so I didn’t continue tests.
After some replies to the post on the Amateur Repairs group, I tried again to recalibrate the PLL circuit and was able to do it. This was, of course, after I removed a shield to test two transistors. I’ve reinstalled it in the truck and so far, so good. But we’ll see. It could have been that the PLL was off causing weird errors that may have changed as voltages to the radio changed (it is mobile, after all), or it could be that something is still bad.
-73-
I risk falling behind in my weekly posts, so this is a post to provide a few small updates.
The Icom 706 is still screwed up on 2m FM. And maybe 70cm FM. I haven’t tested SSB or AM on those, perhaps I will soon. I’ve thought up a way to test things, so soon I will have it on the bench (again) to test. I listened to a 40m SSB net all morning and noted no static that seemed out of place (e.g. static with an S9+40dB signal), so it still looks like things are affecting only the high VHF and UHF signal path. In a related note, I need to tune my 40m hamstick.
I am halfway through building a Bus Pirate. I ordered the remaining parts I need late last week and they are expected to arrive the same day I’m typing this blog post (Tuesday). I’ve really been chomping at the bit to finish this and play with it, and Ian (from Dangerous Prototypes) has uploaded several videos to YouTube that show how to use it, so I fully expect to watch several of them again.
In keeping with my want to build a small Arduino powered receiver, I purchased some parts for that (on the same order that arrives today).
I’m still working on my experiment that I talked about last week. There are some interesting findings so far.
I stopped by a Radio Shack while in the mall over the weekend. Apparently we’re still waiting for their return to a not-useless store on the east side of Cincinnati. All I saw were the same things as the past few years, with the same high prices and same SMALL selection. Honestly, if Micro Center would open a mall on the east side of Cincinnati, it would be maker heaven. I do appreciate that the kids behind the counter didn’t attempt to sell me a cell phone, but in their return to the 80s, they attempted to sell me batteries (and, like their cell phone sales strategy, they didn’t take the first no for an answer).
On that, big shoutout to Micro Center – they’ve been growing their maker section with a decent selection of Arduinos, Raspberry Pis, Beaglebone Blacks, and even parts at very nice prices.
-73-
Before getting back into ham radio, I did something that I later found to be not optimal – I purchased a very nice 50″ plasma TV. It sounds like everyone else’s YouTube video of Plasma TV RFI, but if you want to see mine, the video is below.
I’ve looked into different solutions that remove noise based on a noise antenna, like the MFJ-1025 Noise Canceler. I believe these items work by inverting the phase of the noise and mixing it back with the signal to remove the noise. It is absolutely critical that these items have a great noise antenna in order to remove it.
The real issue I have is shown in the video above – the noise is picked up in the antenna. I believe that it is primarily picked up by the feed line because it is near (enough) to the front of the TV. See the diagram below:
So in order to use a noise canceling device, I’d need an antenna along my feed line.
I decided to try something else first – shielding my coax. I bought a pair of lengths of EMT conduit to run the coax in. This has a second advantage of being able to run coax really quickly. The only disadvantage is that I can’t use ladder line in it. Given the situation, no big loss.
So right now, this is where I’m at. My HF feed line is crummy RG-58 that has an aluminum shield (insert angry face), so I haven’t tested it yet because I don’t have any crimp PL-259 connectors (nor do I have aluminum solder). Additionally, if this doesn’t work like this, I will ground the conduit to see if that fixes it. If neither does, I’m sure that conduit would be an adequate noise antenna for a noise canceling device.
In other news…
I’ve been virtually off the air because of a problem with my IC-706. I posted something to Google+ and received a response that I need to look into, but I’m still looking for more clues as to why I’m getting major static on FM receive.
The filter sweeper is “stalled” because of work on other things. I will be getting back into it because I may want (or need) it for that crystal IF filter problem indicated in the G+ post mentioned above.
-73-
I’m not going to call it a spectrum analyzer anymore – the way I’ve designed this, it isn’t going to do the same things as a spectrum analyzer.
The main difference is that a spectrum analyzer can operate without a signal generator, this won’t because the signal generator is what is going to tell the Arduino what the frequency is.
I built another shield to stack onto the shield in last week’s post.
There is currently no connection from the DDS to this yet, but that’s one of the only few things left to do on the hardware side.
I also built a filter that will ultimately be the first filter to test. This is for my Softrock 20/30/40 and should pass 7 MHz while filtering 14 MHz.
This will fit in a Radio Shack small plastic enclosure – the plate was leftover from a small dummy load that I glued into the enclosure.
-73-
I’ve been reading a lot about receivers, and it sounds like one important thing is filtering. It makes sense too – simple receivers can suffer from front end overload due to a strong signal. And when on the ham bands, you never know where that strong signal may be – it could be someone driving down the road (which is a bit obvious once you see it), but in my neighborhood, if you don’t know me, you’re probably not going to know about the antennas in my attic.
I don’t have a spectrum analyzer, and since I’m a traffic engineer, I really don’t have access to one. I don’t need a full-blown spectrum analyzer, either, I just need to sweep through the HF band and get the difference between signal input and output. Math will take care of the rest.
$$dB=20*\log{\frac{V_{out}}{V_{in}}$$
The way I figure it is this:
An Arduino (and this could become a Raspberry Pi or any number of other devices, but I’m going to use an Arduino because it’s cheap and relatively durable) controls a direct digital synthesizer (DDS) module that just scans through it’s limits… well, probably something like 0.5 MHz – 40 MHz – that gets me into the AM broadcast band (which can be a source of strong signals) to above the 10m band (I don’t know what’s up there, but whatever’s there is probably not running 50,000 watts).
The output of the DDS would have an RF voltmeter and a probe to go to a filter. There would be another RF voltmeter to sense a filter output. The Arduino would handle not only control, of the DDS, but also sensing the voltage.
It’ll look something like this:
The Arduino and DDS will look like this:
There will have to be a companion app to this. In Java (not just because I’m drinking coffee, but also because it’s cross-platform). It’ll look like this:
I have the perfect item to test with also. One thing I built and don’t use (and never truly finished) was my Softrock RXTX. I need to build a filter for the output to keep the harmonic of the 7 Mhz fundamental from being too strong on the 20 meter band. I wound the coils while watching the Super Bowl-over-the-Broncos and printed a circuit board just before the game started.
I’m not really sure if this will work, but it certainly seems like it would, and I think it would be interesting to see how some filters respond on this compared to a real spectrum analyzer.
-73-
I have several “irons in the fire”, but nothing big to post this week. However, I do have several things coming:
My third free PCB from Dangerous Prototypes has shipped and it is a Bus Pirate v3. I tried playing with the Bus Pirate Arduino Shield and Bus Pirate Demo Board. I’ve not had much luck and I haven’t tried troubleshooting it yet. Associated with this, I’ve updated my Seeed Studio wish list
I printed a PCB for an upconverter that I haven’t yet even attempted to build yet. Once I do, It’ll make it here. Additionally, I just loaded a desktop with Debian, so expect I’ll be talking about doing something with that as well.
It’s membership dues time at the club, so I’ve been working on that. I built an Access database to help handle things, but now I need to sit down and actually do work. Have no fear, I won’t post many details about that here :-).
I am getting ready to get into packet radio. I bought a KAM+ a year (or so) ago, and I want to get it up as an APRS IGate. Coverage around my place is pretty crummy, so I would like to improve that. Eventually, I’ll probably replace the KAM+ with something else so I can play on packet (and I have some ideas).
I really want to build a QRP transciever. I’ve been looking at plans so I can find something. However, I may just buy a Rebel and add an e-ink shield to it. It looks like the Rebel Alliance (love the name, BTW) has paved the road to using an LCD screen. I want more and different, and certainly my code would be on GitHub.
I have been wanting to get back into getting frequencies from the Ten Tec Omni. I know this is do-able, but I need to purchase a connector and do more research.
I haven’t forgotten about my logging project with the WF32, it’s just been on hiatus because of life. I want to get back into that and get back onto HF mobile. I have a few additional thoughts that may be interesting to add.
I’ve also been blogging a lot more on my other blog. January is a busy in the transportation engineering and planning fields – the Transportation Research Board Annual Meeting is in early January. Just from that and intertwined conversations, I think that’s set me up for 8 blog posts, and that’s in addition to normal work that sometimes creates blog posts.
-73-
Edit: I forgot about one thing: I’ve been wanting to play on 70 cm a little, so I’ll have some antenna builds to show.
Since my year will be full of a lot of traveling (a lot more than in prior years), and I still want to get into actually using CW, I decided it would be smart to have a quick reference of QRS nets to help me out.
I haven’t verified that any of these exist, and I’m quite certain there’s a few more out there. But here it is: . If I missed any, please let me know in the comments or via email at ke8p .–.-. ke8p .-.-.- us
-73-
I’ve had a sudden want and need to print a few PCBs. I’m not going to re-hash the toner transfer method that everyone else has documented, but I will note three things that I’ve learned:
- Sanding the PCB with 600 grit sandpaper and cleaning with denatured alcohol is a must (you could probably use acetone or isopropyl alcohol too, the idea is to get any oil or dirt off the copper
- HP Banner and Flyer paper works fine for this. That may be documented somewhere, but everything I see says to use a photocopier and manually feeding magazines through it. I’m using my own laser printer, so the idea of feeding magazine pages through it is a bad idea to me… now, if I was using a copier at the library or drugstore or gas station, I would have no reservations.
- This method is never perfect. Never.
- Drilling sucks. Design for SMT, if you can.
I’m working on several things, including a small guitar amplifier and an upconverter for my RTL-SDR. The upconverter is one where the PCB layout was supplied and I printed it. I put it on larger PCB than it called for, hence the crappy looking surround.
Prior to this, I did print two other PCBs. These were designs I did in Eagle. Both look like the PIC16 below (okay, the other, a real-time clock, was larger!). In both cases, these are just breakouts so I can use them with a breadboard. I forgot that I have a set of small drill bits somewhere.
Moving forward, I will be using both the software and techniques used by Contextual Electronics as noted on this page on kohanbash.com. The videos are EXTREMELY HELPFUL! I may still print prototypes at home, but with all reality, I may just print the layout on normal paper and set the parts on the paper to fit them and then send the PCB off to a service.
A side note on printing these things at home. Rocking trays full of dangerous chemicals for long periods of time is only fun when you’re developing photos, and that ship has sailed (with my film camera, developing tanks, dark bag, and bulk film loader on the boat). If I do this a lot, I may end up building something that rocks the tray, as it would be pretty simple to build.
-73-