Showing posts with label Hardware. Show all posts
Showing posts with label Hardware. Show all posts

2020-08-08

Redesign XDS110 JTAG Debugger

I have redesigned the XDS110 debugger with isolated pinout. The connector is also redesigned. Now a cable is used so that it is more flexible for different applications. Btw, instead of using the TI standard 14-pin header, a 10-pin 1.27mm pitch header is used. The smaller pin header is more easy to use for smaller PCB.


2018-04-17

My Experience with pocketVNA

If you are working with some IoT hardware projects then you probably need a VNA for antenna matching. In the past, VNA is so expensive that most small companies can't afford it. But we have better choice now due to some PC-based VNAs are available in recent years.

So far, I am working on four IoT projects. One uses 915MHz while the other three use 2.45GHz. In order to fine-tune the PCB antennas, I spent a lot of time to survey a VNA suitable for me. Here is the requirements:
  1. For antenna matching, I don't need a very accurate VNA. The bandwidth of antenna is usually defined at -10dB. So, noise floor less than -30dB is pretty good enough.
  2. The scan speed is not important. I can wait for tens of seconds for a scan to complete because I won't use it frequently.
  3. The price must be as low as possible since I have to buy it with my own money.
  4. VNA with only one port is acceptable. But it will be better to have two ports.
  5. It will be better if the VNA is powered directly by USB port.
The first one I found is MegiQ VNA-0460, it costs €3,990. I try to borrow one from distributor for evaluation. Well, the result is very strange. After calibration, I measured the 2.45GHz antenna on the CalKit. But the minimal Return Loss occurred at 1.95GHz. Very strange! I asked the distributor and MegiQ for help... but no one really wants to help me... probably because I am a very small customer. After emails back and forth for more than three months. I decided to give it up.

MegiQ only provide application for Windows. If you are a MAC user like me, you probably want a macOS native application. The UI design is useful, but not good enough. The detection of VNA device when plug/unplug it in/from USB port is not working well. Sometimes, I have to turn off everything and re-launch them for it to be recognized.

After MegiQ, I try to survey other vendors. I contacted Anritsu. They have office in Taiwan. I thought, well, the service should be much better, but I was wrong. Anritsu's sales called me to see what I need... then... no response any more.

There is another vender called Copper Mountain. But I don't contact them. So, I can't comment on it.

PocketVNA


Finally, I found a company named pocketVNA, located in Germany. They only sell one product, the pocketVNA. The price is very low, only $490. They also provide a very simple and useful calibration kit with only $22. There is only one question: is it usable? The good news is they provide macOS  application. So, I downloaded it to play around. mmm... it is well designed. So, I decided to give it a try.

After contacting pocketVNA by email, I got response the next day. They only sell it through website. So, I payed the money by PayPal and got the VNA device after one week.


PocketVNA gives you a chance to adjust the averaging parameters while scanning. The over-sampling process is helpful to reduce noise. The major disadvantage of pocketVNA is the scan speed. It is pretty slow when compared with MegiQ VNA-0460. So, I try a lot of parameter combinations to find out a useful configuration with acceptable scanning time. Here is my suggestion for Calibration,
  • From: 4MHz
  • To: 4GHz
  • Steps: 1000
  • Averaging: 1
  • Adc AVG: 10
With this configuration, it will spend 16 seconds for each calibration. We have to do OSL calibration for Open, Short and Load conditions. So the total time is 48 seconds plus the time to change calibration connectors. It is a little more than 1 minute to do an OSL calibration.

There will be one calibrated point for every 4MHz. So, we have the following calibrated frequencies: 4M, 8M, 12M ... 3.992G, 3.996G, 4G. Notice that interpolation will be used for frequencies in between.

Then, use the following parameters for Live Measurement,
  • From: 4MHz
  • To: 4GHz
  • Steps: 1000
  • Average: 10
The time for a complete scan is about 44 seconds. It is acceptable for me. If you want a shorter time, the "Average" count can be reduced.

Calibration Issue


PocketVNA has a very useful function, you can assign the port extension length manually. The calibration kit let you calibrate to the end of the port connector. But the cable connects from the port to the target board will cause a phase delay. So, the port extension length can be used to compensate the phase delay.

The real situation is, radio signal will also be attenuated inside the extension cable, it is usually 0 to -3 dB and not uniform. The best way is to calibrate the cable all together. The problem is we usually won't put a SMA connector on the target board. So, the target end of the cable is not SMA connector. The solution for this problem is to use a smaller connector on target board, a U.FL (IPEX) connector can be used. Then we can calibrate VNA to the U.FL connector at the end of the extension cable.

OK, now the problem becomes where to get the U.FL calibration kit? Most venders provide calibration kit with SMA connectors. MegiQ have calibration kit with U.FL connector. It is actually a PCB board with some U.FL connectors. So, I decide to make one for myself. Here is my own version:


In my calibration kit, I can either use U.FL connector or solder the cable on the "pads" directly. This is very useful for target boards without U.FL connector. For this case, a extension cable is usually directly soldered on the feed point of the antenna on PCB.

Finally, we have to understand that the internal RF components inside VNA is very sensitive to temperature. So, the VNA must warn up for 30 minutes before using. Btw, after 10 minutes measurement, it is better to re-do the calibration.

2017-05-12

Customized XDS110 Debugger

You may know that the standalone XDS110 debugger has just been released on March 2017. Before that, XDS110 is only provided as part of LaunchPad. So, many months ago, I had a plan to design a standalone XDS110 debugger. The major consideration is to have the smallest form factor. For this requirement, I designed a new housing for my debugger as shown below.


But after the schematic and layout were completed, the project was suspended due to heavy loading on other projects.

Recently, I realize that I have to complete the project due to one major consideration: I have only one XDS100v3 debugger for all my CC26xx projects. This is dangerous for serious product development.  I must have a backup. So, I have to either purchase a new XDS100 debugger or complete my own debugger.

Now, I have completed the debugger as shown below.


As you can see, the debugger is pretty small. But unlike the standard TI JTAG header, two 1.27mm pitch 14-pin headers are mounted on top & bottom sides of the debugger. The top one has the same pin-order of TI-14 connector. The bottom one is special designed for my own usage.

For most IoT applications, the target board is very small. But the TI-14 connector uses 2.54mm pitch header which is pretty large. So, I redesigned the pin definition for various applications. I call it RC-14. Here is the corresponding connector's schematic on target board.


What makes RC-14 so special? If your target board is really small then you can use cJTAG mode by only 4 pins (pin 1/2/3/4). You may notice that pin-4 is RXD/SWO which is actually connected to the 2nd UART channel (back channel) of the debugger. For JTAG mode (e.g. MSP432) where EMUx is not used then 8 pins can be used (pin 1~8). For old style DSP JTAG connection, you probably need to use all 14-pins which contains EMUx pinout.

You may also notice that cable is not used to connect the debugger and target board. Instead, the header is connected to target board directly. Since the debugger is so mall, there is no need to add a connection cable.

How to Make It?

First of all, I study the schematic from CC2640 and MSP432 LaunchPad to complete the circuit and layout. Then make the PCB by a manufacturer in China who provides the service to make small quantity engineering samples. For the major chip, TM4C129, I request a free sample from TI eStore. For other components, you can get them easily.

Finally, I tested the debugger by connect it to a CC2640-based target board. It can connect to the target and download program without any issue.

It is really great!

The next step is to print the housing for it. But... I don't have a 3D printer yet.

2016-12-13

New Gear Arriaval: Keysight DSOX3024T

A good oscilloscope is always the basic equipment for a system designer. I have been looking for a suitable oscilloscope for a long time. Keysight DSOX3024T is my final choice.


Why DSOX3024T?

  1. The 200MHz bandwidth (and 5GSa/s) is suitable for most applications. I am not going to design IC, the target is circuit board. So, 200MHz is quite enough.
  2. Rich software options. I also purchased the full set software options such as 8 digit counter in order to fine-tune crystal compensation.
  3. The touch control feature make it much easy to operate. Especially, the feature to find the specific area of captured waveform.
  4. The price is acceptable.
  5. The machine can also be upgraded to 1GHz bandwidth. I don't purchase the upgrade option right now. But I know I  have the option if I need it someday.
The only issue is the noise produced by cooling fan. It is annoying, but acceptable. Maybe it is because my working environment is so quiet and I also want to enjoy high quality music while working.

How to choose the right bandwidth for your oscilloscope?


Now, how do I know that 200MHz bandwidth is enough for my applications? Well, to understand the requirement of bandwidth, we need to know what is the most important signal to measure in the target system? Usually we have to measure the clock and data signals. But the fact is, it is not the highest clock/data frequency determines the required bandwidth, it is the transition (rising/falling) time needs to be observed.

According to Dr. Howard W. Johnson "High-Speed Digital Design - A Handbook of Black Magic", the knee frequency is 0.4/rising-time if 20%-80% threshold is used.

    f_knee = 0.4/t_rise

If we want to measure the rising edge of 3 ns then the knee frequency will be 133MHz. And then the required  bandwidth will be 1.3*f_knee = 173MHz. The rule is:

    bandwidth = 1.0*f_knee for 20% timing accuracy
    bnadwidth = 1.3*f_knee for 10% timing accuracy
    bandwidth = 1.9*f_knee for 3% timing accuracy

Most microprocessors have specified the rising time with few nano seconds. For example, MSP432 has specified the digital I/O port with maximum rising time of 3 ns (3V) and 8 ns (1.62V). So, 200MHz bandwidth will be probably enough to design applications with MSP432.

This is why and how I choose 200MHz. DSOX3024T can be upgraded to 1GHz bandwidth if I need to measure signals with higher frequency in the future.

In summary, DSOX3024T is a really good oscilloscope for my applications.

2016-11-03

Current Measurement for Low-Power Applications

For low-power applications, current consumption and measurement is very important to ensure the target board can run as expected. There are several tools to achieve this purpose. As a maker, I choose to design a current-to-voltage converter by using a shut-resistor and an OP-AMP.


Low-power applications usually consume few uA to tens of mA. So, I prefer the converter to be able to measure from few uA to 20mA without changing OP-AMP gain. TI INA225 seems good for my target. The gain is set to 100X and the shut-resistor is 10 ohm, so 1V is got per mA. This is good since the voltage reading on oscilloscope can be easily converted to mA.

In order for INA225 to output 20V (VOUT) for maximum 20mA load, the operating voltage of INA225 must be higher than 20V. For this, a boost converter is used to convert the input voltage (usually 3V) to 22V and then a LDO is used to regulate it to 20.4V. The power supply to OP-AMP, boost and LDO can be from input power source (VIN) or from an aux power source (VAUX). This feature is useful when a coin-cell battery is used. I don't want these circuit to affect the performance of coin-cell battery.

To test it. An ANT+ target board is connected to VOUT. The target will transmit RF signal at 4Hz. We can see the peak voltage is about 12.2V which means 12.2mA. And the period is about 250ms.


KNOWN ISSUE: Everything seems working fine. But I found there is an offset voltage output, about 14mV, when no load. I guess this is caused by the offset voltage of INA225. Mmmm... calibration seems required for few uA measurement. Well, at least this converter is still very useful for tens of uA to 20mA measurement.

When 20mA is drained through shut-resistor, the voltage drop is about 0.2V since the resistance is 10 ohm. So, for 3V battery, the actual voltage applied to target is only 2.8V. This should be fine since the internal resistance of battery will become larger than 10 ohm as time goes by.

Also notice there are three resistors (R7=100, R8=500 and R9=1K ohm) can be selected by jumper. This is used to simulate the internal resistance of battery. When out of battery, the internal resistance of a battery will become quite large, usually hundreds of ohms. With this feature, I can estimate the performance of the bulk capacitors on target board. The bulk capacitors are required to provide instant power for RF transmission. So, this feature let me easily adjust bulk capacitance.

2016-10-18

Upgrade Flash Programmer for MSP430

My MSP430FR6820 project is almost finished and ready for production. It is time to upgrade my CC26xx Flash Programmer for it. For this, the programmer is also redesigned so that 4 sockets are put in a line. It will be more convenient for operator to use.


Though there are many other options to program MSP430. There is advantage using this programmer. One of the benefits is it can automatically add different "serial number" to an assigned memory location. This feature, according to my experience, is very important for production control. And it is sure that I can add more features to help production.

The programmer uses the BSL with UART interface built in MSP430. The default baud rate is 9600 but can be changed. I choose 115200 which is pretty stable and fast enough for most applications. In my test, the time to program a chip is only few seconds. It is probably because there is only 32KB FRAM in MSP430FR6820. For others, the time will be longer if FRAM size is larger. But the actual time depends on the actual program size.

For MSP430 with FRAM, there is no need to "erase" flash memory. And the speed to program data into FRAM is pretty fast. So, the total time to program a chip is massively reduced. Though FR6820 is my first MSP430 project using FRAM, I am very impressed with the flexibility of FRAM. I can say that I will choose MCU with FRAM as possible as I can for future projects.

More information about MSP430 BSL can be found at http://www.ti.com/tool/mspbsl.

2016-07-07

CC26xx Flash Programmer

My CC2640 project is finished and going to mass production, it is necessary to design a flash programmer to program the internal flash of CC2640. For this requirement, I spent some time to design a dedicated flash programmer.

In order to make it both easy to use and general for other SoC, I decide to use PC and "USB to UART" bridge chip. For the USB bridge, I choose FTDI FT4232H because it can support 4 UART ports at the same time. Here is the result.


There is only one USB cable, no extra power cable required. The time to program a SoC is tens of seconds. So, when it is programming the first chip, the operator can continue to put the 2nd chip into the 2nd socket and let it start to program simultaneously. When the 4th chip is put into socket, the 1st one is probably done. So, we can get the best throughput with this programmer.


The above figure shows a CC2640RHB chip inside the socket. The socket is made in Japan to have good contact quality and reliability for long time operation. The socket board is replaceable when it is damaged. It can also be replaced for other package type of CC2640 such as CC2640RGZ. I have preserved the most flexibility so that it is also possible to design new socket boards for other MCUs such as MSP430 and MSP432. FT4232H not only supports UART but also supports JTAG interface. So, in theory, it is possible to support all the MCU with JTAG interface.


I also designed a simple PC side application as shown above. The program will show the final programmed result as OK or NG. It is also easy to add special functions for mass production requirement. For example, it is very common to generate a individual serial number (or MAC address) for each programmed chip. For this, we can let the application automatically increate the serial number and write to a fixed location in the target flash memory space.

That's it.

2016-03-26

CC2650 SensorTag and LaunchPad

Got the CC2650 SensorTag, DevPack and LaunchPad from TI. Thank you TIer. Both DevPack and LaunchPad have built-in XDS110 debugger.  No extra debugger is required to start development.



CC2650 is a multi-standard 2.4GHz ultra-low power MCU. It supports BLE, IEEE 802.15.4 and proprietary radio. It contains a 48MHz Cortex-M3 as the main processor with a rich peripheral features.

2016-03-16

New Arrival - LAUNCHXL-F28069M

Just got my new LaunchPad, LAUNCHXL-F28069M and BOOSTXL-DRV8305EVM. More details can be found at TI website. This LaunchPad would be my first step to implement real motor-control products. I learned lots of control algorithms in NCTU when I was a college student, it's time to go further.