Sunday, October 1, 2017

Xonik DCO v1.0

The XDCO board arrived friday, and yesterday I soldered one to test it. I cannot find my 2N3904 SMD transistors for some reason, I was supposed to have received 100 of them in my last Farnell shipment but they were nowhere to be found. Instead, I had to modify a regular 2N3904 to fit the SMD footprint. It works fine but looks rather strange - and is of course not very durable. But for testing, it works just fine.

This wouldn't be a real Xonik project if the first version worked flawlessly however. After some initial problems programming the chip (I connected ISCP data and clock to SPI data and clock....), I discovered that I've used ISCP data as DCO CS, and NOT exposed it as a separate pin! That means that it is not possible to program the chip in circuit. I had to add a thin wire to expose pin 13 on the MCU. After doing this, everything worked as planned and I now have a working DCO.

The ISCP bug may be handled two ways:
- fix the bug and re-order the boards
- develop a boot loader and program the chips before soldering them into the circuit, then use SPI for programming later.

I've wanted to do a boot loader for a long time, so maybe this is the motivation I need - we'll see. The price of the board is not a big issue, they cost less than $20.

As for the crystals and speed - On the breadboard the crystals didn't start properly, resulting in fallback to the internal oscillator. I bought new crystals and did some proper calculation on what caps to use (the crystals require 18pF, using two 27pF in series should result in the correct value, see separate post) and now the crystals oscillate at the desired 32MHz right from the start.

Time to test the DCO with the waveshaper!

Update:
While the frequency is ok, the amplitude is off. The output maxes out at around 8.6V. If removing the cap, we get a flat 8.6V meaning something sinks the rest (?).  I tried removing the transistor collector, the opamp saturated to 15V so it is absolutely capable of delivering the necessary voltage. I also tried disabling resetting of the cap and even then the max was the same. The output stays at 8.6V even while programming the circuit. Someting is definitely wrong around the transistor.

BTW: I tried 5 different transistor and three variants of opamps on the breadboard and it still worked fine.

Update 2:
The amplitude issue was just a miswiring of the external transistor, I had mixed up collector and emitter. After changing this, calibration works again. There are some issues with timing and mcu crashes though, maybe related to unfiltered psu lines?

I've also tested and eliminated the 330k resistor from base to ground. it is necessary in the Juno 6 to keep the base voltage between 1.5 and -12.5 (from a 0 to 5v input) to control a PNP transistor. I am using an NPN which is on when the base is > 0.7V and off when the base is at GND, so it can be controlled directly without any biasing resistor. I've also checked the 68k value, it keeps the I_base high enough to allow I_c to be fully sunk while still being low enough to not damage the transistor.

No comments:

Post a Comment