{"id":301034,"date":"2020-03-31T15:00:31","date_gmt":"2020-03-31T15:00:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=301034"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=301034","title":{"rendered":"\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0441 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438 \u0432 Jupyter Notebook"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/486598\/\">\n<p>Jupyter Notebook \u2014 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442-\u0441\u0440\u0435\u0434\u0430 \u0434\u043b\u044f data scientist&#8217;\u043e\u0432, \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u043e\u0432, \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432, \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0432, \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432 \u0438 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u043d\u0430\u0441 \u2014 \u0441\u0430\u043c\u044b\u0445 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0443\u0447\u0435\u043d\u044b\u0445 \u0432 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0438\u0437\u0438\u043a\u0435. <\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c\u0438 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0447\u0438\u0442\u0430\u043b\u0438 \u043d\u0430 \u043d\u0435\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Python \u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 (numpy, SciPy, matplot \u0438 \u0442.\u0434.). \u041d\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0440\u0435\u0434\u0430 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u0430 \u0438 \u0438\u043c\u0435\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b. \u041e\u0447\u0435\u043d\u044c \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e, \u043d\u043e Jupyter \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445, \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0447\u0435\u043c-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 REPL \u0441\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u041c\u041a \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0437 \u0441\u043b\u0430\u0431\u0435\u043d\u044c\u043a\u043e\u0433\u043e MicroPython \u0438 \u0432\u043d\u0443\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u0444\u0435\u0440\u0438\u0438 \u0447\u0438\u043f\u0430, \u043f\u0440\u0438\u0447\u0435\u043c \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wm\/gh\/7f\/wmgh7f8oyyssxa6qtfnkmqflv6k.gif\"><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0438\u043d\u0442\u0440\u043e.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0442\u043e \u0440\u0430\u0437 \u0438\u0437 \u0431\u0440\u0430\u0442\u0441\u043a\u043e\u0433\u043e \u041d\u0418\u0418 \u043a \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u0435\u043b \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u0431\u043e\u0440, \u0445\u043e\u0442\u044f \u043f\u0440\u0438\u0431\u043e\u0440 \u2014 \u044d\u0442\u043e \u0433\u0440\u043e\u043c\u043a\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0435\u043d\u0441\u043e\u0440, \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044f \u0444\u0440\u043e\u043d\u0442\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0430. \u0427\u0442\u043e-\u0442\u043e \u0442\u0438\u043f\u0430 \u0442\u0430\u043a\u043e\u0433\u043e: <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hs\/wn\/mn\/hswnmnm4x9_hy5tjusep_vbr4sg.jpeg\"><\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0444\u043e\u0440\u043c\u0443 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430, \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0443\u0432\u044b, \u043d\u0435 \u043c\u043e\u0433\u0443.<\/p>\n<p>  <\/p>\n<p>\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u043f\u043e \u043e\u0441\u0446\u0438\u043b\u043e\u0433\u0440\u0430\u0444\u0443 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u0430\u0440\u0443 \u0440\u0430\u0437, \u0434\u0430\u043b\u044c\u0448\u0435 \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0435\u0442\u0443 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f. <\/p>\n<p>  <\/p>\n<p>\u041e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u0438\u0434\u0435\u0442\u044c \u0438 \u043f\u043e\u0440\u0442\u0438\u0442\u044c \u0433\u043b\u0430\u0437\u0430 \u043e\u0431 \u044d\u043a\u0440\u0430\u043d \u043e\u0441\u0446\u0438\u043b\u043e\u0433\u0440\u0430\u0444\u0430 \u0438 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u044b. \u0410 \u0434\u0435\u043b\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c USB \u0438\u043b\u0438 Ethernet \u043e\u0441\u0446\u0438\u043b\u043e\u0433\u0440\u0430\u0444, \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u043a\u0438\u043b\u043e\u0433\u0435\u0440\u0446, \u043e\u0434\u043d\u0430\u043a\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u043e\u0438\u0442 \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u043a\u0438\u043b\u043e\u0433\u0440\u0438\u0432\u0435\u043d. \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0438 \u0442\u0430\u043c \u0443\u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432 Python.<\/p>\n<p>  <\/p>\n<p>\u0418\u0437 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b\u043b\u043e: \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u0435\u0447\u043d\u043e \u0432\u044b\u0440\u0443\u0447\u0430\u044e\u0449\u0430\u044f \u0430\u0440\u0434\u0443\u0438\u043d\u043a\u0430 \u043d\u0435 \u0432\u044b\u0442\u044f\u0433\u0438\u0432\u0430\u043b\u0430 \u0442\u0430\u043a\u043e\u0439 sample rate \u0434\u043b\u044f \u043e\u0446\u0438\u0444\u0440\u043e\u0432\u043a\u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e <a href=\"https:\/\/www.arduino.cc\/reference\/en\/language\/functions\/analog-io\/analogread\/\" rel=\"nofollow\">10,000 times a second<\/a> \u0430 \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0442\u043e \u0442\u043e \u043e\u043a\u043e\u043b\u043e 8,000 times a second. \u041d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0435\u0440\u0445\u043d\u044e\u044e \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0445\u043e\u0442\u044f \u0431\u044b 40,000 -50,000 times a second.<\/p>\n<p>  <\/p>\n<p>\u0411\u044b\u043b\u0430 \u0434\u0430\u0436\u0435 \u043e\u0442\u0447\u0430\u0439\u043d\u0430\u044f \u043c\u044b\u0441\u043b\u044c, \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0441 \u043e\u0441\u0446\u0438\u043b\u043e\u0433\u0440\u0430\u0444\u0430 \u043d\u0430 \u043a\u0430\u043c\u0435\u0440\u0443. \u041d\u043e \u0441\u0438\u0433\u043d\u0430\u043b \u0441 \u0441\u0435\u043d\u0441\u043e\u0440\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0447\u0430\u0441\u0442\u043e\u0442\u0435(\u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a) \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u0438\u0434\u0435\u0442\u044c \u0440\u044f\u0434\u043e\u043c \u0441 \u043e\u0441\u0446\u0438\u043b\u043e\u0433\u0440\u0430\u0444\u043e\u043c \u0438 \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u043a\u0443 \u043d\u0430 \u043d\u0435\u043c, \u0447\u0442\u043e \u0431\u044b \u0441\u0438\u0433\u043d\u0430\u043b \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u043b\u0441\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. \u0423\u0436\u0435 \u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u043e\u0442 \u043e\u0441\u0446\u0438\u043b\u043e\u0433\u0440\u0430\u0444\u0430 \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u043e\u0442\u043e\u0439\u0434\u0435\u0448\u044c, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0441, \u0441\u0430\u043c\u044bx \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0444\u0438\u0437\u0438\u043a\u043e\u0432, computer vision \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 rocket science. \u0423\u0432\u044b.<\/p>\n<p>  <\/p>\n<p>\u041e\u043f\u0440\u043e\u0441 \u043f\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u0431\u044e\u0434\u0436\u0435\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043c\u043e\u0449\u043d\u0443\u044e \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0443 \u0447\u0435\u043c \u0430\u0440\u0434\u0443\u0438\u043d\u043e \u0438 \u043d\u0430 \u0435\u0451 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u0438 \u043c\u043d\u0435 \u0434\u0430\u0436\u0435 \u0432\u0440\u0443\u0447\u0438\u043b\u0438 \u043d\u0430\u0431\u043e\u0440 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0431\u044b\u043b\u043e \u043c\u043d\u043e\u0433\u043e, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432, \u0441\u043e \u0441\u0440\u0435\u0434\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438 \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0444\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u0422\u0440\u0443\u0434\u043e\u0437\u0430\u0442\u0440\u0430\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e.<\/p>\n<p>  <\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043e\u0432\u0435\u0442, \u0434\u0430\u043b \u043c\u043e\u0439 \u044d\u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0432\u0448\u0438\u0439 \u043e\u0434\u043d\u043e\u043a\u0443\u0440\u0441\u043d\u0438\u043a \u0411\u043e\u0440\u044f. \u0412 \u0435\u0433\u043e \u0435\u0432\u0440\u043e\u043f\u0435\u0439\u0441\u043a\u043e\u043c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0435 \u0435\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u0438\u043a\u0440\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u043e\u0439. \u0422\u0430\u043c \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u044b \u0438\u0437\u0443\u0447\u0430\u044e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Jupyter Notebook. \u0417\u0434\u0435\u0441\u044c Jupyter \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 REPL \u0441\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430 \u041c\u041a, \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f MicroPython. \u0422\u043e\u043b\u044c\u043a\u043e MicroPython \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0438\u0448\u0435\u0442 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b COM-\u043f\u043e\u0440\u0442\u0430.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/r9\/ou\/th\/r9outhnjvympj67gsdvhg6rzgsa.png\"><\/p>\n<p>  <\/p>\n<p><em><a href=\"https:\/\/www.youtube.com\/watch?v=5LbgyDmRu9s\" rel=\"nofollow\">https:\/\/www.youtube.com\/watch?v=5LbgyDmRu9s<\/a><\/em> <\/p>\n<p>  <\/p>\n<p>\u0410 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Jupyter \u043f\u043e\u0434\u0445\u043e\u0434 \u0434\u0440\u0443\u0433\u043e\u0439. Jupyter Notebook \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435, \u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u041c\u041a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 STM32 \u0438 STM8, \u0442\u0430\u043a\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u044d\u0442\u0438\u0445 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u2014 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f STMicroelectronics. \u041d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/www.st.com\/content\/st_com\/en\/products\/embedded-software\/mcu-mpu-embedded-software\/stm8-embedded-software\/stsw-stm8016.html\" rel=\"nofollow\">Standard Peripheral Library<\/a><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435: \u0432 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0447\u0438\u043f\u0430 STM8 \u0435\u0441\u0442\u044c \u0444-\u0446\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0410\u0426\u041f.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">uint16_t ADC_GetConversionValue(ADC_TypeDef* ADCx);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u043d\u0430 \u0432\u043e\u0437\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0446\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430. \u0415\u0451 \u043c\u043e\u0436\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0432 Jupyter: <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2o\/fe\/dd\/2ofeddtweeppuod2azqjb01gwqw.png\"> <\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c <strong>ADC_GetConversionValue<\/strong> \u0438\u043c\u0435\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 <em>\u0421\/\u0421++<\/em> \u0444-\u0446\u0438\u044f, \u043a\u0430\u043a \u0436\u0435 \u044f \u0435\u0451 \u0432\u044b\u0437\u0432\u0430\u043b\u0430 \u0438\u0437 Jupyter?! \u0415\u0441\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d <a href=\"https:\/\/anaconda.org\/conda-forge\/xeus-cling\" rel=\"nofollow\">xeus-cling<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a Jupyter \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u0421++. \u041e\u0433\u043e\u0440\u0447\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e, \u043d\u0430 Windows \u044d\u0442\u043e\u0442 \u043f\u043b\u0430\u0433\u0438\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0422\u0430\u043a \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c, \u043c\u043d\u0435 \u0434\u0430\u0432\u043d\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 Microsoft, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0438\u0440\u0443\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u043e\u0439 c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 Ubuntu. \u041c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f MacOS, \u043d\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u044b MacBook \u0443 \u043d\u0430\u0441 \u0432\u0437\u044f\u043b\u0441\u044f \u0432 \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u0438\u0438&#8230;<\/p>\n<p>  <\/p>\n<p><strong>xeus-cling<\/strong> \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0421\/\u0421++ \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440, \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0435\u0439 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444-\u0446\u0438\u0438 \u0438\u0437 \u0441\u0440\u0435\u0434\u044b Jupyter NoteBook \u0432 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/remotemcu.com\" rel=\"nofollow\">REMCU<\/a>. \u042d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 API, \u043a\u0430\u043a \u0443 <strong>Standard Peripheral Library<\/strong> \u0442.\u0435. \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435(header) \u0444\u0430\u0439\u043b\u044b \u0438\u0437 <strong>Standard Peripheral Library<\/strong>, \u0430 \u0432\u0435\u0440\u043d\u0435\u0435 \u0434\u043b\u044f STM8LDiscovery \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0435\u0439: <\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &quot;stm8l15x.h&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0435\u0439, \u043a\u0430\u043a \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u0430\u043c\u0430 \u0432\u0441\u0435 \u043e\u0442\u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442 \u0432 \u041c\u041a \u0431\u0435\u0437 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u0435\u0440\u0442\u043e\u043a.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438 \u0434\u0435\u043b\u0430, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432 Jupyter \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0435\u0439 \u0438\u0437 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u0440\u0430. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043a \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043b\u044c\u0437\u044f, \u0432\u0440\u043e\u0434\u0435 \u0442\u0430\u043a\u043e\u0433\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/* Init GPIO Port C PC7 output push-pull up to 10MHz blue LED4*\/     GPIOC-&gt;DDR |= 0x80;          GPIOC-&gt;CR1 |= 0x80;      GPIOC-&gt;CR2 |= 0x80;<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/github.com\/tanbras\/MCU_Experiments\/blob\/master\/Standard_Peripheral_Library_STM8L_V1.4.0\/Project\/WavesGenerator\/src\/main.c\" rel=\"nofollow\">WavesGenerator<\/a><\/em><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a Jupyter \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0438 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0443\u043f\u0430\u0434\u0435\u0442 \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. \u041d\u043e \u0438 \u0447\u0435\u0440\u0435\u0437 <strong>Standard Peripheral Library<\/strong> \u0432\u0441\u0435 \u0430\u043f\u043f\u0430\u0440\u0442\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0443\u0436\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 (\u0438\u043b\u0438 \u0432\u0438\u0440\u0443\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430) \u0441 Ubuntu \u0438\u043b\u0438 MacOS \u043d\u0430 \u043d\u0435\u0439 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 Anaconda, Jupyter Notebook \u0438 \u043a \u043d\u0435\u043c\u0443 \u043f\u043b\u0430\u0433\u0438\u043d\u044b <a href=\"https:\/\/anaconda.org\/conda-forge\/xeus-cling\" rel=\"nofollow\">xeus-cling<\/a> \u0438 <a href=\"https:\/\/anaconda.org\/conda-forge\/xplot\" rel=\"nofollow\">xplots<\/a>(\u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432)<\/li>\n<li>\u042d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0430 STM8LDiscovery \u2014 \u043f\u043e \u0441\u043e\u0432\u0435\u0442\u0443 \u043a\u043e\u043b\u043b\u0435\u0433\u0438, \u043a\u0430\u043a \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u0440\u0435\u0434\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0442\u043e\u0433\u0434\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043b\u0430\u0442\u044b, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 c STM32.<\/li>\n<li>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 REMCU \u0434\u043b\u044f STM8LDiscovery, \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0433\u043e\u0434\u0443 \u0441\u043e \u043c\u043d\u043e\u0439 \u043f\u043e\u0434\u0435\u043b\u0438\u043b\u0441\u044f \u0411\u043e\u0440\u0438\u0441. \u041d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0441 <a href=\"https:\/\/remotemcu.com\/download\" rel=\"nofollow\">\u0441\u0430\u0439\u0442\u0430<\/a>.<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0430\u043a \u0441\u043a\u0430\u0447\u0430\u0442\u044c<\/b><\/p>\n<div class=\"spoiler_text\">\n<p>\u0414\u043b\u044f \u043f\u043b\u0430\u0442\u044b STM8LDiscovery \u0432\u044b\u0431\u0440\u0430\u0442\u044c <strong>STM8L152C6<\/strong> \u0432 \u043f\u043e\u043b\u0435 <strong><em>MCU name:<\/em><\/strong>, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 StdPeriph_Driver \u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430 \u0432\u0435\u0440\u0441\u0438\u044e 1.4.0<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jz\/h-\/oi\/jzh-oic_uboedjckpod8iac4lws.png\"><br \/>  \u0418 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0432 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qz\/4r\/6f\/qz4r6f68q3omvuvvyfflapzjdoo.png\"><\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<ul>\n<li>OpenOCD \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 REMCU. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0438\u0437 \u044d\u0442\u043e\u0433\u043e <a href=\"https:\/\/github.com\/ilg-archived\/openocd\/tree\/v0.10.0-12-20190422\" rel=\"nofollow\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a>, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a OpenOCD, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u0432 Ubuntu \u0447\u0435\u0440\u0435\u0437 <em>apt install<\/em> \u043d\u0435 \u0438\u043c\u0435\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043f\u043b\u0430\u0442\u044b STM8LDiscovery. <\/li>\n<li>ST-Link stick \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0442\u043e\u0440 \u0434\u043b\u044f STM8LDiscovery, \u0441\u0442\u043e\u0438\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u0441\u0442\u043e \u0433\u0440\u0438\u0432\u0435\u043d. \u0425\u043e\u0442\u044f \u0432\u0440\u043e\u0434\u0435 \u0431\u044b STM8LDiscovery \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0430, \u043d\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0442\u043e\u0440 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 OpenOCD.<br \/>  <em>UPD. \u0412 <a href=\"https:\/\/habr.com\/ru\/post\/486598\/#comment_21446088\">\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445<\/a> \u043a \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u0430\u043b\u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e ST-Link<\/em><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0442\u043e\u0440 ST-Link \u043a STM8LDiscovery \u0438 \u0434\u0430\u043b\u0435\u0435 \u043a \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0443.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u0445\u0435\u043c\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wb\/53\/y4\/wb53y4gxraoli1qpgpuoejfgtcs.png\"><\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u043c\u0435\u043c OpenOCD \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">.\/openocd -f interface\/stlink-v2.cfg -f target\/stm8l.cfg<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/e92\/c07\/b8a\/e92c07b8a29cb082b8fb21513cba7869.png\" alt=\"run openocd\"><\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c Jupyter \u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0441 STM8LDiscovery. \u041e\u0434\u043d\u0430\u043a\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <strong>Standard Peripheral Library<\/strong> \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043d\u0435 \u0442\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043a\u0430\u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Arduino. \u041e\u043d\u0430 \u0438\u043c\u0435\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043d\u043e \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0435\u0439 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c, \u043f\u0440\u0438 \u0442\u043e\u043c \u0447\u0442\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u0441\u043a\u0443\u0434\u043d\u0430\u044f. \u0421\u043f\u0430\u0441\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e <a href=\"https:\/\/github.com\/tanbras\/MCU_Experiments\/tree\/master\/Standard_Peripheral_Library_STM8L_V1.4.0\/Project\" rel=\"nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0434\u0443\u0442 \u0441 \u043d\u0435\u0439. <\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0432\u044b\u0431\u0440\u0430\u043b\u0430 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/github.com\/tanbras\/MCU_Experiments\/tree\/master\/Standard_Peripheral_Library_STM8L_V1.4.0\/Project\/GPIO\/GPIO_Toggle\" rel=\"nofollow\">GPIO_Toggle<\/a> \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043c\u043e\u0440\u0433\u0430\u0442\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430\u043c\u0438 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435. \u0428\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b c REMCU \u043c\u043d\u0435 \u0442\u043e\u0433\u0434\u0430 \u0434\u0430\u043b\u0438, \u0441\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e\u0442 <a href=\"https:\/\/github.com\/remotemcu\/remcu_examples\/tree\/master\/stm32f4_discovery\/jupyter-notebook\" rel=\"nofollow\">\u0448\u0430\u0431\u043b\u043e\u043d<\/a> \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/github.com\/remotemcu\/remcu_examples\" rel=\"nofollow\">GitHub \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a> \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 REMCU. \u0423 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0442 <a href=\"https:\/\/github.com\/tanbras\/MCU_Experiments\/blob\/master\/stm8l_discovery_GPIO_Toggle.ipynb\" rel=\"nofollow\">notebook<\/a>:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 :<\/b><\/p>\n<div class=\"spoiler_text\">\n<h1 id=\"stm8l-discovery-gpio-example\">STM8L-Discovery GPIO example<\/h1>\n<p>  <\/p>\n<p>Load <a href=\"https:\/\/remotemcu.com\" rel=\"nofollow\">REMCU<\/a> shared libray<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">.L libremcu.so<\/code><\/pre>\n<p>  <\/p>\n<p>Add path with header files<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">.I remcu_include<\/code><\/pre>\n<p>  <\/p>\n<p>Including necessary header files. The <a href=\"http:\/\/remcu_include\/remcu.h\" rel=\"nofollow\">\u201cremcu.h\u201d<\/a> header must be always included before any MCU header files.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">#include &quot;remcu.h&quot; #include &quot;stm8l15x.h&quot;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">remcu_connect2OpenOCD(debug_server_ip, default_openocd_port, timeout_sec)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">remcu_resetRemoteUnit(__HALT)<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"setting-up-microcontroller-peripherals\">Setting up microcontroller peripherals:<\/h2>\n<p>  <\/p>\n<pre><code class=\"plaintext\">GPIO_Init(GPIOE, GPIO_Pin_7, GPIO_Mode_Out_PP_High_Fast)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">GPIO_Init(GPIOC, GPIO_Pin_7, GPIO_Mode_Out_PP_High_Fast)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">GPIO_ResetBits(GPIOE, GPIO_Pin_7); GPIO_ResetBits(GPIOC, GPIO_Pin_7);<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c notebook \u0432 Jupyter. <\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0435 6 \u044f\u0447\u0435\u0435\u043a c \u043a\u043e\u0434\u043e\u043c \u0438\u043d\u0438\u0446\u0438\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 REMCU. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u0434 \u0438\u0437 <strong>Standard Peripheral Library<\/strong> \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0427\u0442\u043e \u043c\u043e\u0440\u0433\u0443\u043d\u0442\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430\u043c\u0438 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 STM8L-Discovery, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0435 \u0444-\u0446\u0438\u0438: <\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void GPIO_Init(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin, GPIO_Mode_TypeDef GPIO_Mode); void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437 <a href=\"https:\/\/github.com\/tanbras\/MCU_Experiments\/tree\/master\/Standard_Peripheral_Library_STM8L_V1.4.0\/Project\/GPIO\/GPIO_Toggle\" rel=\"nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/a> \u0447\u0442\u043e \u0448\u043b\u0438 \u0432 SDK, \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b\u0438. \u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0434\u0435\u043b\u0430\u043d \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043b\u0430\u0442\u044b <em>STM8L15X_EVAL<\/em>. \u0412 \u0438\u043d\u0442\u0435\u0440\u0435\u043d\u0435\u0442\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">GPIO_Init(GPIOE, GPIO_Pin_7, GPIO_Mode_Out_PP_High_Fast); GPIO_Init(GPIOC, GPIO_Pin_7, GPIO_Mode_Out_PP_High_Fast);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u0434\u043e \u0440\u0430\u0441\u043f\u043e\u043a\u0430\u0432\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0432 \u0441 REMCU \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 notebook \u0444\u0430\u0439\u043b\u043e\u043c. <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8l\/xr\/gd\/8lxrgdwrzdspbhcgpyujlczht7s.png\"> <\/p>\n<p>  <\/p>\n<p>OpenOCD \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d.<\/p>\n<p>  <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u0432 notebook, \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0444-\u0446\u0438\u0438 <em>GPIO_Init<\/em> \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b \u0437\u0430\u0436\u0433\u043b\u0438\u0441\u044c: <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ff\/hd\/yb\/ffhdybis-13vsuylzgfvlxkwdva.jpeg\"> <\/p>\n<p>  <\/p>\n<p>\u0418 \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0444-\u0446\u0438\u0438 <em>GPIO_ResetBits<\/em>, \u043e\u043d\u0438 \u0433\u0430\u0441\u043d\u0443\u0442<\/p>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u043a \u0432 Arduino. \u0421 \u0410\u0426\u041f \u0442\u043e\u0436\u0435 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ADC code<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">      \/* Enable ADC1 clock *\/       CLK_PeripheralClockConfig(CLK_Peripheral_ADC1, ENABLE);        \/* Initialize and configure ADC1 *\/       ADC_Init(ADC1, ADC_ConversionMode_Continuous, ADC_Resolution_12Bit, ADC_Prescaler_2);        \/* ADC channel used for IDD measurement *\/       ADC_SamplingTimeConfig(ADC1, ADC_Group_SlowChannels, ADC_SamplingTime_384Cycles);        \/* Enable ADC1 *\/       ADC_Cmd(ADC1, ENABLE);        \/* Start ADC1 Conversion using Software trigger*\/       ADC_SoftwareStartConv(ADC1);        \/* Get conversion value *\/       ADCData = ADC_GetConversionValue(ADC1);<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0444-\u0446\u0438\u0438 \u0432 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 STM8 \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044c \u0445\u043e\u0442\u044f \u0431\u044b 40,000 sample rate \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u0421\u043f\u0430\u0441\u0430\u0435\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0437\u0434\u0435\u0441\u044c \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0443 STM8L \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438 \u0432 \u043d\u0435\u043c \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c DMA \u2014 \u044d\u0442\u043e \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0439 \u0431\u043b\u043e\u043a \u0432 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u0443\u0444\u0444\u0435\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0410\u0426\u041f(\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0439\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432) \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0447\u0438\u043f\u0430. \u0410 Jupyter Notebook \u043c\u043e\u0436\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438 \u041c\u041a \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e. \u041c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u0430. <\/p>\n<p>  <\/p>\n<p>\u0412 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443, \u043a\u043e\u0433\u0434\u0430 \u0438\u0437 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c, \u0430 \u043f\u043e\u0442\u043e\u043c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u044e \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c. \u0414\u0430\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0426\u0410\u041f, \u0433\u0434\u0435 \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0430\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u044e, \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 DMA \u044f \u0432\u0437\u044f\u043b\u0430 \u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/github.com\/tanbras\/MCU_Experiments\/tree\/master\/Standard_Peripheral_Library_STM8L_V1.4.0\/Project\/ADC\/ADC_DMA\" rel=\"nofollow\">ADC_DMA<\/a>, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0442\u0430\u043a\u043e\u0439 <a href=\"https:\/\/github.com\/tanbras\/MCU_Experiments\/blob\/master\/stm8l_discovery-DMA.ipynb\" rel=\"nofollow\">notebook<\/a><\/p>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Xplots \u0441\u0442\u0440\u043e\u0438\u043c \u0433\u0440\u0430\u0444\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0410\u0426\u041f. \u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a \u043d\u043e\u0436\u043a\u0435 PC7 \u043f\u043b\u0430\u0442\u044b STM8LDiscovery.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 \u043f\u043e\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b(\u0441\u0438\u043d\u0443\u0441 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435):<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f90\/5af\/8aa\/f905af8aa3749ec27a674e352a2570dc.png\"><\/p>\n<p>  <\/p>\n<p>\u042f \u0434\u043e\u043b\u0433\u043e \u0431\u0438\u043b\u0430\u0441\u044c \u0441 \u0442\u0430\u043a\u0438\u043c \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c. \u0410 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0432\u043e\u0442 \u0447\u0435\u043c \u0434\u0435\u043b\u043e, \u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u044f\u0434\u0440\u0430 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u0445-\u043a\u0430 \u043a\u0430\u043a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Endianness\" rel=\"nofollow\">\u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044f \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0431\u0430\u0439\u0442<\/a>, \u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0438\u0445 \u0442\u0430\u043c \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 little-endian \u0438 big-endian. \u041f\u0440\u044f\u043c\u043e\u0439 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0431\u0430\u0439\u0442, \u043d\u0430 \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u043e\u0444\u0438\u0441\u043d\u044b\u0445 \u041f\u041a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f little-endian, \u0430 \u0432 STM8LDiscovery, big-endian! \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0438\u0437 \u0410\u0426\u041f \u043f\u043e\u043c\u0435\u043d\u044f\u043d\u044b \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0431\u0430\u0439\u0442 \u0441 \u043c\u043b\u0430\u0434\u0448\u0438\u043c. \u0415\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0431\u0430\u0439\u0442, \u0442\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u043a \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c \u0434\u043b\u044f \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;netinet\/in.h&gt;  for(int i = 0; i &lt; 0xFF; i++){     uint16_t temp = adc_data[i];     temp = htons(temp);     adc_data[i] = temp; } line.y = adc_data; \/\/plot graph fig<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/244\/4a0\/878\/2444a0878a89b841c039cb8dd1c93afa.png\"><\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0435\u0441\u0442\u044c \u0430\u0440\u0442\u0435\u0444\u0430\u0442\u043a\u044b.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f5a\/ce7\/ddd\/f5ace7ddd3713913538b0bd9cf9ca733.png\"><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u0443\u0444\u0444\u0435\u0440 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u041c\u041a \u043f\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0410\u0426\u041f \u043f\u043e \u043a\u0440\u0443\u0433\u0443. \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438 STM8LDiscovery \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0437\u0430\u043f\u0438\u0441\u044c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0442\u0430\u043a\u0438\u0435 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0435\u0441\u043b\u0438 \u0431\u044b \u0437\u0430\u043f\u0438\u0441\u044c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0441\u044f \u0431\u044b \u0432 \u043a\u043e\u043d\u0446\u0435 \u0431\u0443\u0444\u0435\u0440\u0430, \u043d\u043e \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. <\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u043a\u0440\u0443\u0433\u0443, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0445 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0435 \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u0432\u043f\u0435\u0440\u0435\u0434 \u0438\u043b\u0438 \u043d\u0430\u0437\u0430\u0434 \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0442\u043e \u0431\u044b \u043e\u043d\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u043f\u0440\u0430\u0432\u043e\u0439 \u0438\u043b\u0438 \u043b\u0435\u0432\u043e\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0430.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/cb8\/982\/b7a\/cb8982b7ac1e66add69b658ba0155568.png\"><\/p>\n<p>  <\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0433\u0440\u0430\u0444\u0438\u043a \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0431\u0435\u0437 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u043f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440 int osc_data[ADC_BUFFER_SIZE] = {0};  \/\/\u041d\u0430 \u043a\u0430\u043a\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0430\u0441\u044c \u0437\u0430\u043f\u0438\u0441\u044c DMA size_t shift =  DMA_GetCurrDataCounter(DMA1_Channel0); \/\/\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 for(int i = 0; i &lt; ADC_BUFFER_SIZE; i++){ osc_data[i] = adc_data[i];} \/\/\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0430\u0434\u043e \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b \u0447\u0442\u043e \u0431\u044b \u043e\u043d \u0441\u0442\u0430\u043b \u0440\u043e\u0432\u043d\u044b\u0439 \u043a\u0430\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u043e\u0441\u0446\u0438\u043b\u043e\u0433\u0440\u0430\u0444\u0430 shift =  ADC_BUFFER_SIZE - shift; \/\/\u0441\u0434\u0432\u0438\u0433\u0430\u0435\u043c for(size_t i = 0; i &lt; ADC_BUFFER_SIZE; i++){         int shift_pos = (i + shift) % ADC_BUFFER_SIZE;         adc_data[i] = osc_data[shift_pos];     } line.y = adc_data; \/\/plot graph fig<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/6b2\/180\/d1a\/6b2180d1ac7a2fac4812a42f53ab60fe.png\"><\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u0431\u0430\u0439\u0442 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u0410 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0410\u0426\u041f \u0432 \u0440\u0435\u0436\u0438\u043c 8\u0431\u0438\u0442. \u041a\u043e\u0433\u0434\u0430 \u043e\u0434\u0438\u043d \u0431\u0430\u0439\u0442 \u2014 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0435\u0433\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u043d\u0435\u0442!<\/p>\n<p>  <\/p>\n<p>\u041e\u0433\u043e\u0440\u0447\u0438\u043b \u043c\u0435\u043d\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044c DMA \u0443 STM8LDiscovery. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0431\u0443\u0444\u0435\u0440 \u0432\u0441\u0435\u0433\u043e \u0432 255 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0430\u0448\u0438\u043c \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u043c, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a. \u0416\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443 \u0445\u043e\u0442\u044f \u0431\u044b 10.000 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u041a\u0441\u0442\u0430\u0442\u0438, \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043a \u043f\u043b\u0430\u0442\u0435 \u0441\u043e\u0431\u0440\u0430\u0442\u0443 STM8LDiscovery \u2014 <a href=\"https:\/\/github.com\/remotemcu\/remcu_examples\/tree\/master\/stm32f4_discovery\/jupyter-notebook\" rel=\"nofollow\">STM32F4Discovery<\/a>. \u0414\u043b\u044f STM32F4 \u0447\u0438\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u0443\u0444\u0435\u0440 DMA \u0432 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c 64 \u0442\u044b\u0441\u044f\u0447\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u041d\u043e \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u0442\u0435\u043c \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c sample rate \u0434\u043b\u044f \u0410\u0426\u041f, \u0442\u0430\u043a \u0447\u0442\u043e \u0431\u044b \u043e\u0434\u0438\u043d \u043f\u0435\u0440\u0438\u043e\u0434 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043c\u0435\u0449\u0430\u043b\u0441\u044f \u0432 255 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445.<\/p>\n<p>  <\/p>\n<p>\u0427\u0430\u0441\u0442\u043e\u0442\u043e\u0439 \u0441\u044d\u043c\u043f\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0410\u0426\u041f, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0430\u043c\u0435\u0440 TIM1. \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444-\u0446\u0438\u0438 :<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void TIM1_TimeBaseInit(uint16_t TIM1_Prescaler,                        TIM1_CounterMode_TypeDef TIM1_CounterMode,                        uint16_t TIM1_Period,                        uint8_t TIM1_RepetitionCounter);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u043c\u0435\u0442\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043d\u0430\u0434\u043e \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 \u0447\u0438\u043f. \u041d\u043e \u043c\u044b \u043d\u0435 \u0444\u0438\u0437\u0438\u043a\u0438-\u0442\u0435\u043e\u0440\u0435\u0442\u0438\u043a\u0438, \u0430 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u0442\u043e\u0440\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u043b\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044f. \u0414\u043b\u044f \u043c\u0435\u043d\u044f \u0441\u0430\u043c\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u044d\u0442\u043e \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043e\u043f\u0440\u043e\u0441\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 TIM1_Period, \u043f\u0440\u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445. \u041e\u0442 TIM1_Period \u0438\u0434\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043e\u043f\u0440\u043e\u0441\u0430, \u0430 \u043e\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u0410\u0426\u041f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u043e\u0441\u0430, \u0432\u0435\u0440\u043d\u0435\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0438 \u0442\u0430\u043a\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">SamplingTime = ADC_SamplingTime_4Cycles; TIM1_Prescaler = 0x0;  TIM1_Period = 0x2; TIM1_RepetitionCounter = 0;<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e, \u043f\u043e \u043c\u043e\u0438\u043c \u043e\u0446\u0435\u043d\u043a\u0430\u043c, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 600-660 \u043a\u0413\u0446. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u043d\u0443\u0436\u0434 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0441 \u0410\u0426\u041f, \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430 \u0432 <a href=\"https:\/\/github.com\/tanbras\/MCU_Experiments\/blob\/master\/stm8l_discovery-DMA.ipynb\" rel=\"nofollow\">notebook<\/a>, \u0435\u0449\u0435 \u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0426\u0410\u041f(\u043e\u043d \u0436\u0435 DAC) \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 STM8LDiscovery. \u0426\u0410\u041f, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DMA \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u043d\u043e\u0436\u043a\u0443 PF0 \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043a\u0441\u0442\u0430\u0442\u0438, \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0445 \u0432\u044b\u0448\u0435, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u043e\u0436\u043a\u0438 PC7(\u0432\u0445\u043e\u0434 \u0410\u0426\u041f) \u0438 PF0(\u0432\u044b\u0445\u043e\u0434 \u0426\u0410\u041f) \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043c. \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u044d\u0442\u0438 \u044f\u0447\u0435\u0439\u043a\u0438 \u0432 notebook, \u0447\u0442\u043e \u0431\u044b \u0426\u0410\u041f \u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0443: <\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<h2 id=\"dac-dma-example\">DAC-DMA example<\/h2>\n<p>  <\/p>\n<pre><code class=\"plaintext\"> const uint16_t MEM_ADDRESS = ADC_BUFFER_SIZE*sizeof(adc_data.front()) + 1;  const uint8_t MEM_SIZE = 130;  uint8_t SINUS_TABLE[130] = {110,115,121,126,131,137,142,147, 152,157,161,166,171,175,179,183,187,191,195,198,201,204,207,209, 211,213,215,216,218,219,219,220,220,220,220,219,218,217,216,214, 212,210,208,205,202,199,196,193,189,185,181,177,173,168,164,159, 154,149,144,139,134,129,123,118,113,107,102,97,91,86,81,76, 71,66,61,56,52,47,43,39,35,31,27,24,21,18,15,12, 10,8,6,4,3,2,1,0,0,0,0,1,1,2,4,5,7,9,11,13,16,19,22,25,29,33,37,41,45,49,54,59, 63,68,73,78,83,89,94,99,105,110, };<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  CLK_PeripheralClockConfig(CLK_Peripheral_DAC, ENABLE);   CLK_PeripheralClockConfig(CLK_Peripheral_TIM4, ENABLE);  for(int i = 0 ; i &lt; 130*sizeof(SINUS_TABLE[0]); i+=10){     remcu_store2mem(MEM_ADDRESS + i, (uint8_t*)SINUS_TABLE + i, 10); }<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  \/* DMA channel3 Config -----------------------------------------------------*\/ #define DAC_CH1RDHRH_ADDRESS      0x5388 #define DAC_CH1RD8_ADDRESS      0x5390 #define DAC_CH1RDHLH_ADDRESS      0x538C    DMA_DeInit(DMA1_Channel3);   DMA_Init(DMA1_Channel3,  MEM_ADDRESS,            DAC_CH1RD8_ADDRESS,            MEM_SIZE, DMA_DIR_MemoryToPeripheral, DMA_Mode_Circular,            DMA_MemoryIncMode_Inc, DMA_Priority_High,            DMA_MemoryDataSize_Byte           );    \/* DMA1 Channel 3 enable *\/   DMA_Cmd(DMA1_Channel3, ENABLE);   DMA_GlobalCmd(ENABLE);<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  \/* DAC Channel1 Config: 12bit right ----------------------------------------*\/   \/* DAC deinitialize *\/   DAC_DeInit();    \/* Fill DAC Init param DAC_Trigger_T4_TRGO and  DAC Channel1 Init *\/   DAC_Init(DAC_Channel_1, DAC_Trigger_T4_TRGO, DAC_OutputBuffer_Enable);    \/* Enable DAC Channel1 *\/   DAC_Cmd(DAC_Channel_1, ENABLE);    \/* Enable DMA for DAC Channel1 *\/   DAC_DMACmd(DAC_Channel_1, ENABLE);<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  TIM4_DeInit();   \/* Time base configuration *\/   TIM4_TimeBaseInit(TIM4_Prescaler_1, 0x1);    \/* TIM4 TRGO selection *\/   TIM4_SelectOutputTrigger(TIM4_TRGOSource_Update);    \/* TIM4 enable counter *\/   TIM4_Cmd(ENABLE);<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0426\u0410\u041f \u0432\u0437\u044f\u0442 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e <a href=\"https:\/\/github.com\/tanbras\/MCU_Experiments\/tree\/master\/Standard_Peripheral_Library_STM8L_V1.4.0\/Project\/DAC\/DAC_SignalsGeneration\" rel=\"nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/a>. \u0417\u0434\u0435\u0441\u044c \u044f \u043d\u0435 \u0441\u0442\u0430\u043b\u0430 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 big-endian, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0430 \u0426\u0410\u041f \u0432 \u0440\u0435\u0436\u0438\u043c 8-bit.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 Standard Peripheral Library \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0437\u0430\u0432\u0435\u043b\u0438\u0441\u044c. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043a\u043e\u0434 \u0438\u0437 <a href=\"https:\/\/github.com\/tanbras\/MCU_Experiments\/tree\/master\/Standard_Peripheral_Library_STM8L_V1.4.0\/Project\/DAC\/DAC_NoiseTriangleGenerator\" rel=\"nofollow\">DAC_Noise&amp;TriangleGenerator<\/a> \u0443 \u043c\u0435\u043d\u044f \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043e\u0448\u0438\u0431\u043a\u0443, \u0447\u0442\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0444-\u0446\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">DAC_SetTriangleWaveAmplitude<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0444-\u0446\u0438\u0438 \u043d\u0435\u0442 \u0432 <strong>Standard Peripheral Library<\/strong> \u0432\u0435\u0440\u0441\u0438\u0438 1.4.0. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043c\u0435\u0439\u0442\u0435 \u044d\u0442\u043e \u0432\u0432\u0438\u0434\u0443 \u0435\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0445 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u0432\u0435\u0440\u0441\u0438\u044e 1.4.0 \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e REMCU.<\/p>\n<p>  <\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043d\u043e\u0443\u0442\u0431\u0443\u043a \u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 LCD \u044d\u043a\u0440\u0430\u043d\u043e\u043c \u043d\u0430 \u043f\u043b\u0430\u0442\u0435, \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c gif-\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438. \u0416\u041a \u044d\u043a\u0440\u0430\u043d \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043c \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u044b\u0442\u043e\u0432, \u0441 \u043d\u0438\u043c \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u044f \u0440\u0435\u0448\u0438\u043b\u0430 \u0441\u043a\u043e\u0440\u0435\u0435 \u0438\u0437 \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u0441\u0442\u0432\u0430. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0431\u044b\u043b\u043e \u043e\u0447\u0435\u043d\u044c \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0437\u0430 15 \u043c\u0438\u043d\u0443\u0442 \u043e\u043d \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u042f \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043a\u043e\u0434 \u0438\u0437 <a href=\"https:\/\/github.com\/tanbras\/MCU_Experiments\/tree\/master\/Standard_Peripheral_Library_STM8L_V1.4.0\/Project\/Discover\/src\" rel=\"nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/a> \u043a \u043f\u043b\u0430\u0442\u0435 STM8LDiscovery \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 LCD \u044d\u043a\u0440\u0430\u043d\u043e\u043c. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0443 \u0444-\u0446\u0438\u044e: <\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void LCD_print(std::string str);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u043d\u0430 \u0416\u041a \u044d\u043a\u0440\u0430\u043d\u0435. <\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 notebook&#8217;\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/tanbras\/MCU_Experiments\" rel=\"nofollow\">Github<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0431\u044b\u043b\u0438 \u043c\u043e\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0441 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0438 STM8L151 \u0432 Jupyter Notebok. \u042d\u0442\u043e \u0431\u044b\u043b\u0430 \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0447\u0435\u043c-\u0442\u043e \u043a\u0440\u043e\u043c\u0435 \u0430\u0440\u0434\u0443\u0438\u043d\u043e, \u0441 \u0447\u0435\u043c \u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0447\u0435\u043c \u0430\u0440\u0434\u0443\u0438\u043d\u043e \u0438 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u043d\u044b\u043c. \u0412\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e, \u043a\u0440\u043e\u043c\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441 big-endian. \u041d\u0430 \u043f\u043e\u0438\u0441\u043a \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u0432 \u0441\u0442\u043e\u043b\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0410\u0426\u041f \u0443 \u043c\u0435\u043d\u044f \u0443\u0448\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0435\u0441\u043b\u0438 \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u0438, \u044f, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0430 \u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0442\u043e\u043b\u044c \u0437\u0430\u043a\u043e\u0432\u044b\u0440\u0438\u0441\u0442\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0438\u043a\u0440\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u0441\u0447\u0438\u0442\u0430\u044e \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c, \u043c\u044b \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c STM8LDiscovery \u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c STM32F4Discovery \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u0410 \u0441\u0435\u0439\u0447\u0430\u0441 \u0434\u0430\u0436\u0435 \u0443\u0436\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0431\u0430\u0439\u0434\u0438\u043d\u0433\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 REMCU \u0434\u043b\u044f Python. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0441 Linux \u0438\u043b\u0438 MacOS, \u0430 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 \u0440\u043e\u0434\u043d\u043e\u0439 \u043e\u043a\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043e\u043f\u044b\u0442\u043e\u0432,<br \/>  \u0414\u0430 \u043f\u0440\u0438\u0431\u0443\u0434\u0435\u0442 \u0441 \u0432\u0430\u043c\u0438 Jupyter!<\/p>\n<\/div>\n<p> \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\/post\/486598\/\"> https:\/\/habr.com\/ru\/post\/486598\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/486598\/\">\n<p>Jupyter Notebook \u2014 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442-\u0441\u0440\u0435\u0434\u0430 \u0434\u043b\u044f data scientist&#8217;\u043e\u0432, \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u043e\u0432, \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432, \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0432, \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432 \u0438 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u043d\u0430\u0441 \u2014 \u0441\u0430\u043c\u044b\u0445 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0443\u0447\u0435\u043d\u044b\u0445 \u0432 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0438\u0437\u0438\u043a\u0435. <\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c\u0438 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0447\u0438\u0442\u0430\u043b\u0438 \u043d\u0430 \u043d\u0435\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Python \u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 (numpy, SciPy, matplot \u0438 \u0442.\u0434.). \u041d\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0440\u0435\u0434\u0430 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u0430 \u0438 \u0438\u043c\u0435\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b. \u041e\u0447\u0435\u043d\u044c \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e, \u043d\u043e Jupyter \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445, \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0447\u0435\u043c-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 REPL \u0441\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u041c\u041a \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0437 \u0441\u043b\u0430\u0431\u0435\u043d\u044c\u043a\u043e\u0433\u043e MicroPython \u0438 \u0432\u043d\u0443\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u0444\u0435\u0440\u0438\u0438 \u0447\u0438\u043f\u0430, \u043f\u0440\u0438\u0447\u0435\u043c \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wm\/gh\/7f\/wmgh7f8oyyssxa6qtfnkmqflv6k.gif\"><\/p>\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-301034","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301034","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=301034"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301034\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=301034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=301034"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=301034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}