Monday, May 28, 2007

Postcard #10 - New purchases

Scroll to the end of this post to see a summary.

Well, I've been out on a bit of a hiatus. In addition to being ill, I've had the usual domestic responsibilities plus lots of stuff at my day job. However, I did make some progress in the acquisitions department.

First, I found a cheap copy of Build Your Own Printed Circuit Board. For $13 on eBay I figured that I couldn't go wrong. I'll report back on what I think of this book at a later date.

Second, I bought a development/learning board, the Spartan 3 starter board from Digilent. I figure this is a great item for getting familiar with embedded programming and how to handle FPGA's.

Third, I bought an Oscilloscope! I know I'm crazy, but I decided that if I'm gonna take the plunge, I'm going in head first and eyes wide open. It only set me back $181 out the door, so that's not so bad. It's an older Tektronix unit, the 2445. I figure it's a good place to start since it has four channels and a bandwidth of 150Mhz. (I hope that's enough for my projects!)

Of course, I have been reading as well. Not too much, just some light stuff. I've started on Understanding the Linux Kernel. I'm trying to get a feel for how the Linux kernel is related to the physical hardware. So far it's very interesting stuff. The book is a bit huge, but then again, so is the kernel. I'm starting from the beginning to make sure that I don't leave myself with too many knowledge gaps. Once I feel comfortable with the basics then I'll probably jump ahead to devices and drivers, specifically the PCI stuff and then the USB chapter.

None of my new toys have come in yet. When they do I'll get my lab set up. My boss has been totally cool about all of this - it's her money and therefore her stuff. I told her that I've been pouring her money into my brain. She's okay with it as long as I can apply the knowledge to our business. That, of course, is the challenge.

I'll be back next time with more tidbits that I've discovered.
-MC

Tuesday, May 15, 2007

Postcard #9 - Book Review, (g)EDA update

Scroll to the end of this post to see a summary.

Well, I've been doing a lot of reading lately because that's all I can do right now. I've been doing a lot of basic electronics refreshing. My trusty Radio Shack learning lab has been pretty fun. The little project books that come with it are well-written, and you can tell that the author, Forrest Mims, is genuinely enthusiastic about electronics. The exercises aren't brain-busters by any means. However, the act of physically laying out your components, double-checking your connections, then triple-checking your connections before flipping the power switch, is great practice. I can feel the character building inside... :)

I finally got all of the gEDA stuff running on my laptop. I had to go back to Centos 4.4 and I did a 'workstation' install. I still had to do the manual install because the installer program is broken badly. (It is a Python script that relies on a GTK library prereq that is missing/broken/messed up.) Anyway, it seems to be working, so at some point I can start playing around with circuits without actually blowing stuff up. For kicks, I downloaded TinyCad to get a different perspective. I'll report back my opinions at a later date.

Lastly, the books. I've moved away from USB Complete for a while so that I can focus more on the basics. I've been perusing Digital Electronics Demystified and I've been slurping down Designing Embedded Hardware. Here are my thoughts:

Digital Electronics Demystified - The author starts out with a good explanation of Boolean logic, but he quickly digresses into an overwhelmingly confusing discussion of what I can only describe as the logic version of spaghetti code. This was to set up the introduction of two related principles: the "sum of products" and the "product of sums." Good principles, poor introduction. Mercifully, the chapter ended and the next chapter got back to basics. I'm not keen on the author's style, although when I looked up a specific chip - the 555 timer - his entry and explanation were actually pretty good. I'm continuing this one with guarded optimism.

Designing Embedded Hardware - This is an instant classic! The author knows his stuff and presents it very well. You can tell that he is not merely an expert in his field of study, but that he is also an educator. I'm really enjoying his book so far. (I've just got to chapter 4.) The principles of embedded design translate nicely into the idea of building self-contained peripherals. I can highly recommend this book, which I personally got from an eBay auction.

Thanks for letting me ramble. If you have any reading suggestions I'd love to hear them. I'll be in touch soon, hopefully with something more substantive.

-MC


Summary:
  • The Radio Shack learning lab I bought is not glamorous, but is fun and useful for getting back to basics and practicing circuit design and layout
  • Finally got gEDA working with Centos 4.4
  • Have been reading a few electronics books. Designing Embedded Hardware is an excellent read, a book I can highly recommend to anyone interested in learning more about the subject.

Friday, May 11, 2007

Postcard #8 - Knowledge vs. Naivete

This is just an update on my status since beginning this project.

When I started, things looked like this, on a scale of 1 to 10:

My knowledge: 2.9
My naivete: 9.6

After one week of reading, researching, and ruminating:

My knowledge: 4.4
My naivete: 3.9 (!!!)


I wish my knowledge level was increasing as quickly as my naivete level is plummeting! :) I understand now just how challenging this project is really going to be. However, I'm not ready to give up after only one week and no lab testing.

See you next time.

-MC



Thursday, May 10, 2007

Postcard #7 - Protoypes, Breadboards, etc.

Scroll to the end of this post to see a summary.

Lately I've been looking at ways of doing prototyping without trying to create my own PCBs. Since my goal is to have a T1 connect to a USB port, I must have at least those two elements. However, I'm 99% certain that I'll need intermediate logic and circuitry, which is where the FPGA comes in. That leaves me with at least three different prototype/breadboards:
  1. USB prototype board, like the CY3682 from Cypress
  2. T1 SCT prototype board, like the DS2155DK from Maxim/Dallas Semiconductor
  3. FPGA prototype board, like the Nexys, Basys, or S3BOARD from Digilent
Here are some notes on the above items:

First, the USB prototype boards from Cypress seem to be in low supply, and they cost about 500 USD. I'm not sure what that's all about. There is a MoBL ('mobile') version but I'm not entirely certain that it is what we're looking for. An alternative might be the USB2 from Digilent. Technically it's just a communications board that allows the S3BOARD to be USB-ready, but I contacted Digilent tech support and they said that it could be jury-rigged to work with the Nexys or Basys. NOTE: messing with the USB firmware on the Nexys or USB2 will void the warranty! Digilent also has lots of other accessory boards for the mad scientist types.

Second, the DS development kit is 400 USD and it includes the DK101 low-cost motherboard that can be used with other Maxim development kits. This may be my only option other than trying to design my own PCB and having it manufactured or creating my own the old fashioned way. I will keep looking before I drop the money for this one. One thing I'll do more research on is the possibility of a small, custom breadboard by utilizing something like an SMT
adapter. I'll report back when I know more. [ UPDATE: I found some handy stuff at beldynsys.com. Specifically, I found a socket adapter for QFP100 packages.]

Third, I am REALLY impressed with the Digilent products and tech support. They answered my questions very quickly and were quite helpful. I expect that I will be ordering a Nexys board here very soon. (100 USD)

If anyone out there has experience with creating PCBs, especially in doing breadboards with SMT components then I'd be very interested in your input. Please feel free to leave a comment.

That's all for now...

-MC


Summary:
  • I'm researching development kits for USB, FPGA, and T1 SCT
  • Digilent has very cool stuff
  • USB and T1 prototyping seem more difficult (i.e. more expensive)
  • I'm doing more research into other options for SMT prototyping

Tuesday, May 8, 2007

Postcard #6 - FPGA's, PCB's, and (g)EDA

Scroll to the bottom of this post to see a summary.

Well, I'm still gEDA-challenged right now, but that's because I haven't had much time to sit down and coax it into working. In the meantime I've been doing other research...

I found some interesting sites that talk about PCB fabrication:
My goal here is to find some help for the production of the PCB's and, where possible, get some assistance w/ component layout, etc. I'm also hoping to get an idea on the prices we're looking at for a project like this. Mostly, though, I'm just trying to learn more about the process of PCB creation since I haven't touched the subject since high school.

I'm also looking into FPGA's to get an idea of what we need, what they can do, how much they cost, etc. I've also looked at some of the development kits that are available. I'm not ready to throw down much money (yet) because I'm not quite there yet, although I did see some really inexpensive FPGA learning kits on eBay. (~16 USD) I also found a very cool set of products from Digilent. They have several FPGA starter kits, ranging from 50 - 150 USD. They also have add-on boards for mad-scientist tinkering. I'm seriously considering picking one up. In the meantime I've printed out the Xilinx Spartan-3 family datasheet. It is definitely an improvement over the Spartan-2 datasheets.

That also lead me to another question: how am I going to test my circuit? The only thing I could think of is an oscilloscope. Curiously, there are open source oscilloscope projects out there, including one with a cool USB attachment that runs about 200 USD. Again, I'm not willing to part with lots of money until I at least give the 'free' options a chance to shine. I'll report back after I've had more time to digest all of this stuff.

-MC


Summary:
  • I suck at getting gEDA to work
  • There are lots of firms that produce PCB's - prices vary widely
  • I have Xilinx Spartan-2 and Spartan-3 datasheets for 'light reading'
  • Digilient has cool starter boards for learning about FPGA's
  • I'm research O-scope options for a limited budget

Monday, May 7, 2007

Postcard #5 - Digging Deeper into the T1

Scroll to the bottom of this post to see a summary.

I've started re-reading Matthew Gast's T1 - A Survival Guide. The last time I read it, I was simply looking to answer some specific questions while attempting to connect my Asterisk box to my NEC NEAX 2400IPX PBX at my work. (BTW, I was able to successfully connect my Asterisk and NEC PBX's using the quad T1 (T400P) card I have - both with 'line side' and 'trunk side' T1 cards in the NEC.) This time around I am trying to get a deeper and more complete understanding of the T1 spec. Fortunately, I've been a 'telephone guy' for about 12 years, so the telco jargon doesn't affect me anymore.

I have to give Gast two thumbs up for his book. It is shamelessly focused on American telco and history, but since I'm in California I don't mind. Besides, many of the principles apply on a broad scale, and the specifics of E1's (Europe) and J1's (Japan) can be gleaned from other sources. I have no intention of being Yankee-centric on this project - I guarantee that I will get as much help from around the world as I will domestically. (In fact, the only person to contact me so far is not from the Western Hemisphere.)

Thus far I feel comfortable with the basics of the T1:
I have also started digging into the specs of what I suspect will be the IC that is used for T1 communications: the Dallas Semiconductor DS2155. This is a single-chip transceiver (SCT) that seems to have lots of capabilities. The quad version of this chip is what drives the T400P boards that I currently use with my Asterisk boxes.

I printed out all 238 pages of the data sheet, plus a nifty application note about creating a circuit to connect to the telco and how to protect my circuit from voltage spikes, etc. The data sheet has all sorts of detailed information that I believe will be useful once the firmware and device-driver stages are being considered. I'm reading it now because I'm hoping to find any red flags and address them before I get too far into the project. If this chip is not suitable for the project then I need to know ASAP so that I can go elsewhere. If anyone has any experience at all with this or similar SCT's or T1/E1/J1 framers, by all means send me your feedback and advice.

I've learned a few interesting things about T1's so far: timing is inferred from the bit stream - an interesting concept. (Yes, there are LOTS of timing and clocking factors but I don't have time or space to list them all.) Also, the time slot for a single bit is 684ns. An entire extended superframe (ESF) has 24 8-bit frames for a total of 192 bits. That's a little over 131 microseconds for an entire frame to be read! Yeah, that's fast. It makes me wonder about how easy (or difficult) it will be to get the datastream to and from the USB controller without messing up the clocking. We'll see.

I have ordered a pair of DS2155's (free samples) from Maxim for use in my 'lab' - such as it is. By lab I mean "a cubicle at work that no one is using at the moment." Still, it's clean and quiet and the boss lady doesn't mind as long as I get all of my regular work done. When I get my units I will then start looking at the other fun stuff of this project: PCB's, FPGA's, USB Controllers, various components, etc. In the meantime I've been perusing the spec sheet of the DS2155 in an attempt to familiarize myself with its capabilities. I've also been looking at the original Zapata telephony Tormenta2 specs since it uses a similar SCT, the DS21Q352. (The T400P's that I have are very similar but they use the slightly more updated DS21Q55 - the quad version of the DS2155.) One thing I appreciate is that Jim Dixon has lots of schematics for viewing, which is cool because it helps me visualize the flow of data from the smart jack to the PCI bus and back. While this isn't totally analogous to the flow of data to/from the USB controller, it is a good jumping off point.

The next postcard will have an update on my (lack of) progress with gEDA, plus some research into the world of PCB fabrication.

-MC

Summary:
  • I'm re-reading T1 - A Survival Guide to fill in the mental gaps
  • I'm happy to report that one person so far has helped me with the project
  • I've printed out all 238 pages of the DS2155 spec sheet, plus app notes from Maxim
  • I've been looking at the original Zapata Tormenta2 specs for education, inspiration





Sunday, May 6, 2007

Postcard #4 - Learning About USB

Scroll to the bottom to see a summary of this post.

I've just finished reading chapter one of Jan Axelson's USB Complete. I can already tell that it is going to be an excellent book. Her software examples are Windows-centric but the principles she presents apply to any USB-compliant OS. She specifically mentions Linux and Mac OS X as being in the latter category.

After just one chapter I feel like the USB spec is much less of a mystery. I still don't know just how I'm going to create my magic gizmo yet, but at least I have some great information on what technical challenges lay before me. Jan does a good job of defining all of the "who does what" in the USB specs: the USB devices, the USB controller, USB hubs, and where the software fits in - both firmware within the device and the device drivers within the OS. And it's only chapter one!

The first potential red flag for me was reading about the truly serial nature of USB. Only one device gets to communicate at a time on the bus. However, with bus speeds of 12Mbps and 480Mbps I think USB is up to the challenge. (There is also the slower 1.5Mbps speed.) Also, a device can request of the controller a maximum delay between communication exchanges. I'm hoping to find a happy medium in this regard so that my device will function properly and still coexist with other devices on the same bus.

I also got a good pointer from someone with experience in this area. (Anonymity preserved, just in case he wishes it so.) He mentioned that the USB bus can handle these kinds of speeds, in terms of number of interrupts per second, that is, but it can be tricky. He also mentioned that the Linux USB stacks in kernels 2.6.8 and 2.6.9 are sub-par, and that's putting it nicely. I plan to do much of my initial development in Windows since I seem to have more resources in that arena. However, I have no intention of neglecting Linux. In fact, I have no intention of neglecting Max OS X, except that I know zero about Macs and I don't have access to one. Any volunteers who'd like to help are more than welcome to contact me.

Now I'm off to dig up more about the T1/DS1 specs and my DS2155 chip...

-MC

Summary:
  • USB Complete, 3e, is a great book, even after just one chapter
  • The ability of the USB bus to handle the speed needs of a T1 is a big question
  • The Linux USB stack is still maturing and is not the best place for initial development






Saturday, May 5, 2007

Postcard #3 - gEDA, etc.

I've decided to add a summary at the end of each postcard. Scroll to the bottom to see the gEDA, etc. summary.

Last night I downloaded gEDA. I just burned it onto a CD today while babysitting my two kids. Mommy needed a break so she went to Wal-Mart. I tried loading it on my old Dell Inspiron 9100 laptop but I kept getting an error. After some digging, I found out that the Ubuntu guys have whipped up a package for an older version of gEDA. No thanks.

I've decided that I'm not ready for Ubuntu and it's not ready for me, at least not yet. I've done Centos and Red Hat installs scores of times, so I'm sticking with those for now. I'll re-install Linux on my laptop (which I'm dual-booting with WinXP) and I'll use the new CentOS 5.0 DVD that I'm downloading with BitTorrent.

I'll document my progress on that one later on. My next postcard will be about some more specific research that I've been doing.

-MC


Summary:
  • Ubuntu Linux not ready for latest gEDA
  • I am not ready for Ubuntu
  • I am moving on to more specific research



Friday, May 4, 2007

Postcard #2 - Getting Information

Now that I've started pursuing this crazy idea, what next?

Well, I've got several books handy from when I started working with Asterisk, most of which I got used off of eBay:
I have since found out that there is a new edition of the VHDL book, but I'm holding off for now.

I even went and bought a cool little breadboard training kit from Radio Shack. Glamorous? No. Helpful with getting to know electronics after a 15+ year hiatus? Yes. Not a bad $70 to spend to play with all sorts of transistors and IC's.

I spent a fair amount of time poring over the source code and schematics of my quad T1 cards. They are a clone of the Digium Tormenta2 PCI Quad T1 board. They even use the same drivers, except that the designer of my board has made some modifications. Anyway, that project lead me to some interesting information:
This was almost too much information! However, I digested it as best I could. It turns out that I was able to learn quite a lot about embedded software, including the relationship between hardware, firmware, and software. I also was introduced to FPGA's and VHDL, both of which I had never heard of. Very cool topics.

Recently I purchased a few more books, as well as downloading O'Reilly's Linux Device Drivers 3rd edition. Of course, where possible I bought used on eBay or half.com:
I got the Linux books because kernel programming and embedded systems are closely related to getting down and dirty with writing software, drivers, firmware, etc. that get seriously intimate with the hardware. I needed to start somewhere, so there I did. If anyone has other suggested reading then I'd be willing to check it out. I'm a book addict.

One other place I looked that opened up a whole new can of worms, in a good way, is David Rowe's website. I've only just scratched the surface on his offerings, but the Free Telephony Project looks totally cool.

At this point I've just started reading about USB's capabilities. It has three different bus speeds, and I think the two higher speeds will be adequate but I won't know until I really get into this hip-deep.

My next postcard will be from my journey through OSS for creating, designing, and testing digital circuits and creating PCB's. (Printed Circuit Boards.)

-MC

Postcard #1 - I must be crazy

I had an idea.

I'm a telecom/datacom/computer geek. I like tinkering. I like OSS. I even like Windows, at least Windows 2K/XP. Not a fan of Elmer F.U.D. - er, Steve Ballmer - or of Vista, but that's another discussion...

I like OSS telephony apps, specifically Asterisk and FreeSWITCH. I like playing with T1's. I work at a call center and I have T1's, PRI's, PBX cards, etc. to tinker with. It's fun, at least for us geeks. I have a few quad-T1 PCI cards, and they work very well, but they're limited to Asterisk right now. (Long story having to do with GPL...)

I wondered to myself if someone had created a USB T1 interface device. The answer is yes, but it's WAY too expensive for a tinkerer. I posted my question on the Asterisk user mailing list. To my surprise, a lot of people offered cool ideas for the use of a USB T1 interface device, but no one knew of any that existed. That's when it hit me:

I'll see if I can build one myself! Hence the title of this post.

This blog is dedicated to the relating of the details of my journeys through OSS software and hardware. I welcome any insights, anecdotes, offers of help, donations to help pay for my therapy, etc.

You are welcome to tag along. But please, don't let me hear, "Are we there yet?"

-MC