Honey, I shrunk the ki–ahem, the board!

This could be me, showing my wife the new board!

After a friend’s advice, I decided to take some days off coding (which was what I really ought to do next, to be honest). I still need to troubleshoot my hardware to correct some clicking sounds (that do not come from missed USB packets), write an Asterisk channel driver, debug that driver, bring up an Asterisk system, probably set up an IAX or other link to a friend’s Asterisk and start running exhaustive tests. All this felt a bit too stressful, so as I already said, I decided to take a break and do something more fun.

What was so fun that I chose to do? Well, I redesigned my board from scratch, this time into a “dongle”-like form factor, that is, into something that can plug directly into the USB port of a computer. Here is the result. In this image you can see the top layer and component placement. In the image below, you can see the bottom layer and component placement.

To be honest, my effort has failed. A true dongle has a size only slightly larger than a type A usb male plug. My new board is 30 mm wide, so it’s much wider than a true dongle. However, it is not so bad as a first attempt and it is considerably smaller than my previous board. So I thought about publishing the design and, maybe later, after giving it a bit more thought, I may (or may not) attempt to shrink things even further.

Please note that this is totally untested. The board has passed Eagle’s DRC tests, however it may still contain serious errors that will show up either at production time or when one attempts to assemble it (e.g., incorrect placement of components), or operate it (e.g., interference, etc.). This is just to let the readers of this blog know that a “dongle”-like version of Open USB FXS is possible after all. Nevertheless, I may stick with this design, and try to manufacture a couple of boards in this form, and, if things work out OK, then I ‘ll upload Eagle source files on the project’s Google code site. In the meantime, you can just enjoy the big news — or maybe not so big, after all…

Update, Feb 14 2010: the dongle board is now more than a couple of Eagle files. I have had a couple of professional quality real PCBs manifactured and shipped to me (I used the Elektor magazine PCB service, in case you are interested — actually a franchise of Eurocircuits, but enough now with advertising, especially since I don’t get payed for it, nor do I intend to). I have not yet started mounting anything on them, but I think they look beautiful, so I decided to post a couple of PCB shots. Here they are:

The shot above shows the dongle’s top-side. On that side, I have placed the 3210, the bulky shielded power choke and the rest of the DC-DC converter circuitry, the PIC’s oscillator crystal, and a SMD DIL switch to replace S1 and S2. On the two ends of the PCB go the connectors to the outside world, a male type A plug that gets soldered on-board and the RJ-11 receptacle.

The shot above shows the bottom side. On that side I have placed the PIC and most of its related materials (pull-up resistors, user LED — this is placed right under the RJ11 receptacle –, etc.) and the 3201 line driver and associated circuitry. I hope you enjoy the shots.

One remark is that the PCB manufacturer has not produced a silk mask for the bottom side of the board, although I produced and submitted one. This makes the bottom side less “readable”, however this is the least of my concerns now. I am to make a working Open USB FXS out of this PCB, and from my experience this is the thing to worry about. Especially, since I am running out of stock in prototype 3210’s, and these days it seems that none of the big worldwide stock houses have them in stock. All this means that I ‘ll have to make my best to get my dongle board work with the first shot. We ‘ll see.

Another piece of news is that I changed the unrated-voltage capacitors that I used in some of my (original, large-form) prototype boards with correctly-rated ones. So, I am proud to announce that now one of my prototypes works perfectly well: no noise, no clicking sounds, no Darth Vader sound effects, perfect voice recording, perfect reproduction. Trust me, it feels really reassuring to have one perfect prototype after all this time! So now, I am going to progress with the dongle and the channel driver in parallel. What will come first? The next post will show…


6 Responses to “Honey, I shrunk the ki–ahem, the board!”

  1. sal Says:

    hi!! Your project is great..i have only one question… do you need to install driver on windows when you put the dongle in? and if yes why you don’t use usb audio class already inside windows? Thank you Salva!

  2. Angelos Varvitsiotis Says:

    Hi Salva,

    Thanks for your comment. Unfortunately, there is no Windows driver for Open USB FXS yet. The only driver that exists is for Linux, and the whole Open USB FXS project is targeted for Asterisk. As for the audio USB class, this approach has several issues. One, when I first started the project, Microchip’s stack for PICs did not contain an audio-class device. Second, audio class assumes a varying packet size, whereas my primary goal was to have Open USB FXS deal with fixed-size packets or chunks, as Asterisk does (the whole project is targeted for Asterisk). Third, and most important, the (now existing) audio-class USB device example from Microchip assumes a PIC 18F4455/18F4550, which has a streaming parallel output port. However, Open USB FXS employs serial I/O, driven by an Interrupt Service Routine (ISR), which can run on a 18F4x5x, but requires a smaller 18F2455/18F2550 to run. Utilizing 18F4x5x’s streaming port would require me to add to the circuit one or two bidir shift register(s). The more costly 18F4x5x and the extra shift register chip would add a bit to the circuit’s cost, but also to its complexity (and hence to the debugging I would need to do). For all these reasons, I have dropped the idea of an audio-class driver.

    Nevertheless, the audio-class USB device is a valid design alternative, and I leave it as a future exercise to myself, or to any reader who would like to modify Open USB FXS.

    Thanks for asking this question (I was too lazy to write all this on my own, but I will probably add the answer to the NQ-FAQ).



  3. sal Says:

    Angelos you are very great! Nobody could explain better! Now another question..is ths si3210/01 that need serial I/O or you implement the circuit in this manner? if i really want to use a parallel port do i really need bit shift register? or can i use GPIO?
    Thanks Salva

  4. Angelos Varvitsiotis Says:

    Hi Salva,

    Yes, the Si3210 sends and receives PCM audio data serially (you should really read the chip’s datasheet). To make things just more complicated, the PCM bus’s minimum clock frequency is not 64kbps, but 256kbps, and the PCM data transfers occur over every first 8 out of 32 clock cycles, the next 24 cycles being left empty (the intention of the manufacturer behind this is to support more than one Si32xx’s on the same PCM bus, so the remaining 3×8=24 clock cycles can be utilized by three more chips on the same bus, which would start their PCM I/O at cycle #8, #16 and #24 resp., instead of #0 — the starting cycle is configurable per chip). The PIC’s parallel port handles data in a parallel manner, full stop. So, if you want to use it with the 3210, you have to convert parallel to serial and vice versa. The cheapest way to do this is via a bidir shift register. A more complicated way is to craft a CPLD device.

    Since you mention GPIO (general-purpose I/O), this term does no more exist in PIC microprocessors (nearly all PIC’s ports are GPIO, probably that’s why). I am already using four of PIC’s general-purpose I/O bit ports for serial PCM clock, input, output, and fsync (a marking pulse) in my PIC firmware. If you are talking about some other chip, yes, one could use a GPIO port for I/O, but one should play some tricks to implement the other signals as well (clock and fsync). See for example how David Rowe tricked the 8250 UART into playing the intermediary between the OS and the Si3210 for the mesh potato project.

    I hope these answer your question, since I am not sure I understood it very well anyway.



  5. sal Says:

    Hi angelos thanks for the reply. Yes I was a little confused. Now I’m clarifying my ideas. I don’t download the microchip stack yet but i’d like to have a suggestion. Do you think that i could use the audio class example (modifying the source) using serial connection (without shift register)?
    And now….a newbie question.. how do you develop your prototypes?
    Just because i am little worried about smt soldering. Thanks Salva

  6. Angelos Varvitsiotis Says:

    Hi Salva,

    For as much as I have looked at it, the audio-class USB example in Microchip’s SDK makes use of the SPP (streaming parallel port) that is supported in some PICs, but not in the 18F2550 that Open USB FXS is based upon. You might work along the lines of that example in order to pass PCM data out serially to the 3210 using the exact same hardware of Open USB FXS. To that end, you would have to hack your way rewriting (a substantial) part of my TMR1 ISR code (it is in “tmr1_isr.asm”). The basic idea would be to keep the ISR dealing with the PCM I/O among the PIC and the 3210, but to remove all the USB I/O from in there (USB I/O occurs in “userland” in Microchip’s example, not in an ISR). You would then have to implement some sort of a ring buffer (actually, two such rings, one for IN and one for OUT) in order to pass data between the PIC’s “userland” USB I/O and the ISR. Beware, I am not sure that all this is doable. It is for sure worth exploring, but requires a lot of time and effort, and you may end up with something that does not work at all, due to the relatively low speed of the PIC.

    One more word of warning: Microchip’s example implements just a one-way audio device. Here, we would need two such devices, one for input, and one for output. I do not know for sure, but I think this would have to be a composite device; there is no such example from Microchip (yet), so you ‘d be on your own creating one and making it work.

    As for SMD soldering, things are not so bad. I have hand-soldered all my prototypes using an Antex 17W iron. If you have never soldered SMD before, you had better practice on some easier constructions before starting out an Open USB FXS board. The hardest part soldering is the 3210. I have found that the best method for that is to apply a little solder on all smd copper pads, so that a tiny “frozen drop” of solder is formed in the outer end of each pad (excess solder must be removed). Then, one must place the chip on the board, stabilize it with some method (a pressing weight, some glue, whatever) and heat again the tiny frozen drops at the end of each pad, pushing them towards the respective pin of the chip until the pin is covered by solder. Soldering discrete components is different — and definitely easier. One develops one’s own ways by practicing. You should be prepared to waste one or two prototypes though, because sometimes nasty things happen (like excessive heat causes the tiny pads around the 3210 to get off the surface of the board, practically making the whole board useless).



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: