Saturday, November 12, 2011

Arrgh....*poof*..

The DigiLite DATV project has taken me on an interesting (and kinda expensive) tangent in the last few days.

About 2-3 years ago, after years of doing small Micros and PIC processors, I decided to try out the AVR and the open source WinAVR GCC tool chain for the AVR's.  I never did get into Arduinos except for hardware-- I bought a few Sanguino boards which are an ATMEGA 644P version.  I got shipped 644's instead of 644P's and it wasn't worth shipping back (my order was correct, the shipment wasn't).. so I used those.

I decided that for the DigiLite DATV project to make my own programming board for the "Ultram Tech" PLL board rather than using the BATC Closed source or F1ACN "demo PIC basic" solution.  Initially, I didn't want to do the software work required to use WinAVR (see previous posts when I was working on the HF amplifier-- which I will get back to someday!), so I decided to see how "beneath me" the Arduino IDE actually is/was.

I'm actually fairly impressed by it because it does actually hide the GCC tool chain within it so the actual hit to the performance and RAM is minimal.  It is really well designed.  In the meantime I decided to order off a Chinese clone of a Arduino 2009 and  a LCD shield to go with it.  It cost $29 shipped for both.  It will be the "GUI" for the PLL project.   The physical packaging is nice.. it'll be nice and really that inexpensive PLL with the inexpensive control could also make a really nice "poor man's microwave signal generator".  The commercial Arduino 2009 version has a FTDI serial chip on it so ideally my version will have both a 2x16 LCD display and also USB (CDC serial emulation) control over the PLL.  I'm getting more functionality out of this unit for less work and $ than the two PIC based solutions.

I think I am going to post on Amateur Radio.com a "Zen of Arduino for Ham Radio" describing the potential uses of these little devices and a small quick tutorial (maybe here if it gets lengthy or too technical).  Anyway.. all is well with that project.. It took me about 20 minutes to build up a Sanguino and a HD44780 display and write 80% of the GUI for the PLL.  This was before I got the e-bay modules (which are quite nice).  To port off to the real Arduino (ok clone) took literally 10 seconds.

I'd have the whole thing done now.. but I need to figure out the control words for the PLL chip... this will be easier when I actually receive the PLL.

I can see the reasoning for "Arduino" even though those are slow, 8-bit processors that are a bit pricey for what they   are... but for someone who wants not to delve into programming these are ideal.

Anyway.. I also decided that I should use these to teach the older boys how to start programming rather than starting them off on Linux or MS Visual Studio.  So I got the "wild hare" up to dig out another old project--

About three years ago I bought a WizNet812MJ (W5100) module for about $35 with shipping (which was expensive IMHO) to do the DVB-S project on a FPGA.  The intent was to use Ethernet at the max 20 Mbps SPI rate the W5100 was more or less capable of.  I did get it to go with a small micro, but at the time the code to do the stack was substantial and I ran out of time.  In the closet that module went.

I decided, hey, the Arduino Ethernet Shield is basically the W5100..the arduino has a nice library for it.. no work, right?   So I made a breakout for the breakout, and put a L78L33ACZ 3.3V regulator on it and wired it into a breadboard.  What I didn't realize is that on the Sanguino board the SPI is currently "broken" on Arduino >-019 .. it's fixable but it's not a simple fix.

I almost had it.  (It has to do with the Arduino code not knowing the different pinouts of the SPI UART on the ATMega644)..

This is only a minor ARRGH.. though.. I was on my way to find out the issue with the module..  It is, by the way 3.3V but 5V tolerant for the inputs.  One thing that has to be done is resetting the chip.  I did this by tying into the RESET on the Sanguino.  I didn't yet (I'm getting some from...yes..e-bay china) have the little push button reset buttons.  So I have been resetting with a jumper wire.

Well.. guess what I did when I almost had the SPI issue resolved on the Sanguino/ATMega644/Wiznet?  I bumped the unregulated voltage when resetting it.  The Wiznet W5100 is 5V tolerant.. but it's not 8V tolerant!  :O(  The LCD was fine and the ATMega was fine.. no it couldn't have been something I had multiples of that is easy to get.

So it happens to all of us I suppose.  The bad thing here is that it costs about $25/module now with shipping (I did buy two more because I do have a couple of future projects and I want to teach the kids by making a little sensor driven Internet device-- weather station maybe?) and I also decided to buy an actual shield from.. yup... China.  I wondered why the lines on the Arduino shield are buffered on a 5V tolerant chip.  I now know.  So in a millisecond it cost me about $75.  OK the $25 for the shield was coming anyway probably.. but $50 for two more modules.. not so much.

Lesson:  don't do something that stupid.. or if you do put the chip reset on a GPIO line!

The good news (as it is) is I fired up the X-Tronic hot air gun and got the chip off without totally destroying the board.  (It looks good and I didn't drop off anything from the bottom!)  So if a place that charges reasonable shipping (Saelig is out, for example) and doesn't require minimum order of 5 of them (like WizNet direct or Jameco).. I can fix the module.  SparkFun carries them but are out of stock.  So if a SparkFun guy sees this I'd like the $6 solution to the $4 problem too to fix the module I have.  !

Like ham radio.. electronics is an expensive hobby.  But I do love it and I guess since it became my life and living I am blessed.

But boy do I feel downright dumb tonight.

Saturday, November 5, 2011

DigiLite update...and SOAPBOX

I did go off and order about $150 total worth of parts for the DigiLite.. I'd guess to get to the "modulator stage" of a DATV DVB-S transmitter that one would need about $275-300 if buying all new.




I also ordered the $55 Ultram Tech (from Israel..e-bay) ADF4360-6 based PLL oscillator board.  I am going to write my own control that will use a $29 Arduino 2009 board and a 2x16 HD44780 based board with buttons from e-bay (China) rather than running the "5-button" PIC board hack-up the BATC is running.  I need to be able to set my own frequencies, so I need source!  I have most of the code done already (Arduino is sooo easy..) but I need to figure out some of the settings that the Analog Devices Integer-N PLL / OSC uses.. like "current setting" and "antibacklash".  I don't have the Arduino yet.. but I converted some of the Sanguino's that you'll see in earlier posts to actually be Arduino based instead of hacked with WinAVR as I had been using them.


And Yes.. If I do this, it would be a "bang up" poor mans signal generator for 1200-1400 MHz.  Code will be open source...   Note also that there is a French Ham doing a version and there appears there may also be  a board when the BATC CQ-TV 235 comes out in October 2011..  okay.. we are past that.. now.. so "soon."


I ordered $80 of parts from Mouser for the Chip Tantalums (expensive!** only one is really needed for the DSPic33) Bourns Surface mount trimmer pots.. weird SMT 3.3V regulator***, a couple of PICs, and adjustable regulators for the biasing of the IQ circut.. and other bits).. oh and the $27 FTDI module.  By **expensive-- I'd eliminate the stinking chip tants-- which I hate-- if the board was re-laid out and replace with common leaded electrolytics.. I'd use standard leaded pots, ***a leaded 3.3v 78L33 type regulator.. those little things would make the board an inch bigger in one dimension but probably cut the parts cost by $15.)  I'd also consider the four port FTDI module FT4432 instead of the FT2232 and use one of the extra ports for SPI programming of the Ultram Tech PLL Oscillator and .. maybe an extra RS-232 port with a line driver on the board?  Actually, why not put the PLL chip on the board as well and not have to buy the synth from Israel?  (No offense here to Ultram Tech.. good service so far)

All parts can be had from Mouser which is the cheapest overall source other than the Analog Devices modulator chip.. the AD8346ARUZ..  that is a Digi-Key or if you must Newark part.

I programmed my own DSPic and saved the BATC pre-programmed one for a second board.  I was going to also order another board from the UK and build it up for 70cm.  I can't do that.  I do NOT believe it is legal to do so in the US.  Many including N1ND who is the frequency rules guy at the ARRL disagree with me.  I'll briefly mention why I do not think that DVB-S/C/T or even ATSC is legal on the ATV frequencies on 70cm at the end of this post.   I might build a second 1255 MHz unit and loan to other local hams so we could do a two-way.. or maybe I'll eventually build up a 33cm unit.

Anyway.. interestingly enough.. the DIP adapter for the PICKit3 I bought to program DIP based PICs wouldn't work the DSPic33... but a breadboard did!  If there is interest I'll write up how to make the programming on the breadboard with the PICkit3.  Basically hook up the power to the right places and the ICSP lines and power from the PICKit3 and it works!  The lesson here:  the bread board is the UNIVERSAL dip adapter.. don't waste the money of the ZIF adapter board unless you are programming a lot of parts!

Anyway.. I don't want to ramble to much, so lets cut to the chase.  I don't have the Oscillator module yet, so
I fired the unit up with no LO drive and no MMIC pre-driver installed...

It works...  At least up to the modulator out from the DSPic33..  Here is a short video of a "government cheese" NTSC SD-box receiving PBS on the Hauppage PVR-150 with WinTV-6 and then streaming it out with the BATC's software to the PIC which at least thinks it's modulating the signal to QPSK (and would if I had a LO and properly adjusted the I/Q offset/drive).  So it's really close:


So yeah.. it works like greased snot.  It's slick.. and impressive.  There are a bag of tricks to make this happen like the MPEG-2 Conexant chip on the PVR-150 configured (in that case, for 3000 MSym/s and 1/2 FEC for 3 MHz wide signal) for a CBR MPEG-2 NTSC D1 video rate of 2222 and MP2 audio rate of 128K which is really quite sufficient for ham use.. actually.. I'd like to experiment with narrower signals!

At 2222/128 the null packets are very small and most times there is negligible PCR lag.. occasionally though the start-up seems to throw off the DSPic33 at this rate and a restart is necessary for a non negative PCR lag.  at 2112/128 this seems never to happen but null packets are about 4.5%.. so somewhere in the middle of the two is probably perfect if you want to run 3 MHz wide D1 Video with decent, but not-quite music quality stereo audio!  That's at least 1/2 the bandwidth of analog ATV.

<SOAPBOX>

Meaning this should be a shoe-in for the 70cm band!  Much better than 2x the quality and 1/2 the bandwidth! Super lets start using it?  Not in my opinion.  Part 97 defines image on Frequency and/or Phase Modulated signals as designator F2F or G2F only.  Commercial definition from researching license grants to commercial parties show that ATSC is 5M38C7W (or in ham speak C7W) and DVB-S as G7W.  No exceptions.. I did not find ATSC defined as C2F or DVB-S defined as G2F anywhere!   These designators are explicitally defined in Part 97 as "multiplexed data". "7" and "W" are excluded from Image!  So even though there is a clause that states that undefined or digital modes that are substantially the same as the analog equivalent in bandwidth for phone and image are legal.. Legally DVB-S/C/T and ATSC isn't IMAGE.. it's DATA.  And data is (WRONGLY!) limited in the 1980's rules as 56K baud (symbols per second per carrier) and 100KHz BW .. so even though NTSC video is not legal anymore anywhere else.. ATSC is mandated.. it's illegal in 70cm under current rules but NTSC isn't.

Yeah, would the FCC enforce this or care?  Nope.  The ARRL doesn't care either apparently.  It doesn't change the fact this is what the law says.  This is a warning, people.  The rest of the world is going digital and as hams we are not.  Are rules are a major reason why.  They were intentionally set up in the 1980's to make digital modes second class citizens on the ham bands.. or at least new digital modes.

If you disagree with me and run DVB-S/S2 or DVB-C and some have on 70cm... good luck and I wish you well-- I support you.. but I see it as not permissible.. which is really quite unfortunate.  It's legal in most other countries that don't have protectionist rules in their regulations.

End of my comments on this... </SOAPBOX>