{"id":443312,"date":"2024-12-26T07:22:00","date_gmt":"2024-12-26T07:22:00","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=443312"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=443312","title":{"rendered":"<span>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Cortex-M3 hard core processor \u0432 \u041f\u041b\u0418\u0421 GOWIN<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u044b\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f ARM \u044f\u0434\u0440\u0430, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u041f\u041b\u0418\u0421 GOWIN GW1NSR-4C, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u043e\u0431\u0449\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <a href=\"https:\/\/ru.ruwiki.ru\/wiki\/%D0%A4%D0%B0%D0%B7%D0%BE%D0%B2%D0%B0%D1%8F_%D0%BC%D0%B0%D0%BD%D0%B8%D0%BF%D1%83%D0%BB%D1%8F%D1%86%D0%B8%D1%8F\" rel=\"noopener noreferrer nofollow\">PSK31<\/a> \u0441\u0438\u0433\u043d\u0430\u043b\u0430. \u0421\u0438\u0433\u043d\u0430\u043b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0441\u0438\u043d\u0443\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 <a href=\"https:\/\/habr.com\/p\/862842\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0430 LilyGO T-FPGA, \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u041f\u041b\u0418\u0421 GW1NSR-LV4CQN48PC6\/I5, \u0426\u0410\u041f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 DAC904, ide GOWIN FPGA Designer \u0438 <a href=\"https:\/\/www.gowinsemi.com\/en\/support\/database\/1331\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f GMD<\/a>.<\/p>\n<blockquote>\n<p><em>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440<br \/>\u0422\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0434\u0438\u043e\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0448\u0430\u043b\u0438\u0442\u044c, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u043d\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u043e-\u043f\u0440\u0430\u0432\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0430, \u043d\u0430 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0448\u0430\u043b\u043e\u0441\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0440\u0430\u0434\u0438\u043e\u043f\u043e\u0437\u044b\u0432\u043d\u043e\u0439 \u0438 \u0438\u0437\u0431\u0430\u0432\u044c\u0442\u0435\u0441\u044c \u043e\u0442 \u043f\u0430\u0440\u0430\u0437\u0438\u0442\u043d\u044b\u0445 \u0433\u0430\u0440\u043c\u043e\u043d\u0438\u043a.<\/em><\/p>\n<p><em>\u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043f\u0430\u0440\u0443 \u0434\u043d\u0435\u0439 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u043c\u0438 \u043f\u043b\u0430\u0442\u0430\u043c\u0438. \u042d\u0442\u043e \u043d\u0435 \u043e\u043f\u044b\u0442 \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043f\u043e\u0434 \u041f\u041b\u0418\u0421 \u0438 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u044d\u0442\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044b\u0445 \u0442\u0435\u043c\u0430\u0445 \u0438 \u0434\u0430\u0434\u0443\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043a\u0440\u0438\u0442\u0438\u043a\u0443.<\/em><\/p>\n<\/blockquote>\n<p>\u041f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443 ARM \u044f\u0434\u0440\u0430 \u0432 \u041f\u041b\u0418\u0421 GOWIN \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 <a href=\"https:\/\/www.gowinsemi.com\/en\/support\/arm\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 GOWIN<\/a> \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043d\u0430 <a href=\"https:\/\/github.com\/verilog-indeed\/gowin_fpga_tutorials\/tree\/main\/gowin_empu\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 GITHUB<\/a>. \u0412 \u0444\u0430\u0439\u043b\u0435 README \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 ARM \u044f\u0434\u0440\u0430 \u0432 \u041f\u041b\u0418\u0421 GW1NSR-LV4CQN48PC6\/I5 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0441\u0438\u043d\u0443\u0441\u0430 \u0432 \u041f\u041b\u0418\u0421 \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f\u0446\u0438\u0438 psk \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0435 ARM \u044f\u0434\u0440\u043e Cortex-m3. \u0427\u0442\u043e\u0431\u044b \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0438 \u043b\u043e\u0433\u0438\u043a\u0443 \u041f\u041b\u0418\u0421 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c SPI \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u041f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432 \u0434\u0438\u0437\u0430\u0439\u043d IP MCU \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c SPI \u0448\u0438\u043d\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5d3\/2ee\/846\/5d32ee846b99cf11b69610f70cac2914.png\" alt=\"\u0420\u0438\u0441. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 SPI \u0432 IP generator\" title=\"\u0420\u0438\u0441. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 SPI \u0432 IP generator\" width=\"848\" height=\"786\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5d3\/2ee\/846\/5d32ee846b99cf11b69610f70cac2914.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 SPI \u0432 IP generator<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/Xinyuan-LilyGO\/T-FPGA\/tree\/main\/example\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440 <\/a>\u043e\u0442 LiLyGO, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0438\u0433\u0430\u043d\u0438\u0435\u043c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u043e\u0433\u043e \u043a FPGA, \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0412 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 ESP32-S3, \u0440\u0430\u0437\u043c\u0435\u0449\u0451\u043d\u043d\u044b\u0439 \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0435. \u0414\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 \u041f\u041b\u0418\u0421 Cortex-M3.<\/p>\n<blockquote>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u043e\u043c \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 Cortex-M3 \u0432 \u041f\u041b\u0418\u0421 \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043c\u0438\u0433\u0430\u043d\u0438\u0435 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b <code>led<\/code> \u0431\u044b\u043b \u0432\u043a\u043b\u044e\u0447\u0451\u043d \u043f\u0440\u044f\u043c\u043e \u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Gowin_EMPU_Top <code>.gpio(led)<\/code> (<em>\u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <\/em><code>output reg led<\/code><em> \u043a\u0430\u043a \u0432 <\/em><a href=\"https:\/\/github.com\/Xinyuan-LilyGO\/T-FPGA\/blob\/main\/example\/FPGA\/led\/src\/led.v\" rel=\"noopener noreferrer nofollow\"><em>\u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/em><\/a><em>, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e <\/em><code>output led<\/code><em> . \u0418\u043d\u0430\u0447\u0435 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442 \u0441\u0438\u043d\u0442\u0435\u0437, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Cortex-M3 \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 GPIO. &#8212; \u043f\u0440\u0438\u043c. \u0410\u0432\u0442.<\/em>) .<\/p>\n<\/blockquote>\n<h2>\u041f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442. Cortex-M3 SPI blink<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 MCU \u0432 \u0444\u0430\u0439\u043b \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u044b MCU \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043f\u043e\u0440\u0442\u0430\u043c \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f.<\/p>\n<pre><code class=\"cpp\">wirecs; wiresck; wireMOSI; wireMISO; wire           [7:0]gpio;  \/\/--------Copy here to design--------  Gowin_EMPU_Top cortexM3_inst(     .sys_clk(clk_60M),   \/\/input sys_clk     .gpio(gpio[7:0]),    \/\/inout [15:0] gpio     .uart0_rxd(1'b1),    \/\/input uart0_rxd     .uart0_txd(UART_TX), \/\/output uart0_txd     .mosi(MOSI),         \/\/output mosi     .miso(MISO),         \/\/input miso     .sclk(sck),          \/\/output sclk     .nss(cs),            \/\/output nss     .reset_n(1'b1)       \/\/input reset_n );<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0442\u0430\u043a\u0442\u043e\u0432\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b &#8212; \u044d\u0442\u043e \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 PLL. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u044d\u0442\u0438\u043c\u0438 IP \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0438 \u0432 <a href=\"https:\/\/github.com\/verilog-indeed\/gowin_fpga_tutorials\/tree\/main\/gowin_empu\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043f\u0440\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Cortex-M3 \u0432 \u041f\u041b\u0418\u0421<\/a>, \u0438 \u0432 \u0431\u043b\u043e\u0433\u0435 <a href=\"https:\/\/marsohod.org\/projects\/marsohod3gw-prj\/432-gowin-rpll\" rel=\"noopener noreferrer nofollow\">Marsohod.org<\/a>. GPIO \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u043a\u0430\u043a wire, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043e\u043d\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f. \u0421\u0438\u0433\u043d\u0430\u043b\u044b SPI \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u043a\u0430\u043a wire. \u041c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432\u043d\u0443\u0442\u0440\u044c \u041f\u041b\u0418\u0421, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u043b\u043e\u0433\u0438\u043a\u0438 \u041f\u041b\u0418\u0421 \u043d\u0430\u0440\u0443\u0436\u0443 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e.\u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043a\u0430\u043a \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f constraints \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0438\u043d\u0442\u0435\u0437\u0430, \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 bitstream \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u041a\u0430\u043a \u0438 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 Gowin&#8217;s MCU Designer.<\/p>\n<p>\u041f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c \u043f\u043e\u043b\u043d\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f SPI blink \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u041f\u041b\u0418\u0421. <\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">module led(     input clk,     inputrst,     output reg          led,      output UART_TX,          outputrxd_flag );  wirecs; wiresck; wireMOSI; wireMISO;  wire[7:0]rxd_out;  \/\/-------------------------------------------- reg [7:0] txd_dat; wire clk_60M; \/\/--------------------------------------------  wire pll_out_clk;  \/\/-------------------------------------------  wire [7:0]gpio;  \/\/--------Copy here to design--------  Gowin_EMPU_Top cortexM3_inst(     .sys_clk(clk_60M), \/\/input sys_clk     .gpio(gpio[7:0]), \/\/inout [15:0] gpio     .uart0_rxd(1'b1), \/\/input uart0_rxd     .uart0_txd(UART_TX), \/\/output uart0_txd     .mosi(MOSI), \/\/output mosi     .miso(MISO), \/\/input miso     .sclk(sck), \/\/output sclk     .nss(cs), \/\/output nss     .reset_n(1'b1) \/\/input reset_n );  \/\/--------Copy end-------------------  always@(posedge rxd_flag or negedge rst)begin     if(!rst)         txd_dat &lt;= 8'b11000011; else     begin         txd_dat &lt;= rxd_out + 1'b1; \/\/\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 +1 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044e     end end  always@(posedge rxd_flag or negedge rst)begin     if(!rst)         led&lt;=1'b0;     else if(rxd_out&lt;8'h80)         begin             led&lt;=1'b1;         end     else         begin             led&lt;=1'b0;         end end  \/\/--------Copy here to design--------  Gowin_PLLVR1 your_instance_name(     .clkout(clk_60M), \/\/output clkout     .clkin(clk) \/\/input clkin );  \/\/--------Copy end-------------------  spi_slaver spi_slaver1(     .clk(clk_60M), \/\/ clk_30M     .rst(rst),     .cs(cs),     .sck(sck),     .MOSI(MOSI),     .MISO(MISO),     .rxd_out(rxd_out),     .txd_data(txd_dat),     .rxd_flag(rxd_flag) );  endmodule<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u0434 \u044d\u0442\u0438\u043c \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c \u0444\u0430\u0439\u043b .cst, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f SPI blink.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">\/\/Copyright (C)2014-2021 Gowin Semiconductor Corporation. \/\/All rights reserved.  \/\/File Title: Physical Constraints file \/\/GOWIN Version: 1.9.8.01 \/\/Part Number: GW1NSR-LV4CQN48PC6\/I5 \/\/Device: GW1NSR-4C \/\/Created Time: Tue 02 21 14:47:43 2023  IO_LOC \"led\" 15; IO_PORT \"led\" IO_TYPE=LVCMOS33 PULL_MODE=UP DRIVE=8; IO_LOC \"clk\" 45; IO_PORT \"clk\" IO_TYPE=LVCMOS33 PULL_MODE=UP;  IO_LOC \"rst\" 46; IO_PORT \"rst\" IO_TYPE=LVCMOS33 PULL_MODE=UP;  IO_LOC \"UART_TX\" 22; IO_PORT \"UART_TX\" IO_TYPE=LVCMOS33 PULL_MODE=NONE DRIVE=8 OPEN_DRAIN=ON;  \/\/------------------------------------------------------------- IO_LOC \"rxd_flag\" 42; IO_PORT \"rxd_flag\" IO_TYPE=LVCMOS33 PULL_MODE=NONE DRIVE=8;<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u041f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421 \u0432 IDE GMD<\/h2>\n<blockquote>\n<p>\u0412 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f Gowin&#8217;s MCU Designer. \u041d\u043e \u0443 \u0430\u0432\u0442\u043e\u0440\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043f\u043e \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435. \u041d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/www.gowinsemi.com\/en\/support\/database\/569\/?support_search=GOWIN+MCU+Designer\" rel=\"noopener noreferrer nofollow\">GOWIN <\/a>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u041f\u041e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<\/blockquote>\n<p>\u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u043c \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0435 SDK \u043e\u0442 Gowin \u0434\u043b\u044f GW1NS(R)-4C \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SPI. \u041e\u0442\u043b\u0438\u0447\u0438\u0435\u043c \u043e\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0430\u044f \u0442\u0430\u043a\u0442\u043e\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c 60 \u041c\u0413\u0446. \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0431\u044b\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0435 PLL (<code>.clkout(clk_60M), \/\/output clkout<\/code> . &#8212; \u043f\u0440\u0438\u043c. \u0410\u0432\u0442.) \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 MCU \u0447\u0435\u0440\u0435\u0437 <code>wire clk_60M;<\/code> . \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 <code>lib\/CMSIS\/DeviceSupport\/system\/system_gw1ns4c.c<\/code>.<\/p>\n<pre><code class=\"cpp\">#define __SYSTEM_CLOCK    (60000000UL)   \/* 60MHz *\/ <\/code><\/pre>\n<blockquote>\n<p>\u0412 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u044f\u0434\u0440\u043e \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043e\u0442 80 \u041c\u0413\u0446, \u043d\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u043f\u043e\u0440\u043d\u043e\u0433\u043e \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0433\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 T-FPGA \u0432\u044b\u0431\u0440\u0430\u043d \u043a\u0432\u0430\u0440\u0446 \u0441 \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439 27 \u041c\u0413\u0446. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SPI \u0435\u0441\u0442\u044c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438 \u043d\u0430 8, 6, 4, 3 \u0438 2, \u043d\u043e IP generator PLL \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438 \u0434\u043b\u044f 80 \u041c\u0413\u0446. \u0417\u0430\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u043b\u044f 60 \u041c\u0413\u0446 \u0438\u0437 27 \u041c\u0413\u0446 \u0438 \u0442\u043e\u0433\u0434\u0430 \u0434\u043b\u044f SPI \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c 6.<\/p>\n<\/blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0435\u0441\u043b\u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c \u0432 main.c, \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d \u043a \u043b\u043e\u0433\u0438\u043a\u0435 \u041f\u041b\u0418\u0421, \u043d\u0430\u0447\u043d\u0451\u0442 \u043c\u0438\u0433\u0430\u0442\u044c \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Cortex-M3. \u041a\u0430\u043a \u0438 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c <a href=\"https:\/\/github.com\/Xinyuan-LilyGO\/T-FPGA\/blob\/main\/example\/ESP32-S3\/spi_blink\/spi_blink.ino\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u0435 <\/a>\u0447\u0435\u0440\u0435\u0437 SPI \u043f\u043e\u043e\u0447\u0435\u0440\u0451\u0434\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0x01 \u0438\u043b\u0438 0x81 \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043b\u043e\u0433\u0438\u043a\u0430 FPGA \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">\/*  * *****************************************************************************************  *  * Copyright (C) 2014-2021 Gowin Semiconductor Technology Co.,Ltd.  *  * @filemain.c  * @authorEmbedded Development Team  * @versionV1.x.x  * @date2021-01-01 09:00:00  * @briefMain program body.  ******************************************************************************************  *\/  \/* Includes ------------------------------------------------------------------*\/ #include \"gw1ns4c.h\" #include &lt;stdio.h&gt;  \/* Includes ------------------------------------------------------------------*\/ void SPIInit(void); void initializeUART(); void initializeTimer(); void delayMillis(uint32_t ms);  \/* Functions ------------------------------------------------------------------*\/ int main(void) {   SystemInit();\/\/Initializes system   SPIInit();\/\/Initializes SPI   initializeUART();   initializeTimer();    SPI_Select_Slave(0x01) ;\/\/Select The SPI Slave   SPI_WriteData(0x01);\/\/Send Jedec    printf(\"init complete\\r\\n\");    uint32_t counter = 0;    while(1)   {        counter++;   printf(\"GowinFPGA says hi! Count: %d\\r\\n\", counter);    if(~SPI_GetToeStatus() &amp;&amp; SPI_GetTrdyStatus() == 1)   {       SPI_WriteData(0x81);   }    delayMillis(500);    if(~SPI_GetToeStatus() &amp;&amp; SPI_GetTrdyStatus() == 1)   {   SPI_WriteData(0x01);   }   delayMillis(500);   } }  \/\/Initializes SPI void SPIInit(void) { SPI_InitTypeDef init_spi;    init_spi.CLKSEL= CLKSEL_CLK_DIV_6;\/\/60MHZ \/ 6   init_spi.DIRECTION = DISABLE;\/\/MSB First   init_spi.PHASE =DISABLE;\/\/ENABLE;\/\/posedge   init_spi.POLARITY =DISABLE;\/\/polarity 0    SPI_Init(&amp;init_spi); }  \/\/Initializes UART0   void initializeUART()   {   UART_InitTypeDef uartInitStruct;   \/\/Enable transmission   uartInitStruct.UART_Mode.UARTMode_Tx = ENABLE;   \/\/Disable reception   uartInitStruct.UART_Mode.UARTMode_Rx = DISABLE;   \/\/9600 baud rate typical of Arduinos   uartInitStruct.UART_BaudRate = 9600;   \/\/Initialize UART0 using the struct configs   UART_Init(UART0, &amp;uartInitStruct);   }    void initializeTimer() {     TIMER_InitTypeDef timerInitStruct;      timerInitStruct.Reload = 0;      \/\/Disable interrupt requests from timer for now     timerInitStruct.TIMER_Int = DISABLE;      \/\/Disable timer enabling\/clocking from external pins (GPIO)     timerInitStruct.TIMER_Exti = TIMER_DISABLE;      TIMER_Init(TIMER0, &amp;timerInitStruct);     TIMER_StopTimer(TIMER0);     }      #define CYCLES_PER_MILLISEC (SystemCoreClock \/ 1000)     void delayMillis(uint32_t ms) {     TIMER_StopTimer(TIMER0);     TIMER_SetValue(TIMER0, 0); \/\/Reset timer just in case it was modified elsewhere     TIMER_EnableIRQ(TIMER0);      uint32_t reloadVal = CYCLES_PER_MILLISEC * ms;     \/\/Timer interrupt will trigger when it reaches the reload value     TIMER_SetReload(TIMER0, reloadVal);      TIMER_StartTimer(TIMER0);     \/\/Block execution until timer wastes the calculated amount of cycles     while (TIMER_GetIRQStatus(TIMER0) != SET);      TIMER_StopTimer(TIMER0);     TIMER_ClearIRQ(TIMER0);     TIMER_SetValue(TIMER0, 0);     }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u0438\u043a\u0440\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u041f\u041b\u0418\u0421, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a\u0430 PSK31. <\/p>\n<h2>\u041a\u043e\u0440\u043e\u0442\u043a\u043e\u0432\u043e\u043b\u043d\u043e\u0432\u044b\u0439 \u0440\u0430\u0434\u0438\u043e\u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a PSK31<\/h2>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f DAC904 \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 (\u043a\u0430\u043a \u0438 \u0432 <a href=\"https:\/\/habr.com\/p\/862842\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>. &#8212; \u043f\u0440\u0438\u043c. \u0410\u0432\u0442.). \u041f\u0440\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 PSK \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d <a href=\"https:\/\/github.com\/F4GOJ\/HFBEACON\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f GitHub<\/a>. \u0414\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f PSK \u043c\u043e\u0434\u0443\u043b\u044f\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0444\u0430\u0437\u0443. \u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u0427\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u0430\u0437\u043e\u0439, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <code>dds_addr<\/code> \u0441\u0434\u0435\u043b\u0430\u0442\u044c <code>PWORD<\/code> \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">module dds_addr (clk, rst_n, addr_out, strobe, FWORD, PWORD);     input clk, rst_n;          \/\/ Resetting the system clock     input [31:0] FWORD;     input [15:0] PWORD;      output [11: 0] addr_out;    \/\/ The output address corresponding to the data in the ROM      output strobe;     parameter N = 32;  \/\/    parameter PWORD = 2048;     \/\/ Phase control word (x\/360) * 256 \/\/    parameter FWORD = 3316669189;  \/\/ \u0441\u043b\u043e\u0432\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439 F_out = B * (F_clk \/ 2 ** 32), fword = B 5KHZ \/\/ 858994      reg [N-1: 0] addr;         \/\/ 32-bit battery  \/\/    reg [11:0] addr;      reg [15:0] pword;     always @ (posedge clk)begin         pword &lt;= PWORD;     end      reg [31:0] fword;     always @ (posedge clk)begin         fword &lt;= FWORD;     end     reg strobe_r;     always @ (posedge clk or negedge rst_n)     begin        if (!rst_n)            begin               addr &lt;= 0;              end       else           begin               \/\/Each word size outputs an address, if the word control frequency is 2, then the output of the address counter is 0, 2, 4...               addr &lt;= addr + fword;               if (addr[N-1:N-12] + PWORD == 12'hc00) begin                   strobe_r &lt;= 1'b1;               end               else begin                   strobe_r &lt;= 1'b0;               end \/\/              addr &lt;= addr + 1;           end          end      \/\/Assign the top eight bits of the battery address to the output address (ROM address     assign addr_out = addr[N-1:N-12] + PWORD;      assign strobe = strobe_r; endmodule<\/code><\/pre>\n<p><a class=\"anchor\" name=\"phase_calc\" id=\"phase_calc\"><\/a><\/p>\n<p>\u041f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 <code>dds_addr<\/code> \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u044b. \u0424\u0430\u0437\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <code>2^12<\/code> . \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u0430\u044f \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0442\u0430 \u043d\u0430 4096 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438 \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0442\u044c \u0444\u0430\u0437\u0443 \u0441\u0438\u0433\u043d\u0430\u043b\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>PWORD<\/code> . PWORD = (x\/360) * 4096. \u0413\u0434\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e? \u0418\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e SIN \u0438 COS \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0444\u0430\u0437\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u043d\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432. \u0422\u043e\u0433\u0434\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439 (90\/360)*4096=1024. \u0422\u043e \u0435\u0441\u0442\u044c \u0435\u0441\u043b\u0438 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 dds_addr \u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>PWORD=0<\/code>, \u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c <code>PWORD=1024<\/code> , \u044d\u0442\u0438 \u0434\u0432\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0444\u0430\u0437\u0435 \u043d\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432.<\/p>\n<pre><code class=\"cpp\">\/\/ --------------Phase-based  module------------------------    dds_addr dds_addr_inst (     .clk(clk),              \/\/ input wire clk     .rst_n(1'b1),           \/\/ input wire rst_n \/\/ 1 enable     .addr_out(addr_out),    \/\/ output wire [11 : 0] addr_out     .strobe(strobe_sin),     .FWORD(32'd1613094272), \/\/ F_out = B * (F_clk \/ 2 ** 32) \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0440\u0430\u0432\u043d\u0430 10.1406 \u041a\u0413\u0446     .PWORD(16'd2048)        \/\/ (x\/360) * 4096 \u0444\u0430\u0437\u0430 \u0440\u0430\u0432\u043d\u0430 Pi );   \/\/----------------------------------------------------------<\/code><\/pre>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0432\u043e\u043b\u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0438 \u0444\u0430\u0437\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043e SPI. \u0414\u043b\u044f \u043f\u0440\u0438\u0451\u043c\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 FPGA \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<pre><code class=\"cpp\">reg [31:0] fword; reg [31:0] oneBytes_f; reg [31:0] twoBytes_f; reg [31:0] thrBytes_f; reg [ 3:0] state_reg_f;  always@(posedge rxd_flag or negedge rst)begin     if(!rst)begin         fword &lt;= 1'b0;     end     else if(rxd_out==8'h01)         begin             state_reg_f &lt;= 0;             oneBytes_f &lt;= 0;         end     else         begin             case(state_reg_f)                 4'd0: begin                     oneBytes_f &lt;= oneBytes_f + rxd_out;                     state_reg_f &lt;= 1;                 end                  4'd1: begin                     twoBytes_f &lt;= oneBytes_f + (rxd_out &lt;&lt; 8); \/\/ +tmp                     state_reg_f &lt;= 2;                 end                  4'd2: begin                     thrBytes_f &lt;= twoBytes_f + (rxd_out &lt;&lt; 16); \/\/ +tmp                     state_reg_f &lt;= 3;                 end                  4'd3: begin                     fword &lt;= thrBytes_f + (rxd_out &lt;&lt; 24); \/\/ +tmp                     state_reg_f &lt;= 4; \/\/                    led &lt;= !led;                 end                                  default: begin                     state_reg_f &lt;= 4;                 end             endcase         end end<\/code><\/pre>\n<p>\u0410 \u0434\u043b\u044f \u043f\u0440\u0438\u0451\u043c\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0430\u0437\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code class=\"cpp\">reg [15:0] oneBytes_p; reg [15:0] pword_reg; reg [ 3:0] state_reg_p = 4;  always@(posedge rxd_flag or negedge rst)begin     if(!rst)begin         pword_reg &lt;= 0;     end         else if(rxd_out==8'h02)         begin             state_reg_p &lt;= 0;         end     else         begin             case(state_reg_p)                        4'd0: begin                     oneBytes_p &lt;= rxd_out;                     state_reg_p &lt;= 1;                 end                  4'd1: begin                     pword_reg &lt;= oneBytes_p + (rxd_out &lt;&lt; 8);                     state_reg_p &lt;= 4; \/\/ \"\u0434\u0440\u0443\u0433\u043e\u0435\" \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043d\u0435 \u043c\u0435\u0448\u0430\u043b\u0430\u0441\u044c                     led &lt;= !led;                 end                  default: begin                     state_reg_p &lt;= 4; \/\/ \"\u0434\u0440\u0443\u0433\u043e\u0435\" \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043d\u0435 \u043c\u0435\u0448\u0430\u043b\u0430\u0441\u044c                 end             endcase         end end<\/code><\/pre>\n<p>\u0412\u0435\u0441\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">module led(     input clk,     inputrst,     output reg          led,      output [11: 0] sin,     output UART_TX,          output clk_o,      outputrxd_flag  );  wirecs; wiresck; wireMOSI; wireMISO;  wire[7:0]rxd_out;  \/\/-------------------------------------------- reg [7:0] txd_dat; wire clk_60M; \/\/-------------------------------------------- wire [11: 0] addr_out; wire pll_out_clk; \/\/-------------------------------------------  wire [7:0]gpio;  \/\/--------Copy here to design--------  Gowin_EMPU_Top cortexM3_inst(     .sys_clk(clk_60M), \/\/input sys_clk     .gpio(gpio[7:0]), \/\/inout [15:0] gpio     .uart0_rxd(1'b1), \/\/input uart0_rxd     .uart0_txd(UART_TX), \/\/output uart0_txd     .mosi(MOSI), \/\/output mosi     .miso(MISO), \/\/input miso     .sclk(sck), \/\/output sclk     .nss(cs), \/\/output nss     .reset_n(1'b1) \/\/input reset_n );  \/\/--------Copy end-------------------  \/\/assign led = gpio[7];  always@(posedge rxd_flag or negedge rst)begin     if(!rst)         txd_dat &lt;= 8'b11000011; else     begin         txd_dat &lt;= rxd_out + 1'b1; \/\/\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 +1 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044e     end end  reg [31:0] fword; reg [31:0] oneBytes_f; reg [31:0] twoBytes_f; reg [31:0] thrBytes_f; reg [ 3:0] state_reg_f;  always@(posedge rxd_flag or negedge rst)begin     if(!rst)begin         fword &lt;= 1'b0;     end     else if(rxd_out==8'h01)         begin             state_reg_f &lt;= 0;             oneBytes_f &lt;= 0;         end     else         begin             case(state_reg_f)                 4'd0: begin                     oneBytes_f &lt;= oneBytes_f + rxd_out;                     state_reg_f &lt;= 1;                 end                  4'd1: begin                     twoBytes_f &lt;= oneBytes_f + (rxd_out &lt;&lt; 8); \/\/ +tmp                     state_reg_f &lt;= 2;                 end                  4'd2: begin                     thrBytes_f &lt;= twoBytes_f + (rxd_out &lt;&lt; 16); \/\/ +tmp                     state_reg_f &lt;= 3;                 end                  4'd3: begin                     fword &lt;= thrBytes_f + (rxd_out &lt;&lt; 24); \/\/ +tmp                     state_reg_f &lt;= 4; \/\/                    led &lt;= !led;                 end                                  default: begin                     state_reg_f &lt;= 4;                 end             endcase         end end  reg [15:0] oneBytes_p; reg [15:0] pword_reg; reg [ 3:0] state_reg_p = 4;  always@(posedge rxd_flag or negedge rst)begin     if(!rst)begin         pword_reg &lt;= 0;     end         else if(rxd_out==8'h02)         begin             state_reg_p &lt;= 0;         end     else         begin             case(state_reg_p)                        4'd0: begin                     oneBytes_p &lt;= rxd_out;                     state_reg_p &lt;= 1;                 end                  4'd1: begin                     pword_reg &lt;= oneBytes_p + (rxd_out &lt;&lt; 8);                     state_reg_p &lt;= 4; \/\/ \"\u0434\u0440\u0443\u0433\u043e\u0435\" \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043d\u0435 \u043c\u0435\u0448\u0430\u043b\u0430\u0441\u044c                     led &lt;= !led;                 end                  default: begin                     state_reg_p &lt;= 4; \/\/ \"\u0434\u0440\u0443\u0433\u043e\u0435\" \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043d\u0435 \u043c\u0435\u0448\u0430\u043b\u0430\u0441\u044c                 end             endcase         end end  \/\/--------Copy here to design--------  Gowin_PLLVR1 your_instance_name(     .clkout(clk_60M), \/\/output clkout     .clkin(clk) \/\/input clkin );  spi_slaver spi_slaver1(     .clk(clk_60M), \/\/ clk_30M     .rst(rst),     .cs(cs),     .sck(sck),     .MOSI(MOSI),     .MISO(MISO),     .rxd_out(rxd_out),     .txd_data(txd_dat),     .rxd_flag(rxd_flag) );  \/\/-------------------------------------------  \/\/ --------------Phase-based  module------------------------    dds_addr dds_addr_inst (     .clk(clk),            \/\/ input wire clk     .rst_n(1'b1),        \/\/ input wire rst_n \/\/ 1 enable     .addr_out(addr_out),  \/\/ output wire [7 : 0] addr_out     .strobe(strobe_sin),     .FWORD(fword), \/\/ fword \/\/ fword_valid     .PWORD(pword_reg) \/\/ tmp5 \/\/ 16'd2048 );   \/\/----------------------------------------------------------  \/\/ Waveform Data Module        Gowin_pROM rom_inst (     .dout(sin), \/\/output [11:0] dout     .clk(clk), \/\/input clk     .oce(), \/\/input oce     .ce(1'b1), \/\/input ce     .reset(1'b0), \/\/input reset \/\/ 0 enable     .ad(addr_out) \/\/input [11:0] ad );  assign clk_o = clk;  endmodule<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Cortex-M3 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b <code>hfbeacon.c<\/code> \u0438 <code>hfbeacon.h<\/code> . \u0424\u0430\u0439\u043b\u044b \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0438 \u0444\u0430\u0437\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0430. \u0412 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u044f\u0437\u044b\u043a\u0430 C \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0438 \u0444\u0430\u0437\u044b \u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>checkGen(struct Gen *gen)<\/code> . \u041a\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 <code>hfbeacon.c<\/code> , \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (<em>\u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0438\/\u0438\u043b\u0438 \u0444\u0430\u0437\u044b. &#8212; \u043f\u0440\u0438\u043c. \u0410\u0432\u0442.<\/em>) \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c, \u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e SPI \u0432 \u043b\u043e\u0433\u0438\u043a\u0443 \u041f\u041b\u0418\u0421.<\/p>\n<pre><code class=\"cpp\">extern uint8_t checkGen(struct Gen *gen){ uint8_t res = 0; if(old_freq != gen-&gt;freq){ res = 1; send_frequency(&amp;gen-&gt;freq); old_freq = gen-&gt;freq; }  if(old_phase != gen-&gt;phase){ res = 2; \/\/printf(\"old_phase\\r\\n\"); send_phase(&amp;gen-&gt;phase); old_phase = gen-&gt;phase; }  return res; }<\/code><\/pre>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>void send_frequency(uint32_t *freq)<\/code> \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0442\u0430\u043a\u0430\u044f \u0436\u0435, \u043d\u043e \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SPI \u0432 Cortex-M3 \u0432 \u041f\u041b\u0418\u0421 GW1NSR-4C. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u0441\u0432\u043e\u044e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0442\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0438\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 2-\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0435.<\/p>\n<blockquote>\n<p>\u041f\u0435\u0440\u0435\u0434 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0441 T-FPGA  \u0431\u044b\u043b \u043f\u0440\u043e\u0432\u0435\u0434\u0451\u043d \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441 Arduino Nano \u0438 AD9833 \u043d\u0430 \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u043e\u0439 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0435. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u044d\u0442\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e <a href=\"https:\/\/github.com\/NSV47\/ad9833_beacon_bpsk31\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0415\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>hfbeacon.c<\/code> , \u0442\u043e \u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0441 ad9850, \u0438 ad9833. \u0422\u0430\u043c \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u0438\u0434\u043d\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0430\u0437\u044b \u0432 <code>hfbeacon.c<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 ad9833 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0443\u0433\u043b\u0430 \u0432 \u0433\u0440\u0430\u0434\u0443\u0441\u0430\u0445 \u043d\u0430 \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<\/blockquote>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <code>hfbeacon.c<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 5-\u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0442\u0430 \u043d\u0430 32 \u0447\u0430\u0441\u0442\u0438 \u043f\u043e 11,25 \u0433\u0440\u0430\u0434\u0443\u0441\u0430 (<em>2^5=32, 360\/32=11,25. &#8212; \u043f\u0440\u0438\u043c. \u0410\u0432\u0442.<\/em>). \u0422\u043e \u0435\u0441\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u044b \u0438\u0437 <code>hfbeacon.c<\/code> \u0432 \u0433\u0440\u0430\u0434\u0443\u0441\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 11.25. \u0422\u043e\u0433\u0434\u0430, <a href=\"#phase_calc\" rel=\"noopener noreferrer nofollow\">\u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0444\u0430\u0437\u044b<\/a>, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u0433\u043b\u0430 \u0432 \u0433\u0440\u0430\u0434\u0443\u0441\u0430\u0445 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 360, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0430 4096. \u0418 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e SPI \u0432 \u043b\u043e\u0433\u0438\u043a\u0443 \u041f\u041b\u0418\u0421. \u041f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0430\u0437\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a <code>0x02<\/code> \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u044b.<\/p>\n<pre><code class=\"cpp\">void send_phase(uint32_t *phase){ \/\/printf(\"send_phase\\r\\n\");     uint32_t pword;      pword=(((float)(*phase)*11.25)\/360)*4096;      uint8_t buff[2];      buff[0] = pword       &amp; 0xff;     buff[1] = pword &gt;&gt;  8 &amp; 0xff;      if(~SPI_GetToeStatus() &amp;&amp; SPI_GetTrdyStatus() == 1) { SPI_WriteData(0x02); \/\/ \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0430\u0437\u044b }      for(uint8_t i=0;i&lt;2;++i){     if(~SPI_GetToeStatus() &amp;&amp; SPI_GetTrdyStatus() == 1) { SPI_WriteData(buff[i]); }     } }<\/code><\/pre>\n<p>\u041f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c \u0444\u0430\u0439\u043b <code>hfbeacon.c<\/code><\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;hfbeacon.h&gt;  \/***************************************************************************  * CW  ***************************************************************************\/ void cwTx(long freqCw, char * stringCw, int cwWpm, struct Gen *gen){ \/\/ AD9833 *genPtr static int const morseVaricode[2][59]  = { \/\/ PROGMEM {0,212,72,0,144,0,128,120,176,180,0,80,204,132,84,144,248,120,56,24,8,0,128,192,224,240,224,168,0,136,0,48,104,64,128,160,128,0,32,192,0,0,112,160,64,192,128,224,96,208,64,0,128,32,16,96,144,176,192}, {7,6,5,0,4,0,4,6,5,6,0,5,6,6,6,5,5,5,5,5,5,5,5,5,5,5,6,6,0,5,0,6,6,2,4,4,3,1,4,3,4,2,4,3,4,2,2,3,4,4,3,3,1,3,4,3,4,4,4} };  int tempo = 1200 \/ cwWpm; \/\/ Duration of 1 dot uint8_t nb_bits,val; int d; int c = *stringCw++; while(c != '\\0'){ c = toupper(c); \/\/ Uppercase if(c == 32){       \/\/ Space character between words in string \/\/DDS.setfreq(0,0); \/\/ 7 dots length spacing \/\/genPtr-&gt;ApplySignal(SQUARE_WAVE,REG0,0); \/\/ SINE_WAVE \/\/ SQUARE_WAVE \/\/ HALF_SQUARE_WAVE gen-&gt;freq = 0; checkGen(gen); delayMillis(tempo * 7); \/\/ between words } else if (c &gt; 32 &amp;&amp; c &lt; 91) { c = c - 32; d = morseVaricode[0][c];    \/\/ Get CW varicode \/\/ int(pgm_read_word(&amp; )) nb_bits = morseVaricode[1][c]; \/\/ Get CW varicode length \/\/ int(pgm_read_word(&amp; )) if(nb_bits != 0){ \/\/ Number of bits = 0 -&gt; invalid character #%&lt;&gt; for(int b = 7; b &gt; 7 - nb_bits; b--){ \/\/ Send CW character, each bit represents a symbol (0 for dot, 1 for dash) MSB first val=bitRead(d,b);  \/\/look varicode \/\/DDS.setfreq(freqCw,0); \/\/ Let's transmit \/\/gen.ApplySignal(SQUARE_WAVE,REG0,((freqCw)*1000ul)); \/\/ SINE_WAVE \/\/ SQUARE_WAVE \/\/ HALF_SQUARE_WAVE \/\/genPtr-&gt;ApplySignal(SQUARE_WAVE,REG0,(freqCw)); \/\/ SINE_WAVE \/\/ SQUARE_WAVE \/\/ HALF_SQUARE_WAVE gen-&gt;freq = freqCw; checkGen(gen); delayMillis(tempo + 2 * tempo * val);  \/\/ A dot length or a dash length (3 times the dot)        \/\/DDS.setfreq(0,0); \/\/ 1 dot length spacing \/\/genPtr-&gt;ApplySignal(SQUARE_WAVE,REG0,0); \/\/ SINE_WAVE \/\/ SQUARE_WAVE \/\/ HALF_SQUARE_WAVE gen-&gt;freq = 0; checkGen(gen); delayMillis(tempo);     \/\/ between symbols in a character } } \/\/DDS.setfreq(0,0); \/\/ 3 dots length spacing \/\/genPtr-&gt;ApplySignal(SQUARE_WAVE,REG0,0); \/\/ SINE_WAVE \/\/ SQUARE_WAVE \/\/ HALF_SQUARE_WAVE gen-&gt;freq = 0; checkGen(gen); delayMillis(tempo * 3); \/\/ between characters in a word } c = *stringCw++;  \/\/ Next caracter in string } \/\/DDS.setfreq(0, 0); \/\/ No more transmission \/\/  genPtr-&gt;ApplySignal(SQUARE_WAVE,REG0,0); \/\/ SINE_WAVE \/\/ SQUARE_WAVE \/\/ HALF_SQUARE_WAVE gen-&gt;freq = 0;     checkGen(gen); }   \/********************************************************  * PSK  ********************************************************\/ #if 1 void pskTx(long freqPsk, char * stringPsk, int modePsk, int baudsPsk, struct Gen *gen) \/\/ AD9833 *genPtr { static int const PskVaricode[2][128]  = { \/\/ PROGMEM {683,731,749,887,747,863,751,765,767,239,29,879,733,31,885,939,759,757,941,943,859,875,877, 855,891,893,951,853,861,955,763,895,1,511,351,501,475,725,699,383,251,247,367,479,117,53, 87,431,183,189,237,255,375,347,363,429,427,439,245,445,493,85,471,687,701,125,235,173,181, 119,219,253,341,127,509,381,215,187,221,171,213,477,175,111,109,343,437,349,373,379,685,503, 495,507,703,365,735,11,95,47,45,3,61,91,43,13,491,191,27,59,15,7,63,447,21,23,5,55,123,107, 223,93,469,695,443,693,727,949}, {10,10,10,10,10,10,10,10,10,8,5,10,10,5,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 10,1,9,9,9,9,10,10,9,8,8,9,9,7,6,7,9,8,8,8,8,9,9,9,9,9,9,8,9,9,7,9,10,10,7,8,8,8,7,8,8,9,7, 9,9,8,8,8,8,8,9,8,7,7,9,9,9,9,9,10,9,9,9,10,9,10,4,7,6,6,2,6,7,6,4,9,8,5,6,4,3,6,9,5,5,3,6, 7,7,8,7,9,10,9,10,10,10} };  static int const QpskConvol[32]  = {16,8,-8,0,-8,0,16,8,0,-8,8,16,8,16,0,-8,8,16,0,-8,0,-8,8,16,-8,0,16,8,16,8,-8,0}; \/\/ PROGMEM   int shreg = 0;  \/\/ Shift register qpsk int phase = 0; if(0) \/\/ rsidTxEnable == 1 {                                                             \/\/ 0 bpsk31                                                             \/\/ 1 qpsk31                                                             \/\/ 2 bpsk63 rsidTx(freqPsk, (baudsPsk &gt;&gt; 4) - (modePsk == 'B'), gen); \/\/ 3 qpsk63 \/\/ genPtr                                                             \/\/ 6 bpsk125                                                             \/\/ 7 qpsk125 } pskIdle(freqPsk, baudsPsk, gen);  \/\/ A little idle on start of transmission for AFC capture \/\/  uint8_t nb_bits,val; int d,e; int c = *stringPsk++; while (c != '\\0') { d = PskVaricode[0][c];    \/\/ Get PSK varicode    \/\/ int(pgm_read_word(&amp; )) nb_bits = PskVaricode[1][c]; \/\/ Get PSK varicode length \/\/ int(pgm_read_word(&amp; )) d &lt;&lt;= 2; \/\/add 00 on lsb for spacing between caracters e = d; for(int b = nb_bits + 2; b &gt;= 0; b--) \/\/send car in psk { val=bitRead(e,b); \/\/look varicode if(modePsk == 'B')  \/\/ BPSK mode { if (val == 0) { phase = (phase ^ 16) &amp;16;  \/\/ Phase reverted on 0 bit } } else if(modePsk == 'Q'){       \/\/ QPSK mode shreg = (shreg &lt;&lt; 1) | val;  \/\/ Loading shift register with next bit d=(int)QpskConvol[shreg &amp; 31]; \/\/ Get the phase shift from convolution code of 5 bits in shit register \/\/ int(pgm_read_word(&amp; )) phase = (phase + d) &amp; 31;  \/\/ Phase shifting } \/\/DDS.setfreq(freqPsk, phase); \/\/ Let's transmit \/\/gen.ApplySignal(SQUARE_WAVE,REG0,((freqPsk)*1000ul), REG0,phase); \/\/ SINE_WAVE \/\/ SQUARE_WAVE \/\/ HALF_SQUARE_WAVE \/\/genPtr-&gt;ApplySignal(SQUARE_WAVE,REG0,freqPsk, REG0,(float)phase*11.25); \/\/ SINE_WAVE \/\/ SQUARE_WAVE \/\/ HALF_SQUARE_WAVE gen-&gt;freq = freqPsk; gen-&gt;phase = phase; \/\/ (float)phase*11.25; checkGen(gen); delayMillis((961 + baudsPsk) \/ baudsPsk);  \/\/ Gives the baud rate } c = *stringPsk++;  \/\/ Next caracter in string }     pskIdle(freqPsk, baudsPsk, gen); \/\/ A little idle to end the transmission \/\/ genPtr \/\/    DDS.setfreq(0, 0); \/\/ No more transmission \/\/    genPtr-&gt;ApplySignal(SQUARE_WAVE,REG0,0); \/\/ SINE_WAVE \/\/ SQUARE_WAVE \/\/ HALF_SQUARE_WAVE     gen-&gt;freq = freqPsk; checkGen(gen); } #endif  #if 1 void pskIdle(long freqIdle, int baudsIdle, struct Gen *gen) \/\/ AD9833 *genPtr { int phaseIdle = 0; for(int n = 0; n &lt; baudsIdle; n++) { phaseIdle = (phaseIdle ^ 16) &amp; 16;  \/\/ Idle is a flow of zeroes so only phase inversion \/\/DDS.setfreq(freqIdle, phaseIdle);   \/\/ Let's transmit \/\/gen.ApplySignal(SQUARE_WAVE,REG0,((freqIdle)*1000ul), REG0,phaseIdle); \/\/ SINE_WAVE \/\/ SQUARE_WAVE \/\/ HALF_SQUARE_WAVE \/\/genPtr-&gt;ApplySignal(SQUARE_WAVE,REG0,freqIdle, REG0,(float)phaseIdle*11.25); \/\/ SINE_WAVE \/\/ SQUARE_WAVE \/\/ HALF_SQUARE_WAVE gen-&gt;freq = freqIdle; gen-&gt;phase = phaseIdle; \/\/ (float)phase*11.25; checkGen(gen); delayMillis((961 + baudsIdle) \/ baudsIdle);  \/\/ Gives the baud rate  } } #endif <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c \u0444\u0430\u0439\u043b <code>hfbeacon.h<\/code> <\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#ifndef HFBEACON_H #define HFBEACON_H  #define bitRead(value, bit) (((value) &gt;&gt; (bit)) &amp; 0x01)  #include &lt;stdbool.h&gt; #include &lt;ctype.h&gt; #include &lt;stdio.h&gt;  #if 1 struct Gen{ uint32_t freq; uint32_t phase; }; #endif  void rsidToggle(bool rsidEnable); void cwTx(long freqCw, char * stringCw, int cwWpm, struct Gen*); \/\/ , AD9833* void pskTx(long freqPsk, char * stringPsk, int modePsk, int baudsPsk, struct Gen*); \/\/ , AD9833* void rttyTx(long freqRtty, char * stringRtty); void hellTx(long freqHell, char * stringHell); void wsprTx(long freqWspr, char * callWsprTx, char * locWsprTx, char * powWsprTx); void wsprEncode(char * callWsprProc, char * locWsprProc, char * powWsprProc); void ddsPower(int powDds, struct Gen*); \/\/ , AD9833* uint8_t wsprSymb[162]; int wsprSymbGen;  void rsidTx(long freqRsid, int modeRsid, struct Gen*); \/\/ , AD9833* void pskIdle(long freqIdle, int baudsIdle, struct Gen*); \/\/ , AD9833* void rttyTxByte (long freqRttyTxbyte, char c);  uint8_t parity(unsigned long tempo);  \/\/uint8_t rsidTxEnable = 0;  \/\/extern HFBEACON Beacon;  #endif <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<blockquote>\n<p>\u041f\u0435\u0440\u0435\u0434 psk \u043c\u043e\u0434\u0443\u043b\u044f\u0446\u0438\u0435\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0430\u0441\u044c \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u043c\u043e\u0440\u0437\u044f\u043d\u043a\u0430 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438. \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0438 \u0431\u044b\u043b\u0438 \u043f\u043e\u0439\u043c\u0430\u043d\u044b \u0431\u0430\u0433\u0438, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u0441\u0442\u0430\u043b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 &#171;4&#187; \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u0412 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0443\u043b\u044f\u0446\u0438\u0439. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0445 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<\/blockquote>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/NSV47\/T-FPGA-transmitter\/tree\/feature-articleCortexM3\" rel=\"noopener noreferrer nofollow\">\u041f\u041b\u0418\u0421 <\/a>\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 GItHub \u0432 \u0432\u0435\u0442\u043a\u0435 <code>feature-articleCortexM3<\/code> , \u0430 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/NSV47\/GMD_workspace\/blob\/feature-articleBpsk31\/test1\/test1\/template\/main.c\" rel=\"noopener noreferrer nofollow\">Cortex-M3<\/a> \u0432 \u0432\u0435\u0442\u043a\u0435 <code>feature-articleBpsk31<\/code>. \u0422\u0435\u043f\u0435\u0440\u044c, \u0432\u044b\u0437\u044b\u0432\u0430\u044f \u0432 <code>main.c<\/code> \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>pskTx(freq, txString, 'B', 31, &amp;gen);<\/code> \u0438\u0437 \u043f\u0440\u0438\u0451\u043c\u043d\u043e\u0433\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0430 \u0441\u0442\u0430\u043d\u0435\u0442 \u0434\u043e\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0437\u0432\u0443\u043a:<\/p>\n<div class=\"embed_link\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;https:\/\/yastatic.net\/s3\/home-static\/_\/90\/9034470dfcb0bea0db29a281007b8a38.png&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>Yandex<\/span><\/div>\n<p><a href=\"https:\/\/disk.yandex.ru\/showcaptcha?cc=1&amp;mt=F67AD92BB9A87CADB2670C2BEAFC4C6E8ECAA55F2FB7A5EB83DD4E3C91B1BFA15B3E34CB02A9E2FFC9CA9D888AC704A60C1F1B60B9333F2A747687FC25F4973D646E014170197F359A2D2C56FAC9DD93BCFBE5D21BF805E7B859073242439288249FF4FDE8E79F4F744A2C6CA9BB2E455CA92C8523C287AE28686A60C5D2305090AEBF80D1D24FFD918400946F85FB8A809B5A199E0688A6170D5B6E6817E0A4B2AB1D0703C4404155DC4680E39A35C06103EDB9FD7DA4851B117690337D7133696B27607D7075DF75C19D61300ADA18E4ECF656649F48E9F3178E7F79&amp;retpath=aHR0cHM6Ly9kaXNrLnlhbmRleC5ydS9kL21Mdml0dkxfTi1CZl9BPw%2C%2C_c3d4f583947ccf822cd5482e4c5823e7&amp;t=2\/1734348720\/de75ef54bd36bb68e450d4d7eaad0e68&amp;u=5709707970653253158&amp;s=8a7854a157ecbf2c5d275af88f0dd2c2\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-host\">disk.yandex.ru<\/a><\/div>\n<\/div>\n<p>\u0414\u043b\u044f \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043d\u043e\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c MyltiPSK<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0e8\/367\/c6b\/0e8367c6b6e2241887536779b1032bc2.png\" alt=\"\u0420\u0438\u0441. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 MyltiPSK \u0441 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438\" title=\"\u0420\u0438\u0441. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 MyltiPSK \u0441 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0e8\/367\/c6b\/0e8367c6b6e2241887536779b1032bc2.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 MyltiPSK \u0441 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u0430 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e Cortex-M3 \u0432 \u041f\u041b\u0418\u0421 GW1NSR-LV4CQN48PC6\/I5 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 SPI \u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0432 \u041f\u041b\u0418\u0421. \u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432 FPGA \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0430\u0434\u0438\u043e\u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0439 \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u044b-\u0442\u0440\u0430\u043d\u0441\u0438\u0432\u0435\u0440\u0430 AD9361 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0438\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0432 ZYNQ-7000 ARM \u044f\u0434\u0440\u0430 \u0438\u043b\u0438 \u0441\u043e\u0444\u0442-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 Microblaze \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u043f\u0440\u0438\u0451\u043c, \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0438\/\u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 IQ \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0432\u0435\u0434\u0451\u0442\u0441\u044f \u0432 \u043b\u043e\u0433\u0438\u043a\u0435 FPGA. \u0410 \u043a\u0430\u043a \u0412\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432 \u041f\u041b\u0418\u0421 \u043c\u0438\u043a\u0440\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b?<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e.<\/p>\n<p>\u0421. \u041d.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/865480\/\"> https:\/\/habr.com\/ru\/articles\/865480\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u044b\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f ARM \u044f\u0434\u0440\u0430, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u041f\u041b\u0418\u0421 GOWIN GW1NSR-4C, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u043e\u0431\u0449\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <a href=\"https:\/\/ru.ruwiki.ru\/wiki\/%D0%A4%D0%B0%D0%B7%D0%BE%D0%B2%D0%B0%D1%8F_%D0%BC%D0%B0%D0%BD%D0%B8%D0%BF%D1%83%D0%BB%D1%8F%D1%86%D0%B8%D1%8F\" rel=\"noopener noreferrer nofollow\">PSK31<\/a> \u0441\u0438\u0433\u043d\u0430\u043b\u0430. \u0421\u0438\u0433\u043d\u0430\u043b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0441\u0438\u043d\u0443\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 <a href=\"https:\/\/habr.com\/p\/862842\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0430 LilyGO T-FPGA, \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u041f\u041b\u0418\u0421 GW1NSR-LV4CQN48PC6\/I5, \u0426\u0410\u041f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 DAC904, ide GOWIN FPGA Designer \u0438 <a href=\"https:\/\/www.gowinsemi.com\/en\/support\/database\/1331\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f GMD<\/a>.<\/p>\n<blockquote>\n<p><em>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440<br \/>\u0422\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0434\u0438\u043e\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0448\u0430\u043b\u0438\u0442\u044c, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u043d\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u043e-\u043f\u0440\u0430\u0432\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0430, \u043d\u0430 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0448\u0430\u043b\u043e\u0441\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0440\u0430\u0434\u0438\u043e\u043f\u043e\u0437\u044b\u0432\u043d\u043e\u0439 \u0438 \u0438\u0437\u0431\u0430\u0432\u044c\u0442\u0435\u0441\u044c \u043e\u0442 \u043f\u0430\u0440\u0430\u0437\u0438\u0442\u043d\u044b\u0445 \u0433\u0430\u0440\u043c\u043e\u043d\u0438\u043a.<\/em><\/p>\n<p><em>\u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043f\u0430\u0440\u0443 \u0434\u043d\u0435\u0439 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u043c\u0438 \u043f\u043b\u0430\u0442\u0430\u043c\u0438. \u042d\u0442\u043e \u043d\u0435 \u043e\u043f\u044b\u0442 \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043f\u043e\u0434 \u041f\u041b\u0418\u0421 \u0438 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u044d\u0442\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044b\u0445 \u0442\u0435\u043c\u0430\u0445 \u0438 \u0434\u0430\u0434\u0443\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043a\u0440\u0438\u0442\u0438\u043a\u0443.<\/em><\/p>\n<\/blockquote>\n<p>\u041f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443 ARM \u044f\u0434\u0440\u0430 \u0432 \u041f\u041b\u0418\u0421 GOWIN \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 <a href=\"https:\/\/www.gowinsemi.com\/en\/support\/arm\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 GOWIN<\/a> \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043d\u0430 <a href=\"https:\/\/github.com\/verilog-indeed\/gowin_fpga_tutorials\/tree\/main\/gowin_empu\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 GITHUB<\/a>. \u0412 \u0444\u0430\u0439\u043b\u0435 README \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 ARM \u044f\u0434\u0440\u0430 \u0432 \u041f\u041b\u0418\u0421 GW1NSR-LV4CQN48PC6\/I5 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0441\u0438\u043d\u0443\u0441\u0430 \u0432 \u041f\u041b\u0418\u0421 \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f\u0446\u0438\u0438 psk \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0435 ARM \u044f\u0434\u0440\u043e Cortex-m3. \u0427\u0442\u043e\u0431\u044b \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0438 \u043b\u043e\u0433\u0438\u043a\u0443 \u041f\u041b\u0418\u0421 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c SPI \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u041f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432 \u0434\u0438\u0437\u0430\u0439\u043d IP MCU \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c SPI \u0448\u0438\u043d\u0443:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0438\u0441. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 SPI \u0432 IP generator<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/Xinyuan-LilyGO\/T-FPGA\/tree\/main\/example\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440 <\/a>\u043e\u0442 LiLyGO, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0438\u0433\u0430\u043d\u0438\u0435\u043c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u043e\u0433\u043e \u043a FPGA, \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0412 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 ESP32-S3, \u0440\u0430\u0437\u043c\u0435\u0449\u0451\u043d\u043d\u044b\u0439 \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0435. \u0414\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 \u041f\u041b\u0418\u0421 Cortex-M3.<\/p>\n<blockquote>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u043e\u043c \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 Cortex-M3 \u0432 \u041f\u041b\u0418\u0421 \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043c\u0438\u0433\u0430\u043d\u0438\u0435 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b <code>led<\/code> \u0431\u044b\u043b \u0432\u043a\u043b\u044e\u0447\u0451\u043d \u043f\u0440\u044f\u043c\u043e \u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Gowin_EMPU_Top <code>.gpio(led)<\/code> (<em>\u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <\/em><code>output reg led<\/code><em> \u043a\u0430\u043a \u0432 <\/em><a href=\"https:\/\/github.com\/Xinyuan-LilyGO\/T-FPGA\/blob\/main\/example\/FPGA\/led\/src\/led.v\" rel=\"noopener noreferrer nofollow\"><em>\u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/em><\/a><em>, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e <\/em><code>output led<\/code><em> . \u0418\u043d\u0430\u0447\u0435 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442 \u0441\u0438\u043d\u0442\u0435\u0437, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Cortex-M3 \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 GPIO. &#8212; \u043f\u0440\u0438\u043c. \u0410\u0432\u0442.<\/em>) .<\/p>\n<\/blockquote>\n<h2>\u041f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442. Cortex-M3 SPI blink<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 MCU \u0432 \u0444\u0430\u0439\u043b \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u044b MCU \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043f\u043e\u0440\u0442\u0430\u043c \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f.<\/p>\n<pre><code class=\"cpp\">wirecs; wiresck; wireMOSI; wireMISO; wire           [7:0]gpio;  \/\/--------Copy here to design--------  Gowin_EMPU_Top cortexM3_inst(     .sys_clk(clk_60M),   \/\/input sys_clk     .gpio(gpio[7:0]),    \/\/inout [15:0] gpio     .uart0_rxd(1'b1),    \/\/input uart0_rxd     .uart0_txd(UART_TX), \/\/output uart0_txd     .mosi(MOSI),         \/\/output mosi     .miso(MISO),         \/\/input miso     .sclk(sck),          \/\/output sclk     .nss(cs),            \/\/output nss     .reset_n(1'b1)       \/\/input reset_n );<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0442\u0430\u043a\u0442\u043e\u0432\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b &#8212; \u044d\u0442\u043e \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 PLL. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u044d\u0442\u0438\u043c\u0438 IP \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0438 \u0432 <a href=\"https:\/\/github.com\/verilog-indeed\/gowin_fpga_tutorials\/tree\/main\/gowin_empu\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043f\u0440\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Cortex-M3 \u0432 \u041f\u041b\u0418\u0421<\/a>, \u0438 \u0432 \u0431\u043b\u043e\u0433\u0435 <a href=\"https:\/\/marsohod.org\/projects\/marsohod3gw-prj\/432-gowin-rpll\" rel=\"noopener noreferrer nofollow\">Marsohod.org<\/a>. GPIO \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u043a\u0430\u043a wire, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043e\u043d\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f. \u0421\u0438\u0433\u043d\u0430\u043b\u044b SPI \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u043a\u0430\u043a wire. \u041c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432\u043d\u0443\u0442\u0440\u044c \u041f\u041b\u0418\u0421, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u043b\u043e\u0433\u0438\u043a\u0438 \u041f\u041b\u0418\u0421 \u043d\u0430\u0440\u0443\u0436\u0443 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e.\u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043a\u0430\u043a \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f constraints \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0438\u043d\u0442\u0435\u0437\u0430, \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 bitstream \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u041a\u0430\u043a \u0438 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 Gowin&#8217;s MCU Designer.<\/p>\n<p>\u041f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c \u043f\u043e\u043b\u043d\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f SPI blink \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u041f\u041b\u0418\u0421. <\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">module led(     input clk,     inputrst,     output reg          led,      output UART_TX,          outputrxd_flag );  wirecs; wiresck; wireMOSI; wireMISO;  wire[7:0]rxd_out;  \/\/-------------------------------------------- reg [7:0] txd_dat; wire clk_60M; \/\/--------------------------------------------  wire pll_out_clk;  \/\/-------------------------------------------  wire [7:0]gpio;  \/\/--------Copy here to design--------  Gowin_EMPU_Top cortexM3_inst(     .sys_clk(clk_60M), \/\/input sys_clk     .gpio(gpio[7:0]), \/\/inout [15:0] gpio     .uart0_rxd(1'b1), \/\/input uart0_rxd     .uart0_txd(UART_TX), \/\/output uart0_txd     .mosi(MOSI), \/\/output mosi     .miso(MISO), \/\/input miso     .sclk(sck), \/\/output sclk     .nss(cs), \/\/output nss     .reset_n(1'b1) \/\/input reset_n );  \/\/--------Copy end-------------------  always@(posedge rxd_flag or negedge rst)begin     if(!rst)         txd_dat &lt;= 8'b11000011; else     begin         txd_dat &lt;= rxd_out + 1'b1; \/\/\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 +1 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044e     end end  always@(posedge rxd_flag or negedge rst)begin     if(!rst)         led&lt;=1'b0;     else if(rxd_out&lt;8'h80)         begin             led&lt;=1'b1;         end     else         begin             led&lt;=1'b0;         end end  \/\/--------Copy here to design--------  Gowin_PLLVR1 your_instance_name(     .clkout(clk_60M), \/\/output clkout     .clkin(clk) \/\/input clkin );  \/\/--------Copy end-------------------  spi_slaver spi_slaver1(     .clk(clk_60M), \/\/ clk_30M     .rst(rst),     .cs(cs),     .sck(sck),     .MOSI(MOSI),     .MISO(MISO),     .rxd_out(rxd_out),     .txd_data(txd_dat),     .rxd_flag(rxd_flag) );  endmodule<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u0434 \u044d\u0442\u0438\u043c \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c \u0444\u0430\u0439\u043b .cst, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f SPI blink.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">\/\/Copyright (C)2014-2021 Gowin Semiconductor Corporation. \/\/All rights reserved.  \/\/File Title: Physical Constraints file \/\/GOWIN Version: 1.9.8.01 \/\/Part Number: GW1NSR-LV4CQN48PC6\/I5 \/\/Device: GW1NSR-4C \/\/Created Time: Tue 02 21 14:47:43 2023  IO_LOC \"led\" 15; IO_PORT \"led\" IO_TYPE=LVCMOS33 PULL_MODE=UP DRIVE=8; IO_LOC \"clk\" 45; IO_PORT \"clk\" IO_TYPE=LVCMOS33 PULL_MODE=UP;  IO_LOC \"rst\" 46; IO_PORT \"rst\" IO_TYPE=LVCMOS33 PULL_MODE=UP;  IO_LOC \"UART_TX\" 22; IO_PORT \"UART_TX\" IO_TYPE=LVCMOS33 PULL_MODE=NONE DRIVE=8 OPEN_DRAIN=ON;  \/\/------------------------------------------------------------- IO_LOC \"rxd_flag\" 42; IO_PORT \"rxd_flag\" IO_TYPE=LVCMOS33 PULL_MODE=NONE DRIVE=8;<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u041f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421 \u0432 IDE GMD<\/h2>\n<blockquote>\n<p>\u0412 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f Gowin&#8217;s MCU Designer. \u041d\u043e \u0443 \u0430\u0432\u0442\u043e\u0440\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043f\u043e \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435. \u041d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/www.gowinsemi.com\/en\/support\/database\/569\/?support_search=GOWIN+MCU+Designer\" rel=\"noopener noreferrer nofollow\">GOWIN <\/a>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u041f\u041e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<\/blockquote>\n<p>\u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u043c \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0435 SDK \u043e\u0442 Gowin \u0434\u043b\u044f GW1NS(R)-4C \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SPI. \u041e\u0442\u043b\u0438\u0447\u0438\u0435\u043c \u043e\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0430\u044f \u0442\u0430\u043a\u0442\u043e\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c 60 \u041c\u0413\u0446. \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0431\u044b\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0435 PLL (<code>.clkout(clk_60M), \/\/output clkout<\/code> . &#8212; \u043f\u0440\u0438\u043c. \u0410\u0432\u0442.) \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 MCU \u0447\u0435\u0440\u0435\u0437 <code>wire clk_60M;<\/code> . \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 <code>lib\/CMSIS\/DeviceSupport\/system\/system_gw1ns4c.c<\/code>.<\/p>\n<pre><code class=\"cpp\">#define __SYSTEM_CLOCK    (60000000UL)   \/* 60MHz *\/ <\/code><\/pre>\n<blockquote>\n<p>\u0412 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u044f\u0434\u0440\u043e \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043e\u0442 80 \u041c\u0413\u0446, \u043d\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u043f\u043e\u0440\u043d\u043e\u0433\u043e \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0433\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 T-FPGA \u0432\u044b\u0431\u0440\u0430\u043d \u043a\u0432\u0430\u0440\u0446 \u0441 \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439 27 \u041c\u0413\u0446. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SPI \u0435\u0441\u0442\u044c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438 \u043d\u0430 8, 6, 4, 3 \u0438 2, \u043d\u043e IP generator PLL \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438 \u0434\u043b\u044f 80 \u041c\u0413\u0446. \u0417\u0430\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u043b\u044f 60 \u041c\u0413\u0446 \u0438\u0437 27 \u041c\u0413\u0446 \u0438 \u0442\u043e\u0433\u0434\u0430 \u0434\u043b\u044f SPI \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c 6.<\/p>\n<\/blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0435\u0441\u043b\u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c \u0432 main.c, \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d \u043a \u043b\u043e\u0433\u0438\u043a\u0435 \u041f\u041b\u0418\u0421, \u043d\u0430\u0447\u043d\u0451\u0442 \u043c\u0438\u0433\u0430\u0442\u044c \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Cortex-M3. \u041a\u0430\u043a \u0438 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c <a href=\"https:\/\/github.com\/Xinyuan-LilyGO\/T-FPGA\/blob\/main\/example\/ESP32-S3\/spi_blink\/spi_blink.ino\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u0435 <\/a>\u0447\u0435\u0440\u0435\u0437 SPI \u043f\u043e\u043e\u0447\u0435\u0440\u0451\u0434\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0x01 \u0438\u043b\u0438 0x81 \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043b\u043e\u0433\u0438\u043a\u0430 FPGA \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">\/*  * *****************************************************************************************  *  * Copyright (C) 2014-2021 Gowin Semiconductor Technology Co.,Ltd.  *  * @filemain.c  * @authorEmbedded Development Team  * @versionV1.x.x  * @date2021-01-01 09:00:00  * @briefMain program body.  ******************************************************************************************  *\/  \/* Includes ------------------------------------------------------------------*\/ #include \"gw1ns4c.h\" #include &lt;stdio.h&gt;  \/* Includes ------------------------------------------------------------------*\/ void SPIInit(void); void initializeUART(); void initializeTimer(); void delayMillis(uint32_t ms);  \/* Functions ------------------------------------------------------------------*\/ int main(void) {   SystemInit();\/\/Initializes system   SPIInit();\/\/Initializes SPI   initializeUART();   initializeTimer();    SPI_Select_Slave(0x01) ;\/\/Select The SPI Slave   SPI_WriteData(0x01);\/\/Send Jedec    printf(\"init complete\\r\\n\");    uint32_t counter = 0;    while(1)   {        counter++;   printf(\"GowinFPGA says hi! Count: %d\\r\\n\", counter);    if(~SPI_GetToeStatus() &amp;&amp; SPI_GetTrdyStatus() == 1)   {       SPI_WriteData(0x81);   }    delayMillis(500);    if(~SPI_GetToeStatus() &amp;&amp; SPI_GetTrdyStatus() == 1)   {   SPI_WriteData(0x01);   }   delayMillis(500);   } }  \/\/Initializes SPI void SPIInit(void) { SPI_InitTypeDef init_spi;    init_spi.CLKSEL= CLKSEL_CLK_DIV_6;\/\/60MHZ \/ 6   init_spi.DIRECTION = DISABLE;\/\/MSB First   init_spi.PHASE =DISABLE;\/\/ENABLE;\/\/posedge   init_spi.POLARITY =DISABLE;\/\/polarity 0    SPI_Init(&amp;init_spi); }  \/\/Initializes UART0   void initializeUART()   {   UART_InitTypeDef uartInitStruct;   \/\/Enable transmission   uartInitStruct.UART_Mode.UARTMode_Tx = ENABLE;   \/\/Disable reception   uartInitStruct.UART_Mode.UARTMode_Rx = DISABLE;   \/\/9600 baud rate typical of Arduinos   uartInitStruct.UART_BaudRate = 9600;   \/\/Initialize UART0 using the struct configs   UART_Init(UART0, &amp;uartInitStruct);   }    void initializeTimer() {     TIMER_InitTypeDef timerInitStruct;      timerInitStruct.Reload = 0;      \/\/Disable interrupt requests from timer for now     timerInitStruct.TIMER_Int = DISABLE;      \/\/Disable timer enabling\/clocking from external pins (GPIO)     timerInitStruct.TIMER_Exti =<\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-443312","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/443312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=443312"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/443312\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=443312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=443312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=443312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}