Pull to refresh
128K+

Programming microcontrollers *

Learning how to program microcontrollers

314,42
Rating
Show first
Rating limit
Level of difficulty
Format

Implementation of the HDA Link interface on RP2040

Level of difficultyMedium
Reading time13 min
Reach and readers8K

If you’re looking to set up 10-channel audio output at a 192 kHz sample rate using a MCU, read on. This article explains how to implement multi-channel audio on an RP2040 using an ALC889 HD audio codec. It includes a brief overview of the HDA link interface, along with links to a couple of functional demo projects and descriptions of how they work.

Read more

ESP32-CAM Security Watchdog

Level of difficultyMedium
Reading time8 min
Reach and readers4.3K

A practical task arose: in a confined space (a narrow hallway, stairwell, or vestibule), monitor activity, take a photo of the area, and notify the user by forwarding the photos to Telegram. It is known that a standard household motion sensor, which turns on the lighting, is installed in the monitored area.

Read more

LoRa Module (P2P Private Protocol) Parameters

Level of difficultyMedium
Reading time21 min
Reach and readers8.1K

If you are using a LoRa module for point-to-point (P2P) communication or building your own private protocol, understanding and correctly configuring each parameter is the key to successful communication.

After reading this article, you will learn:

• How Should the LoRa Over-the-Air (PHY) Modulation and Packet Format Parameters Be Configured, and Why?

• The meaning of RF front-end parameters and how to tune them

• Chip-level control parameters: operating modes, clocks, power supply, calibration, and more

• A quick-reference "must-match" table and a list of common issues

Note: This article covers only LoRa (P2P/Private Protocol) parameters. If you need information on LoRaWAN protocol-layer parameters (e.g., ADR, DevEUI, join procedures), please refer to "LoRaWAN Protocol Layer Parameters".

Before starting configuration, verify that your device has selected PacketType = LoRa. The LR2021 supports multiple modulation types—including LoRa, LR-FHSS, FLRC, FSK/GFSK, OQPSK, and OOK. When using P2P LoRa communication, you must first switch to LoRa mode; all subsequent modulation and packet structure commands will then be interpreted in LoRa mode.

If you select the wrong PacketType (e.g., FLRC or GFSK mode), the chip will not interpret the SF, BW, and CR parameters in LoRa mode, The result is that the transmitted data cannot be decoded by the receiving end at all.

Read more

Sensor-Level AI: A 380-Parameter Architecture Resistant to Drift and Noise

Level of difficultyEasy
Reading time8 min
Reach and readers5.2K

Much attention is currently focused on the size of neural networks and the gigawatts of power consumed by data centers. However, the future lies not only in giant clusters but also in tiny chips embedded directly into the sensing elements of hardware. When a neural network is placed directly inside a sensor chip, it must be exceptionally efficient.

Through experimentation, I have successfully built a neural network architecture with 380 parameters (with potential for further reduction), capable of operating in conditions considered unsuitable for conventional algorithms.

Read more

Here is my take on Verilog-vs-VHDL In the early 1990s many people thought that Verilog was a temporary language and...

Reading time2 min
Reach and readers18K

Here is my take on Verilog-vs-VHDL

In the early 1990s many people thought that Verilog was a temporary language and was going away with VHDL standard adoption.

For example, Verilog was plagued by race conditions in the form:

always @ (posedge clock) a = b;
always @ (posedge clock) c = a;

You had to use non-blocking assignments or delays in simulation to counteract the fact that the order of always block evaluation is indeterminate. This led to a pre-synthesis-post-synthesis simulation mismatch. At the same time, many people complained that VHDL has different incompatible arithmetic packages (numeric_std and std_logic_arith) and writing something like

wire [3:0] a, b;
wire [4:0] c = a + b;

becomes something like

signal a, b : std_logic_vector (3 downto 0);
signal c : std_logic_vector (4 downto 0);
c <= std_logic_vector (resize (unsigned (a), 5) + resize (unsigned (b), 5))

Finally John Cooley, the first blogger of EDA industry (he started his blog http://deepchip.com even before the word "blogger" appeared in the press) decided to make a hackathon in 1997 (at that moment the word "hackathon" was also unknown) to find out who is more productive - Verilog or VHDL engineers.

John Cooley published the results in an article

"The Unexpected Results From A Hardware Design Contest:  Verilog Won & VHDL Lost? -- You Be The Judge!"

https://www.angelfire.com/in/rajesh52/contest.html

He found that the Verilog engineers were more productive in his challenge.

After that more and more companies started to switch to Verilog, especially when Verilog-2001 and SystemVerilog integrated all the features of VHDL (packages, generate, records/structs etc).

Читать дальше →

Некоторые товарищи, например Олег Чирухин на Фейсбуке утверждают, что LLM хорошо пишет на JavaScript / TypeScript и...

Reading time2 min
Reach and readers18K

Некоторые товарищи, например Олег Чирухин на Фейсбуке утверждают, что LLM хорошо пишет на JavaScript / TypeScript и плохо на Verilog / SystemVerilog потому что первого в мире больше. Однако у верилога есть два критических фактора, которых у JS вообще нет. В JS если программа работает долго - это просто неудобство, в Verilog-е если нарушается тайминг внутри такта (задержки в пикосекундах) или результат приходит через 5 тактов, а он ожидался через 4 - все нафиг ломается. LLM не понимает ни тайминг внутри тактов, ни тайминг по тактам (латентность).

Никто не будет из-за этого дурацкого LLM ставить везде hanshake не зависящий от латентности подблоков, снижать пропускную способность блока на порядок или снижать в разы тактовую частоту - скажем вместо процессора с частотой 2 GHz выкатывать на рынок процессор с частотой 20 MHz. И с производительностью по тактам 2 СoreMark / MHz вместо 12 СoreMark / MHz. И при этом большой в разы и с высоким энергопотреблением. Это как продавать автомобили со скоростью и грузоподъемостью велосипеда и весом как самосвал - такое никто не купит.

Тайминг внутри такта (задержки в пикосекундах) только из кода определить нельзя, нужна процедура статического анализа тайминга, который знает задержки конкретной библиотеки ASIC (LLM не умеет делать STA (static timing analysis) и не знает задержек конкретной версии библиотеки скажем на 2 нанометра low power такого-то вендора).

С неумением LLM понимать что происходит в каком такте все интереснее. В принципе это понять можно, но это требует довольно вдумчивого анализа конкретного кода, а LLM это не просто не умеет, а в наглую пишет "for illustration, assume the latency is 1" - типа тоном профессора "для иллюстрации, предположим латентность подблока - 1 такт". А если не предполагать? С предположением все поломается.

Читать дальше →

У меня есть коллега (не по Самсунгу, а по образовательным программам), который влюблен в ИИ. У меня есть опасения что...

Reading time1 min
Reach and readers18K

У меня есть коллега (не по Самсунгу, а по образовательным программам), который влюблен в ИИ. У меня есть опасения что он может использовать ИИ для написания некой инструкции, которая включает теоретическую базу SystemVerilog-а. С моей точки зрения это очень дурная идея, так как LLM не следует стандарту, а генерит то, что людям интуитивно "кажется". Для иллюстрации спросил у ChatGPT 4.0 чем отличается wire, reg и logic. Словил 3 ошибки и 2 недочета:

1. Недочет: LLM (как и большинство людей, даже экспертов) забыл упомянуть про разницу в контексте инициализации ("wire a = b" это continuous assignment то есть "wire a; assign a = b;", а вот "logic a = b" это инициализация в момент 0, то есть "logic a; initial a = b;")

2. Ошибка: LLM почему-то думал что "wire a = 1'b0" несинтезируемо в Verilog, но синтезируемо в SystemVerilog.

3. Ошибка: LLM думал, что "always_ff" можно использовать для создания D-защелки (D-latch).

4. Ошибка: LLM думал, что "always_comb" может infer latch.

5. Недочет: LLM забыл про "always_latch".

То есть если скажем преподаватель ленится читать стандарты и книги, но вздумал писать методичку с помощью ChatGPT, то его студенты жестоко пострадают (баг от (1) трудно отлаживать) и будут понимать все "приблизительно".

Читать дальше →

У меня есть знакомый энтузиаст LLM, который также изучает верилог. Я попросил его написать инструкцию к упражнению с...

Reading time2 min
Reach and readers18K

У меня есть знакомый энтузиаст LLM, который также изучает верилог. Я попросил его написать инструкцию к упражнению с неким сенсором, который он интегрировал. Он разумеется сбросил это на LLM, я почитал и понял, что LLM нужно запретить как распостранение Экстази и "солей" среди молодежи. Точно так же как "дизайнерские наркотики" дают ощущение счастья и достижения без труда, сгенеренная LLM документация выглядит как реальная, вот только читателю она не поможет.

Что нужно читателю? Картинку как подцепить сенсор к плате, временную диаграмму сигналов которые от него выходят и пару слов про проблемы, которые у него возникнут (дребезг) и как их стоит решать. Так чтобы было достаточно информации, чтобы сесть и написать код на верилоге.

Что выдал LLM? Сначала пять абзацев мутного словестного описания что "изменения переключателей проходят некоторую последовательность, позволяющую определить направление", с галлюцинациями что движется и что неподвижно. Потом не имеющую отношения к задаче информацию, из каких материалов делаются эти сенсоры в разных странах мира, чтобы быть дешевыми для хоббистов и образовательных учреждений. Далее про разные способы решения проблемы дребезга, в том числе способы, не имеющие отношения к данной ситуации. И наконец, куски определения пинов из QSF и XDC файлов из случайных примеров в интернете, которые не имеют отношения к описанному примеру, так как в нем во-первых эти файлы не используются (другой вендор, другой способ задания пинов), а во-вторых, в нем эта часть проекта абстрагирована (пользователю вообше это не нужно это делать).

Читать дальше →

How to Fail Those Students Who Rely on ChatGPT

Reading time3 min
Reach and readers6.3K

We at Verilog Meetup constructed an exam/interview problem that has an interesting property: if a student tries to figure out a solution by thinking by himself, he usually succeeds; however if he dumps the problem on ChatGPT, the solution fails (does not pass the automated test), and the student goes into a death spiral of futility, kicking ChatGPT to get the solution right.

There is nothing weird about the problem, we do this in the industry all the time:

Read more

The Armenia Opportunity: EDA, ASIC, FPGA + connections with USA, China and Russia

Reading time9 min
Reach and readers4.6K

Armenia is a lucky country. Back in the 1990s somebody lobbied Synopsys, the #1 leader in the Electronic Design Automation market, to create a division there. It was joined by Mentor Graphics / Siemens EDA, another EDA leader, then NVidia. Synopsys Armenia became the largest Synopsys division outside the US Silicon Valley and Boston, although the Taiwanese may tell you otherwise. Since Synopsys and Mentor make software used by chip designers in Apple, Samsung, AMD and all other electronic companies, Armenia has an unfair advantage over all their neighbors in Caucasus and Central Asia.

In addition, Armenia has friendly relations with Russia, and most Armenians speak Russian as well. This has facilitated the move of many Russian companies to Armenia, for example, a RISC-V semiconductor IP provider Syntacore. Finally, as we can see from the recent conference EDA Connect, Armenia is attracting the attention of electronic and EDA companies from China.

EDA Connect featured not only academic and industrial papers but also a hackathon on FPGA design, attended by local students from Yerevan State University, the American University of Armenia, the Russian-Armenian University, the French University in Armenia and others.

Read more

The State of Caravel: the First Look [Мучения в проектировании чипов из-за Докера и Питона]

Reading time47 min
Reach and readers4.8K

Написал лонгрид на английском о текущем состоянии открытых средств проектирования ASIC-ов. Заодно познакомил англоязычных читателей с практиками шаманов Сибири и фигурой Ивана Сусанина. Упомянул планируемые семинары в Мексике и Армении.

A text on the current state of Open-source ASIC design tools. Includes side discussions of the upcoming hackathons in Mexico and Armenia, Docker and Python, Static Timing Analysis and RISC-V, Siberian shamans and treacherous swamps in Belarus.

Read more

A new platform for FPGA seminars based on Gowin Tang Nano 9K: adding sound, graphics and microarchitecture labs

Reading time3 min
Reach and readers5.3K

Gowin has clear advantages over Xilinx in the educational FPGA board market: Gowin boards are several times less expensive, the synthesis speed is several times faster, and the EDA package is two orders of magnitude smaller: we are talking about 1G versus 100G disk space. Of course, Xilinx is still the king of high-end prototyping boards that cost $10K-100K, but for the students such boards are irrelevant; such boards are for ASIC design companies. A beginning EE student needs a board for less than $100, and Gowin not only fits the bill but also covers all the needs, specifically:

Read more

Artery AT32F407 и scanf() Речь пойдет об отладке AT-START-F407 V1.3. В составе платы находится программатор/отладчик...

Reading time1 min
Reach and readers22K

Artery AT32F407 и scanf()

Речь пойдет об отладке AT-START-F407 V1.3. В составе платы находится программатор/отладчик AT-Link-EZ V1.2, который подключается по USB к ПК, где он виден как COM порт.

Его же можно использовать для целей отладки, а именно выводить информацию на ПК с помощью printf(). На эту тему а Artery есть AN0015_Printf_Debug_Demo, описанные там переопределения уже содержатся в файле at32f403a_407_board.c:

Читать дальше →

Structure of Linux driver for single-board computer

Level of difficultyEasy
Reading time5 min
Reach and readers2.6K

Hello my name is Dmitry. Recently I wrote article "Building firmware for Orange PI i96 (Orange PI 2g-iot) from scratch" . If you haven't read it yat, I highly recommend. And there I noticed that in order to build firware on current kernel, I have to rewrite drivers wirh new archetecture "Device tree". In this article I have revelate how I do it.

Read more

Building firmware for Orange PI i96 (Orange PI 2g-iot) from scratch

Level of difficultyEasy
Reading time14 min
Reach and readers4.3K

Hellow my name is Dmitry. Once I bought "Orange PI i96", but unfortunately producer not update it firmvere very long. Last firmwere kernel version is 3.10.62 but kernel current at time this article writing (russian version) is 6.5.1. And so I decide build my own firmware from scratch, and do it from sourse completely.

Read more

The results of 7 Verilog meetups + the goals and the steps going forward

Reading time5 min
Reach and readers2.7K

Since the New Year we had 7 Verilog meetups at HackerDojo. We discussed the modern way of designing digital circuits using hardware description languages, the exercises on FPGA boards and the topic of microarchitecture. For the last two sessions we went over the most basic CPU core that can be used as a baseline for further exercises.

Now, in order to make progress toward the goal of creating new educational materials, it is essential for the regular participants to solve all the homework exercises (see the details in the post below) in parallel with studying the recommended materials.

The next steps are:

1) We are going to do weekly Zoom calls on Sundays, starting March 24, 2024 at 11 am California time (summer time). The link. During this call we are going to discuss the SystemVerilog Homework and the individual projects.

2) Once we develop more materials, we are going to organize a Show-and-Tell session in Hacker Dojo, for a wider audience. During the session several participants from the core team will present demos on various FPGA boards and explain to the curious how FPGA and ASIC work.

Read more

Bootstrapping Azerbaijan as a new center of ASIC design + Verilog Meetup #6 in Silicon Valley

Reading time11 min
Reach and readers2.8K

Last week I was doing a seminar on SystemVerilog, ASIC and FPGA at ADA University in Baku, Azerbaijan. I will replicate the last two sessions of this seminar, on RISC-V CPU simulation and synthesis, at the Verilog Meetups on March 3 and March 10 at Hacker Dojo, Mountain View, California. For this reason I am combining the information about Azerbaijan and California seminars in a single post.

First, let's talk about ADA University.

Read more

Verilog Meetups @ Hacker Dojo: the status and the plans for 2024

Reading time9 min
Reach and readers4.9K

The first meetups of the Portable SystemVerilog Examples group at Hacker Dojo in Mountain View, California were a kind of brainstorming sessions. We discussed the electronic industry, the essence of modern chip design, and the challenges of educating new design engineers. Then we moved to a new mode of action. We started weekly meetings of the core R&D team with the goal to prepare educational materials for the events for a larger audience. The meetings are generally held on Sundays from 11 pm to 2 pm. If you cannot come to Mountain View, you can join online.

We are focusing on interview-level microarchitectural and CPU design examples, providing FPGA vendor-neutral infrastructure and compatibility with open-source ASIC design tools.

Read more

Простое крепление проводов в контроллерах idiBus. Без кабельных каналов. Дешево и сердито. Вдоль торца платы ряд...

Reading time1 min
Reach and readers14K

Простое крепление проводов в контроллерах idiBus. Без кабельных каналов. Дешево и сердито.

Читать дальше →

Portable SystemVerilog Examples for ASIC and FPGA: the results of the meetup on 2024-01-21 and the next steps

Reading time4 min
Reach and readers2.6K

The second meetup of the Portable SystemVerilog Examples group on January 21 2024 at Hacker Dojo in Mountain View, California, went as planned: we moved from the stage of presenting the project to the self-introductions of the participants and the initial tutorial with the first examples. We also started distributing the tasks. The next meetup is tentatively scheduled for January 28 at the same location, from 2 pm to 5 pm. The contents of the meeting will be to work on the examples: basics-graphics-music and systemverilog-homework.

Read more