- 49
- 96 636
Grug Huhler
United States
เข้าร่วมเมื่อ 5 ส.ค. 2022
This is personal channel for electronics as a hobby.
MCP4131 unusual Bidirectional SPI explained and shown on Raspberry Pi using SPIDEV
The MCP4131 digital potentiometer uses a SPI interface in an unusual bidirectional way. This video dives deeply into exactly how this works and presents advice on its proper use. A Raspberry Pi interfaces with the MCP4131 using SPIDEV from user space. It's tested on a Raspberry Pi Zero and a Raspberry Pi 3B.
Contents
0:00 Introduction
0:38 Connections
2:14 SDI/SDO capture
3:02 SDI/SDO open drain
3:38 A model of this
4:42 Writes and the smart pull-up
6:25 Reads need R1
6:52 Pi must drive HIGH
8:00 Usage Summary
8:36 Test setup
8:47 System in action
12:30 Software
Watch this video for a general introduction to digital potentiometers and what to do with them: th-cam.com/video/AqeGskH0usY/w-d-xo.htmlsi=StkQyB43F9yTYdXg
Get the test software from github:
git clone github.com/grughuhler/grug_misc_projects.git
cd grug_misc_projects/raspi_mcp4131/
and look at the README there.
Contents
0:00 Introduction
0:38 Connections
2:14 SDI/SDO capture
3:02 SDI/SDO open drain
3:38 A model of this
4:42 Writes and the smart pull-up
6:25 Reads need R1
6:52 Pi must drive HIGH
8:00 Usage Summary
8:36 Test setup
8:47 System in action
12:30 Software
Watch this video for a general introduction to digital potentiometers and what to do with them: th-cam.com/video/AqeGskH0usY/w-d-xo.htmlsi=StkQyB43F9yTYdXg
Get the test software from github:
git clone github.com/grughuhler/grug_misc_projects.git
cd grug_misc_projects/raspi_mcp4131/
and look at the README there.
มุมมอง: 107
วีดีโอ
Tang Nano 4K Cortex M3 APB Access to FPGA-Based Designs
มุมมอง 390หลายเดือนก่อน
This video provides examples of creating APB completers on the Tang Nano 4K FPGA development board. The completers are modules that use the ARM APB2 protocol and implement memory-mapped registers that software on the FPGA's Cortex M3 can read and write. One completer does nothing but implement 4 registers; a second implements a simple PWM controller. Both completers are in Verilog and provide a...
Tang Nano 4K: Getting Started with Its Cortex M3 Core
มุมมอง 482หลายเดือนก่อน
This video presents the Tang Nano 4K FPGA development board and shows how to run software on its ARM Cortex M3 hard IP core. The Tang Nano 4K's most interesting feature is this M3 core. Chapters 0:00 Introduction 0:46 M3 Subsystem 1:55 Tang 4K board 2:36 Board pinout 3:40 Verilog 5:34 M3 instantiation 7:28 Project running 9:16 Documents 12:29 Software 17:41 USB adapter 18:01 Summary Getting sta...
Consistency of Pulse Per Second Signals from Two GPS Receivers
มุมมอง 2262 หลายเดือนก่อน
This video uses the FPGA design from my previous two videos to measure pulse-per-second (PPS) signals from two GPS receivers. The goal is to compare them for consistency. The measurements are from a Tang Nano 20K FPGA development board. Chapters 0:00 Introduction 0:39 Measurement goals 0:55 FPGA design 1:55 Edge time differences 3:27 Period differences 4:23 Summary Previous videos: th-cam.com/v...
GPS disciplined High Accuracy Timers on Tang Nano 20K FPGA
มุมมอง 5292 หลายเดือนก่อน
This video shows how to control the frequency of counters on an FPGA using the pulse-per-second (PPS) signal from a GPS receiver. This allows the counter frequency to be very accurate. The project supports both the Tang Nano 20K and Tang Nano 9K FPGA development boards. The FPGA contains a PicoRV32 soft RISC-V core that runs software that implements a feedback loop that maintains the counter fr...
Ultra-Precise Timestamps and Counter Frequencies on an FPGA (Tang Nano 9K)
มุมมอง 4652 หลายเดือนก่อน
This video shows how to create counters whose rate of counting can be very precisely controlled. The design includes a facility to allow GPS time synchronization for accuracy that will be the subject of a later video. The demonstration uses a Tang Nano 9K FPGA development board. A project file for the Tang Nano 20K is also provided, but the technique applies to any FPGA. We show a frequency cha...
Tang Nano 9: Use FIFOs to cross clock domains
มุมมอง 3302 หลายเดือนก่อน
This video shows a simple example of using a Gowin soft IP FIFO to transfer data from a fast to a slow clock domain. It runs on a Tang Nano 9K FPGA development board. Chapters 0:00 Introduction 0:28 Clock domains 1:29 FIFOs 2:34 Bad implementation 4:55 Failure observed 5:08 Good implementation 7:49 Success observed 8:46 Instantiation 10:10 Summary Links: Project on github: github.com/grughuhler...
PicoRV32 Interrupts on the Tang Nano 9K FPGA Board
มุมมอง 4224 หลายเดือนก่อน
This video shows how to enable and use interrupts on the Tang Nano 9K FPGA development board and shows some surprises with them. The Nano 20K board is also supported. The video shows both instructions that generate interrupts and interrupts caused by a pushbutton. It is part of a series of videos on a simple SoC based on the PicoRV32 RISC-V soft core implemented on the Tang Nano boards. NOTE: W...
Speed of a Renesas X9C103 Digital Potentiometer
มุมมอง 2634 หลายเดือนก่อน
This video introduces the Renesas X9C103 10K digital potentiometer and tests how fast it can be changed from one position to another since this was not very clear in the device datasheet. Chapters 0:00 Introduction 0:33 Device block diagram 1:15 Control signal timing 2:08 Test setup 2:25 Fast timing test 3:49 Slow timing test 4:28 Exit See also github.com/grughuhler/grug_misc_projects
Tayloe-Style Upconverting RF Mixer Transmitter Demonstration
มุมมอง 2.1K4 หลายเดือนก่อน
This video shows a breadboard demonstration of using a Tayloe RF mixer to upconvert IQ data and transmit a radio signal to a receiver. It builds on two videos I made about Tayloe mixers and radio receivers. Note: Would be a good idea to add a simple low-pass filter to the transmitter output. See this video: th-cam.com/video/LbQTqltaQqI/w-d-xo.html Chapters 0:00 Introduction 0:58 NA5Y schematic ...
Faster User Flash Controller for the Tang Nano 9K
มุมมอง 6245 หลายเดือนก่อน
This video describes a Gowin user flash controller that I wrote for the Tang Nano 9K FPGA development board. It's faster than the Gowin Soft IP core controller, especially for slower clock speeds. Chapters 0:00 Intro 0:27 IDE version and building 1:00 Load and run 1:30 Flash in action 2:45 Performance 5:17 Flash documentation 6:54 Read state machine 8:46 Verilog 10:43 Resources and timing 11:16...
Gowin User Flash on Tang Nano 9K FPGA Development Board
มุมมอง 5715 หลายเดือนก่อน
This video demonstrates Gowin's user flash (FPGA internal flash) on the Tang Nano 9K FPGA development board by integrating it with a mini-SoC based on the PicoRV32 RISC-V core. It uses the Gowin flash controller soft IP and presents its advantages and disadvantages. Chapters 0:00 Intro 0:30 About user flash 1:27 Adding user flash 2:14 Controller interface 3:12 Verilog 6:17 Build project 6:46 Ru...
Tang Nano 20K vs Tang Nano 9K FPGA Board
มุมมอง 6K5 หลายเดือนก่อน
This video highlights the differences between the Tang Nano 20K FPGA development board and the Tang Nano 9K. Both boards are inexpensive development boards that can be used on breadboards for experiments and learning. I use the development tools from Gowin. Chapters: 0:00 Intro 0:27 FPGA differences 1:31 Board differences 3:13 Clock control 5:45 Pins and pinout 7:37 PicoRV32 9:32 Resources and ...
Tango Nano 9K PicoRV32 SoC: More Flexible SRAM from Verilog Inference (And Gowan Scope Demo)
มุมมอง 8146 หลายเดือนก่อน
This video updates my previous video on a mini-SoC for the Tang Nano 9K built using the PicoRV32 core. Now the SRAM is created by inference, and its size can be changed easily. In addition, it shows the Gowan Analysis Oscilloscope (GAO) working with this project. Chapters 0:00 Intro 0:33 sram8bit.v 1:43 sram.v 2:05 top.v 2:45 Software 4:07 GAO and clocks 4:59 GAO config 7:42 GAO fail 8:25 GAO s...
Tang Nano 9K Simple PicoRV32-based SoC on FPGA
มุมมอง 2.7K6 หลายเดือนก่อน
This video shows how to create a very simple system-on-a-chip (SoC) using the PicoRV32 RISC-V core and the Tang Nano 9K FPGA development board. The goal is a simple and consistent design that is not abstracted but is easy to extend. We show both Verilog for the SoC and C code for software on the PicoRV32 soft core. Chapters 0:00 Introduction 0:40 Pins & connections 1:15 View of board 1:25 UART ...
Gowin Analysis Oscilloscope on the Tang Nano 9K FPGA Board
มุมมอง 1.9K6 หลายเดือนก่อน
Gowin Analysis Oscilloscope on the Tang Nano 9K FPGA Board
Block SRAM on the Tang Nano 9K FPGA Development Board, Test Via I2C
มุมมอง 1.2K6 หลายเดือนก่อน
Block SRAM on the Tang Nano 9K FPGA Development Board, Test Via I2C
I2C target (slave) on Tang Nano 9K FPGA board integrated with PWM controller dimming LED.
มุมมอง 1.1K6 หลายเดือนก่อน
I2C target (slave) on Tang Nano 9K FPGA board integrated with PWM controller dimming LED.
Update to Arithmetic on the Tang Nano 9K-- use a bidirectional data signal with the Raspberry PI.
มุมมอง 5517 หลายเดือนก่อน
Update to Arithmetic on the Tang Nano 9K use a bidirectional data signal with the Raspberry PI.
Strange way to blink an LED: Demonstrating Clock Hardware IP Blocks on the Tang Nano 9K FPGA board
มุมมอง 1.3K7 หลายเดือนก่อน
Strange way to blink an LED: Demonstrating Clock Hardware IP Blocks on the Tang Nano 9K FPGA board
Arithmetic (from Shift Registers) Using the Tang Nano 9K FPGA Board
มุมมอง 2.2K7 หลายเดือนก่อน
Arithmetic (from Shift Registers) Using the Tang Nano 9K FPGA Board
Getting started with the Tang Nano 9K FPGA board on Ubuntu 22.04 Linux
มุมมอง 6K7 หลายเดือนก่อน
Getting started with the Tang Nano 9K FPGA board on Ubuntu 22.04 Linux
Simple Tayloe Breadboard Software Defined Radio Receives Distant Signals
มุมมอง 12K9 หลายเดือนก่อน
Simple Tayloe Breadboard Software Defined Radio Receives Distant Signals
Tayloe RF Mixer Demonstration Using ADALM2000
มุมมอง 3.9K9 หลายเดือนก่อน
Tayloe RF Mixer Demonstration Using ADALM2000
Measure Blinking/Flickering of LED Christmas Lights Using a Phototransistor and an ESP32
มุมมอง 49611 หลายเดือนก่อน
Measure Blinking/Flickering of LED Christmas Lights Using a Phototransistor and an ESP32
Use Ohm's Law for AC To Analyze a Circuit
มุมมอง 156ปีที่แล้ว
Use Ohm's Law for AC To Analyze a Circuit
Using an Oscilloscope to Measure Inductance/Capacitance like an LCR
มุมมอง 2.7Kปีที่แล้ว
Using an Oscilloscope to Measure Inductance/Capacitance like an LCR
Lamp-Stabilized Wien Bridge Oscillator Using LM386 Audio Amplifier
มุมมอง 10Kปีที่แล้ว
Lamp-Stabilized Wien Bridge Oscillator Using LM386 Audio Amplifier
WS2812B Addressable RGB LEDs and Raspberry Pi Pico PIO, Part 2
มุมมอง 404ปีที่แล้ว
WS2812B Addressable RGB LEDs and Raspberry Pi Pico PIO, Part 2
WS2812B Addressable RGB LEDs and Raspberry Pi Pico PIO, Verified Via ADALM2000 Logic Analyzer
มุมมอง 2.2Kปีที่แล้ว
WS2812B Addressable RGB LEDs and Raspberry Pi Pico PIO, Verified Via ADALM2000 Logic Analyzer
Thanks for the analysis. 👍
Hey, Grug! You might have mentioned that you changed the assignment of pins on the RPi.
You are right. Looking back on it, that whole github repo is a bit of a mess. I don't think I'll change the videos, but I may fix up the repo, including better documentation of pins. I need to recall why I changed pins on the rpi... Perhaps not all pins are capable of being set to open drain.
Thanks, this helped alot with my lab where I needed to decode an I2C signal.
thanks a ton, this is exactly what i was looking for
Thanks, I appreciate the introduction to this little board. I really want to learn FPGAs, I just have yet to find a good project to apply it to. 😊
Thanks. I'm glad you enjoyed it. I think learning some Verilog (or VHDL) is good, and these cheap FPGAs are a great vehicle for that. But I also agree that modern microcontrollers are so capable that many projects do not require an FPGA. One area where FPGAs shine is implementing peripherals that operate autonomously alongside a microcontroller. For example driving addressable LEDs requires fairly tight and consistent timing. It's nice to have that decoupled from software in case the microcontroller has something serious to do along with controlling the LED. Cheers.
Definitely a learning experience! Thanks (although I think my head might explode).
With the Nano 20K, have you experienced the issue of not being able to program it again? I programmed a design earlier and unlike other FPGA boards, the design is persisted after powering off. I cannot program my 20K anymore no matter what I try. Initially it wouldn't program until I dropped the frequency from 2.5 to 2MHz.. but neither is helping now. I've tried powering up with the S2 button held down but I still can't get anything to load.
Sorry, I do not see that. My Tang Nano 20K programs reliably. I use default frequencies and do not have to press a button. I can load the design to SRAM (which is not permanent) or to flash (which is). I can program it using the latest Gowin educational tools on Windows (but not Linux). On Windows, the only problem is that sometimes I need to select Edit/Cable Setting/USB Cable Setting and let the tool find the device. On Linux Ubuntu 22.04 openfpgaloader works very reliably. See my video on getting started with the Tang Nano 9K for more on openfpgaloader. Best wishes
@@electronics.tinker It was my mistake. I thought multiple files could be programmed at once, but they all need to be loaded individually.. So I just had to hold down S2 while powering up and ensure that only one file was checked in the Gowin programmer. The errors the programmer gives back tend to be a bit misleading. ..and yeah, I'm using Windows.
Greg...at 7:16, after having done the floor planning, you say 'and...we should be able to synthesize...,' when you mean to say 'place and route.'
You are right. I had not noticed that misspeaking. Cheers.
Hey Greg! Using your videos to try getting into FPGA. Downloaded Gowin FPGA Designer v1.9.9.03 Education build to my Ubuntu 22.04 ThinkPad. On start-up, terminal reports: Qt: Session management error: None of the authentication protocols specified are supported. Any clues? Should I be worried?
I get the same thing: Qt: Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed It has not caused me problems. I think Gowin tested their Linux-based tools on a version of Ubuntu even older than 22.04. As you use newer versions of Ubuntu, problems get worse. Gowin's strategy for supporting Linux is not very good. Frankly, the Gowin tools work a lot better on Windows (at least Windows 10-- I don't have a computer capable of running Windows 11). I have started running the Gowin tools mostly on Windows as the path of least resistance, and I run Ubuntu 22.04 under Windows Subsystem for Linux (WSL2) on the same machine. This allows me to continue to use Ubuntu for software builds. I prefer Linux to Windows, but Gowin does not make it easy! Cheers.
Grug, great video. thanks. I am looking image processing or voice processing applications using tang nano 9k, i dont know if you are interested in signal processing.
Glad you liked the video. I don't know much about signal processing, though.
Great video, thanks for posting it. I don't have the 4K, but I have a 9K and a couple of 20Ks. Umm ... perhaps a dumb question but, what in your opinion is the point of an fpga chip having a hard core, as compared with just connecting an fpga to a separate microcontroller? It's interesting that this is available, but are there any practical uses where this might make sense, or is this mostly a matter of keeping traces on the silicon real short?
Yes, there are circumstances in which having a hard core makes sense. Imagine that the FPGA is being used to implement a high-speed peripheral, a computational accelerator, or both. Also, assume that these are to be memory-mapped peripherals of a controlling core. The number of signals coming out of the core is pretty high. For that reason alone, it can make sense to integrate the core into the FPGA. I think this is more likely in larger FPGAs where the you need may be even more sophisticated core than an M3. Integrating a a hard Cortex-A53 (to run Linux), hard DDR controller, hard ethernet, etc. is possible (actually easy to find) on larger FPGAs. The FPGA becomes a complete Linux-capable system-on-a-chip connected internally to the FPGA resources. More complex interconnects than APB will be used so the signal count and frequency will be high. Also , some of the signals may be differential. The smaller the FPGA, the less this makes sense (at least on average). Cheers.
Very nice video. Tang could almost employ you to promote their products given the quality of tutorial you provide. Does that GPIO interface, mean that the FPGA cannot get signals 'directly' through the GPIO pins but only through the ARM core? That would seem be a downside but maybe I misinterpret. It seems possibly that this board was intended to be focused on Camera/HDMI functions, rather than being 'general purpose'? I would look forward to any material you could show of a simple project demonstrating the MCU and FPGA interacting. If you install the msys2 distribution platform for windows, it allows you to get a number of toolchains. The most famous one is the MinGW-w64 fork of GCC that is compatible directly with Windows; but it also includes a great many other 'normally linux' tools to get (make, cmake, etc etc etc). It basically uses a version of Archlinux' pacman package manager to install tools for windows. Of interest, you can install the 'mingw-w64-x86_64-arm-none-eabi-toolchain' meta-package in order to get a GCC toolchain for ARM, and clang is also available as well (both for x86/x64 and ARM). Also available is using xpm ("the xPack Project Manager"), using that package installer you can get '@xpack-dev-tools/arm-none-eabi-gcc' which will also give you a GCC for ARM. As you say, using some linux distribution underneath WSL2 is also a good option these days. In terms of USB-Serial adapters, there a good number of other chips on the market that side-step the problem of using fake FTDI FT232RL chips. Ones using Silicon Lab's CP2102 or CP2104 ICs generally work very well, and probably either auto-install drivers on newer windows or they're pretty easily to find on the net and install.
Thank you for this !! Was looking for something like this
Glad you found it useful. I had noticed that there is not too much information out there on the M3 on the Tang Nano 4K.
Man, thank you for your work on the manuals!👍
3:10 [SOLVED] I had the same dependencies problems on Fedora. More in detail, the error message was "undefined symbol: FT_Done_MM_Var". After searching online, it seems the problem is related to the library "libfreetype.so.X" (where X is a number) stored in "IDE/lib" folder. Renaming or deleting it should solve the problem. In my case, I just renamed it into "libfreetype.so.6.old" and the IDE started working without any problem. Hope this can be useful for someone else too.
That's good information, thanks. I decided that the path of least resistance is to run Gowin on Windows, though.
it work for me too in Ubuntu 24.04.1 LTS, thanks very much
What i mean is to create interface for HLS(High level synthesis) for any kind of fpga
Hi sir, I was curious about FPGAs and their capabilities for faster computing and matrix multiplication. That's why I bought a TAN Nano 20K for machine learning on the edge. I just want to know if we can talk to the Nano 20K via JTAG communication and perform high-speed computing. I mean, given an address for matrix multiplication in the FPGA, can we access that address to calculate the result in C programming?
Thank You! It works! Ubuntu 18.04 LTS
Great video, thanks for the clear explanation!
Excellent tutorial.
is it possible to make 100mhz to 5.5ghz sdr by a human hand {DIY}
That would be much harder. Simple, cheap analog multiplexers are not fast enough. Also producing quadrature LO signals at such high speeds would need different techniques.
I have these thissh script: my verilog file and my io map file. I dont think you need all this GUI stuff fil_v="main.v" fil_io="io_map.cst" yosys -q -D LEDS_NR=6 -p "read_verilog $fil_v; synth_gowin -json net1.json" yowasp-nextpnr-gowin -q --json net1.json --write net2.json --device GW1NR-LV9QN88PC6/I5 --family GW1N-9C --cst $fil_io gowin_pack -d GW1N-9C -o main.fs net2.json openFPGALoader -b tangnano9k main.fs
You are using an open source tool chain which has its advantages. But. using Gowin hard IP blocks might be harder without the Gowin tool chain. I am not sure. Thanks for the comment.
Thanks! Just the simple first example I looked for.
Thanks so much for doing this video. I'm new to the Tang Nano devices. I was a reluctant to use them since I was so comfortable with SignalTap on the Cyclone IV but having seen the GAO in action I'm definitely keen to play more with the Tang Nano - and they certainly synthesise a lot faster than the Cyclone IV/V devices! I love the small size of the Tang Nano devices too.
Glad you found it helpful. I was attracted to the Tang Nano boards by their low cost. They are cheap enough to buy just to tinker with them and learn about FPGA development. I also like that they are bread board friendly. GAO is helpful, at least on Windows. The latest educational version is more stable.
@@electronics.tinker I only dug out my old Nano 1k board the other day. I bought it a few years back. I couldn't use the educational version - it no longer supported my device so I got in touch with Gowin. They replied to me very quickly and advised me to install the latest non-educational version. I had avoided the non-educational version thinking there would be an associated cost with the license but there doesn't appear to be.
I have read that the non-educational version is free, but you have to apply for a license (I think annually). I have been using the educational version just to avoid bothering with a license. Have you noticed any features missing from the educational version other than support for some devices? That would be interesting to know. Cheers.
@@electronics.tinker I haven't used it enough to notice, sorry. When you install the 'full' version, it replaces the educational one (on Windows) so I haven't been able to do a side-by-side comparison. I do switch between 3 PCs though and I've had no trouble getting licenses for all 3. They're pretty good with their support - definitely a game changer for people wanting to get into FPGA on a budget. My project got too large for the Cyclone IV - mainly because of the amount of logging I was doing with SignalTap, so that's what forced me into buying a Cyclone V - just for development. I'm sure the Tang 1k/4k/9k will suffice my needs - and to be honest, the 4K seems to be the same price as the 9k now. I think the only concern with these boards is the number of pins.. but the Tang Primer seems to have that covered. I think you can even swap out 25k chips on those Primer dev boards too which is quite exciting.
Very nice and clear video! I have tang primer 20k and i have issues with analyser oscilloscope. Does it work for you?
The analyzer oscilloscope works for me only on Windows, where I have found it to be useful on both the Tang Nano 9K and the Tang Nano 20K. Tools version 1.9.9.03 education is better than the older version. But I have never gotten the oscilloscope to work on Linux (Ubuntu 22.04.05). The loader/programmer is also problematic on Linux but works ok on Windows. In the end, better to use Windows for Gowin if you can.
@@electronics.tinker it is sad that it doesnt work on linux... as for the programmer i found out that openFPGALloader works fine with ubuntu (it is mentioned on their website as am alternative). I hope they make an alternayive to gao too. Their fpgas are nice and affordable, it would be great to work on linux too
Amazing I have been looking for a guide like this to build something on that same FPGA. Do you know if there is anyway I can get it to run linux?
My bet is that running Linux on PicoRV32 would not be possible unless you add support to Linux for the PicoRV32's non-standard interrupts. And then you would have to run MMU-less Linux which is possible but not a great idea in my opinion. And you would need at add support for the Gowin PSRAM to get enough memory. Running Linux on a larger soft core than PicoRV32 is probably possible on the Tang Nano 9K. See the litex project. I am 100% sure it is possible on the Tang Nano 20K, but even then I think it makes more sense on a hard RISC-V core that complies to the supervisor-level spec or a hard Cortex-A core. I don't know of a cheap FPGA with either, though. Connecting a Raspberry Pi Zero to a small Tang Nano board by something faster than i2c would be possible and interesting. Best wishes.
@@electronics.tinker thank you for your detailed response to my question!! I did look up the litex project. It says it is possible to be made on the 9k. Thank you for the information!!
Thanks, seems very clear to me, cant wait to try it
Since I made this video, Gowin released version 1.9.9.03 of the educational version of their tools. GOA is less glitchy with this version. I have found it to be useful.
Nice.. I use linux and openFPGALoader. I set up the .rao file and burn the design. But when i try to open the oscilloscope i get the error : Can not connect to jtag server... Any idea why this happens? Iuse the tang primer 20K board
I figure this out (using chat gpt) i had to rename one file (libz.so.1 to libz.so.1.bak). Now i have another problem... i have made a simple counter 25 bits. After setting the clock(clk) and triger (ther reset signal assigned to button T10 of the board), when i press the auto button and then click the reset button on the board seems like it doesnt trigger anything...The only thing i made different was to select gowin usb cable GWU2K beacause the other option (there are only 2 for tang primer 20k i gwess) gave an error. Any idea why this happen? (i have downloaded the 1.9.9.03 version ). I have tried it many times... Seems like the analizer osc. software can not communicate with the board for some reason
I never got GAO to work on Linux. I think it is somewhat tied to an older version of Ubuntu than I have. You could use "ldd command" to see what shared libraries "command" will use. There are many shared libraries packaged with the Gowin tools on Linux, but maybe Gowin would be better off offering a Linux container or something. Making a program work on all flavors of Linux can be difficult. I prefer to develop on Linux, but I find that the Gowin tools work more smoothly on Windows.
👍👍👍👍👍
I just found this. Nice work. I think the only way to get better disciplining would be to do it completely in HDL. Now, I need to go back through the other videos leading up to this. Again, well done.
Glad you liked it. My thought is that using software is only adding a little latency to reacting. The time measurement is already pure hardware. Given a 1 second measurement period from the GPS, I think a little added reaction latency will have little impact. It might help to run clk_pps faster to reduce measurement jitter, and using the PicoRV32 core makes that more difficult (at least until I can figure out how to do floor planning with the Gowin tools, perhaps).
@@electronics.tinker It might also be interesting to use the GPS PPS to discipline an external TCXO, instead of the onboard oscillator to reduce jitter. There is a project called the time card from the open compute project which does something similar, but IIRC it's implemented entirely in HDL.
I looked at Time Card. It mentions some interesting parts like a TCXO that has a PPS in signal. It looks like it can adjust itself. Interesting. Thanks for pointing out this project.
Greg, thank you for this awesome content and all the effort you've obviously put into making these videos. Having done VHDL many years ago you've inspired me l, just ordered a tang nano 9k. Re the accuracy and convergence algorithm, have you considered interating the 1s timestamp delta over time and then making the correction after that period, starting with 1s, 10s, 100s, then 1000s...this should allow your system to become incrementally more accurate to several significant digits.
Apologies for the typo Grug
Yes, I can think of many variations to try, but I am not sure the result will be much better (although faster convergence is certainly possible). The big issue is that the GPS PPS signals are not perfect. I have two GPS receivers and I examined their PPS signals at the same time on my scope. The time between their rising edges varied by as much as 100 ns and was not constant. Maybe I should make a short video about this. A spec sheet from U-Blox suggests that the PPS signals might jitter less than 30ns (usually), but I don't know if this is true for what I have. I have no frequency reference adequate to test this. Someone who has one ought to make a video about using it to test cheap GPS modules! Thanks for your comment.
Could one implement this also in the nano 4k or 1k?
On the Tang Nano 9K, the project uses 37% of the available logic and 47% of the CLS's-- but a lot of that is the PicoRV32 core. I don't have a Tang Nano 4K (or 1K), but I think the 4K has a Cortex M3 hard core. You would have to use it instead of the PicoRV32 soft core. Then, I think there is a good chance it would work. The 1K is too small for the PicoRV32 core (and I think it has no ARM core). So, the only approach would be to use the 1K in conjunction with an external CPU like a Raspberry Pi, Arduino, or ESP32. You could use i2c to read and write the PPS registers. One other concern is speed. clk_pps should be at least 60 MHz. I am not sure what speeds the 1K and 4K would support. I have noticed that higher resource utilization causes the place and route tool to be less likely to achieve a given clock speed. I have no idea about the 1K and 4K in this regard. I also don't know how to use the floorplanner tool to help the place and route, but that's a topic for another day.
Very useful content, thankyou. You have something of a gift for a concise, but interesting way of demonstrating and explaining these concepts.
Thank you for the very kind comment. I enjoy these technologies and make videos in the hope that others will enjoy them also.
People constantly say "but xxx might not work on a breadboard..." because it seems to be common EE mythical lore. No, nothing can possibly work on a breadboard over 1Mhz! You damn fool! Stop trying! It's a breadboard! Manhattan solder your circuit like a real HAM! ...but a hell of a lot of circuits way above 10Mhz seem to work just fine on a breadboard, with a little attention paid. Of course not as good as perfect on a 4 layer PCB... but damn well good enough to demonstrate thousands of examples.
It's a fair point. Better to try it than just give up. Certainly, I have had success on breadboards way above 1 MHz.
I saw the tang 4K also comes with an M3 coprocessor, would that be ideal for offloading 'non-critical' general compute tasks to, while the FPGA handles the critical functions of a program?
Having a hard core on an FPGA would certainly be interesting. But the 4K is a fairly small FPGA. A Tang Nano 9K with a PicoRV32 soft core likely will have as many resources left over after including the soft core as the 4K has in the first place. But the m3 will likely be faster. The Tang Nano 20K is also nice. After including a PicoRV32 soft core, it will have more resources left over than even the 9K. I think if you are just learning about FPGAs without a specific project in mind (in particular one that needs a core), then the 9K and 20K are good choices. The prices don't appear to be that different. My Tang 20K was $25 from Amazon. That was a good deal. If I could buy a 4K for, say $10, I'd probably get one just to see exactly how the m3 is integrated, though. Basically, they are all good choices in one way or another. By the way, in case you didn't see them, I have several videos that show the use of the PicoRV32 soft core. I like using the version straight from github rather than using the encrypted IP block available directly in the Gowin IDE.
@@electronics.tinker Thanks for your explanation and channel!
Analysis of Wen Bridge Osc lamp stability ; difficult math anaysis Oliver, B.M. Ef{ect o£JY - Circuit Nonlinearity on i9~ Amplitude Stab~fity of R.C. Oseillators, Hewlett Packard Journal, April June 1960, Volume 11, pp 1-8.
Very educational and well done explanation for us newbies. Good work! And thanks for the GitHub code!
Hello. Have you tried synthesizing a PicoRV32 microprocessor on a TangNano-20K board according to the Gowin PicoRV32 Quick Design manual Reference Manual IPUG915-1.3 with downloading the program from SPI-Flash?
No. I looked at it but decided that using the picorv32 direct from its author's git (github.com/YosysHQ/picorv32) was so much more transparent. It works the same way on the Tang Nano 20K. See my video on PicoRV32 interrupts. The github for it supports both the 9K and the 20K. Best wishes.
Thank you very much for sharing. Very appreciated your work.
I am happy to hear that you found the video useful.
Hello, I'm new to the world of FPGAs, and I have a question. The TangNano 9K has a 27 MHz crystal oscillator, but I can generate a higher clock using the PLL. My question is: what is the maximum frequency I can achieve? At 2:05 in the video, a table shows 1200 MHz-is that correct? But at 0:55, it mentions a 200 MHz clock. I'm a bit confused about this part. Thank you for the video.
It's a good question. In general, you have to dig through and understand technical documentation available on the Gowin website to answer this type of question. The FPGA on the 9K is a GW1NR-9 with speed (and temperature) grade C6/I5. I am looking at document "GW1NR series of FPGA Products Data Sheet", version DS117-3.0E. Its Table 3-21 answers the question saying the max valid CLKOUT from rPLL is 600 MHz (and the min is 3.125 MHz). The table also gives limits on intermediate clocks that are involved. A separate document "Gowin Clock User Guide UG286" explains those intermediate clocks and how they form CLKCOUT. It's not easy stuff, and there are many docs to shift though. And then, you need a design that can actually use a 600 MHz clock while still meeting setup and hold times. I doubt there is much you can do on the GW1NR at such a high speed. It's why you have to look at the timing report that the tools generate to see if your design meets timing. There are still many aspects of this that I cannot understand from Gowin's docs. But I know that red text in the timing report means "bad!" Good luck with you FPGA.
Great companion video to your earlier coverage of the down converter / receiver circuit! Thanks for sharing this information in such an approachable manner. Is there any chance you have a GitHub location with the schematic or Lspice file? Thanks again for this really outstanding content.
Glad you enjoyed it and good idea. I created repo called grug_misc_projects on github under user grughuhler. Let's see if TH-cam lets me post a link. github.com/grughuhler/grug_misc_projects
Thank you so much for uploading those files. I am working on an order to Digikey so I can attempt to recreate what you demonstrated. Would you please confirm the values of R11-R14 and C6-C9? The schematic says {R} and {C}. Thank you again for providing this content.
Yes, my mistake. I deleted the LTSpice parameter without adding a note. C=10nF and R=220 Ohms. Those values are interesting to play with. I am unsure how to best select them. I'll fix the picture on the github later.
This is exactly what I was looking for. Thanks for posting. I have had a Pi sitting around for a few years. Soon it will be a radio.
I'm glad you found the video interesting. Best wishes with your experiment.
Great video! Important point for use and coding. Thank you.
Thank you for the video. Can this Tang Nano 20k generate sine waves at HF (20 meter) frequencies ? Just in case I want to build a well filtered beacon...just in case.
The FPGA on the Tang Nano 20K (and the 9K) is a digital only device so its output pins are either high or low-- so it can produce square waves but not (directly) sine waves. If all you want is a square wave clock generator, check out a part called si5351. John Hawkes made a youtube video about using one of these as an LO sine wave generator by filtering its output. The video is called "SI5351 Clock Gen as Radio Local Oscillator in Old Radios".
@@electronics.tinker Thank you for your reply. I check out Hawkes video. I put a low pass filter into the output from the Si5351a and that knocked everything down a bit. However, the signal was knocked down below 0 db. So now I think I have to amplify and filter the results of the amplifier as well. ... So it goes.
Excellenet presentation/video. Thank you. I gotta think about this. I hate winding coils but I might need to for the filters.
I agree that winding toroids would be the best way to get and tune inductors for RF filters. I suppose it would be interesting to see how well a breadboard RF filters could work at low frequencies like 1 MHz. One could compare its response to what a filter designer web site predicts. I'm glad you enjoyed the video.
Nice explanation and interesting examples, thank you for sharing your knowledge and greetings from Germany, 73 de DL8CY
Thank you. It's great to hear from someone in Germany.
Can you make a video on how to create a RISC-V architecture on this FPGA step-by-step? That would be awesome!
Do you mean implement a RISC-V soft core from scratch? That would be a big job. And others have already done it. See the litex project or the PicoRV32 core. I made a whole series of videos about using the PicoRV32 RISC-V core to implement a simple SoC. There is a playlist called PicoRV32 on my channel. The videos contain links to github with complete projects including some simple software. There are multiple branches on the github as I added stuff from video to video.
This is a great video, thank you for sharing your knowledge with this simple but informative demonstration. How difficult do you think it might be to create a similarly simple circuit to perform quadrature modulation of an input audio signal? Thanks again.
I presume you mean that the stereo audio will carry I and Q data to be upconverted to RF using the Tayloe circuit-- like for a transmitter. I have not tried this, although it would be fun. Dan Tayloe's paper briefly describes how to do it. I put a link to that paper in my first video about the Tayloe mixer "Tayloe RF Mixer Demonstration...". Also, you could check out NA5Y's youtube channel, in particular his video "ESP32 Based SDR Transmitter - Part 2 Tayloe Encoder". He shows a schematic. Cheers,
Erm, what about running the GOWIN code at 50MHz and then using a FIFO to cross clock boundaries to your working clock?
I think the performance of both could be improved by using an additional clock. I was trying to keep it simple. Clock domain crossing is a good topic, though. In the past, I tried to get the Gowin tool chain to complain about bad domain crossing. No luck with that so far.
Love it. More videos please
Good!