Here out1 is value to be written to the indexed pin, out2 is direction control (1 is output), out0 is pin index. The frequency meter also works, if we change the indexed pin output with mouse very quickly, then the frequency meter can show 1 Hz of detected frequency.
Thursday, May 27, 2021
VIO GPIO Test IP Core and Design
Here out1 is value to be written to the indexed pin, out2 is direction control (1 is output), out0 is pin index. The frequency meter also works, if we change the indexed pin output with mouse very quickly, then the frequency meter can show 1 Hz of detected frequency.
Monday, May 10, 2021
Scriptable UART/I2C Terminal
The need for this tool did come from the test requirement for the CR00040 I2C module, there are four I2C devices onboard and all of them should be checked during factory testing.
A simple test terminal application was used as a starting point, the edit box for the transmit string was changed to a memo to enter "test script". All lines from the memo are sent to the serial port, one line at a time. Two special cases added, when the first char on line is "=" then UART is read and compared to a string with display output on mismatch. On mismatch global RESULT variable is set to false. First char "!" is interpreted as a request for a timed delay in milliseconds.
Adding and testing those new features did take about half a day. While most of the time was spent troubleshooting a really silly bug (wrong string length on transmit).
This is an example output of the scripting terminal. All four I2C devices on CR00040 are tested. The CO2 sensor factory test is initiated, and the result is read back after 10 seconds delay needed by the sensor.After starting the test a result will be displayed depending on the results of the read string comparisons, if all matched, then OKAY is displayed (or FAILED if at least one comparison failed).
Please note that while this tool was developed for I2C testing using the UHSA USB-I2C adapter, the tool could be used for more generic UART testing. It basically sends and receives UART strings having zero knowledge about I2C coded in.
Thursday, March 18, 2021
While I2C is so common interface, yet every time we need to talk to some new I2C gadget, we have to spend some time to get something working. There are USB I2C dongles available that can do generic I2C transactions, but well none on my desk. So when I received this multisensor module, CR00040:
I instantly had a problem with how to test the sensors? What about making my own USB-I2C gadget? I decided to utilize an existing project that provided I2C access over UHSA protocol, the FPGA and NIOS softcore CPU code for this was there, it was developed for another sensor evaluation platform. So to adapt it I only had to change two PIN locations in Quartus. The most work was to trace the SCL, and SDA from the sensor module via PMOD-to-CRUVI adapter back to the MAX10 pins on the MAX1000 FPGA board. Well in any case the "fix" was done within less than 15 minutes. Does it work also? UHSA is ASCII based protocol so it is possible to "talk" using a keyboard and regular UART terminal. Unfortunately, there is little documentation on the UHSA so I had to look into some python code and the NIOS C sources also.sending: <c4k36k82k<c5k..m..m..m..m..m..m..m..m..M>
response: 0000f5e7b89f07c23bf19a
This is pretty good, time spent 15 minutes creating a generic USB I2C dongle for the CRUVI platform, and then well I spent a little more than an hour creating the UHSA strings to talk to the devices.
This is how the setup looks like on my desk:
I am using MAX1000 as a generic USB to PMOD adapter, then there is PMOD to CRUVI adapter (CR00025: pure passive, only connectors) and finally the CRUVI sensor module CR00040. Please note that there is SCD30 mounted on the MAX1000, it is not used in this setup.The full source code of the Quartus project and the NIOS embedded code is open source, so if you have any Intel FPGA board that has a USB UART connection you can easily make your own USB I2C dongle and start working with any I2C devices from any application that can work with UART on the host PC. The NIOS subsystem includes only UART and GPIO, I2C is implemented as bit-bang to the GPIO. While in this example only I2C is supported, the same code can be adapted to support multiple interfaces over the same protocol, so you can talk to multiply I2C buses, or SPI, etc.
First CR00040 samples have been shipped to beta customers. CR00040 is compatible with CRUVI LS format so you can mount it directly on CRUVI motherboards like the VHDPlus Core MAX10.
With a PMOD adapter you can use it as if it would be a PMOD this adds more use cases. Also, CR00040 provides additional pin header holes to solder in pin headers, in that case, you can use fly cable, or insert the CR00040 into a solderless breadboard.
CR00040 will be soon available from Trenz Electronic and Arrow.
Tuesday, February 2, 2021
Repairing HyperLynx files
We are using Altium designer to write out HYP files for HyperLynx. But some of our projects do not load in HyperLynx giving fatal errors on file loading.
Checking out Mentor(Siemens) support website, does not seem like I can enter my case problem there.
But let us see maybe we can see something in the file? The error at file load did give a line number in the source file, so looking at that place:
{NET=NetC147_2
(PIN X=10.301860 Y=6.320791 R=L12.1 P=90)
(PIN X=10.402907 Y=6.399201 R=C147.2 P=79)
{POLYGON T=COPPER L="L 20 S" ID=24813 X=10.4702818 Y=6.3025418
(LINE X=10.4642274 Y=6.2964874)
}
{POLYGON T=COPPER L="L 20 S" ID=24814 X=10.4522364 Y=6.3116777
}
Ah, where is the FIX? Well, our software designer wrote the utility that does remove those offending lines with less time I spent writing this blog entry. Needless to say, the utility worked.
There is another bug with Altium HYP export: some PCB files with complex board outline will load wrong, they can look as if you have a triangle board outline. I do not know a real fix other than temporarily using a rectangular board outline for the HYP export process only.
Friday, January 22, 2021
UHSA UART High Speed ASCII
UHSA stands for UART High Speed ASCII protocol. The protocol is designed to be very low level to be able to tunnel binary data to multiple streams. The encoding is ASCII so it can always be entered from a regular terminal program. The protocol is very simple and can be handled by microcontroller or FPGA code directly.
I really haven't had time to ever publish the protocol, but it is internally used in several products. One of them is TEI0010 a small sensor demo board. It is still available from Arrow online shop.
If you want to use this board for USB to I2C bridge then you need to change IO location for two pins:
You possibly also need to change the IO standard to 3.3V LVCMOS.
Wednesday, January 20, 2021
Xilinx PUDC_B behavior
Xilinx has lots of datasheets and documents describing their products. Still, it is sometimes not possible to know how Xilinx devices work. An example is the PUDC_B pin. This pin controls the pre-configuration pullups on I/O pads. When driven low then pullups are enabled. In 7 series this pin is located in a normal IO bank. So how do we disable the pre-configuration pull-ups? We need to drive PUDC_B to high (using a pullup resistor), in order to do that we need to supply I/O voltage to the bank that includes the PUDC_B pin. But when that power supply ramps up then initially PUDC_B would sample low and enable all pullups? So there must be a short time when pull-ups are enabled regardless of the PUDC_B pin?
So what it is? Does PUDC_B=high (resistive pull-up) really guarantee that pre-configuration pull-ups are disabled? Need to test. Need a suitable FPGA board first.
TE0723 Zynq Arduino board has PUDC_B pin accessible for measurements. Attaching DSO probes to spare I/O and PUDC and VCCIO of the bank.
And what we see? The spare I/O pin does indeed get pulled up, reaching 0.9 volts then dropping back to 0 when PUDC_B voltage reaches about 1 volt. Sure 0.9 volts is not yet logic high, but it is also not anymore valid logic 0 either. So the conclusion is that PUDC_B does not fully disable configuration pullups as the input reference is at about 1 volt causing the internal pullups to be enabled during power-up for short time.
Here at Xilinx forums some DSO screenshots!
Thursday, January 14, 2021
GOWIN LittleBee development board
Pre programmed demo design is from RISC-V competition, it should show the following on the UART Terminal (115200, 8N1):
Note: depending on the production batch the boards may be unprogrammed from the factory. Note: you do not need GOWIN tools license to use the gowin programmer.
With empty FTDI EEPROM you need to select the second UART assigned to the board.
TIP: the GOWIN boards are delivered with empty FTDI EEPROM so they will enumerate as two UART's - it is OK to disable VCP loading for the channel A, then you only see one COM port assigned to the board.
Select D2XX for Channel A and click program.








