{"id":208016,"date":"2014-01-02T12:30:02","date_gmt":"2014-01-02T08:30:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=208016"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=208016","title":{"rendered":"<span class=\"post_title\">\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0412\u0410\u0425 \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 Cypress<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h4>\u0428\u0430\u0433 1: \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b<\/h4>\n<p>  \u0418\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0434\u043e\u043c\u0430 \u0431\u044b\u043b\u0438:<br \/>  1. \u041c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0444\u0438\u0440\u043c\u044b Cypress \u201cCY8C29466 \u2013 24PXI&quot; \u0438 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0430 \u201cPSoCEVAL1 RevE\u201d<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/c65\/0f4\/038\/c650f403825400ac855a9ee1cc709750.jpg\" alt=\"image\"\/> <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/73e\/4a1\/3ba\/73e4a13bac53d0fd3aa1cf71fb02ab5c.jpg\" alt=\"image\"\/><br \/>  2. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0442\u043e\u0440 PSoC MiniProg \u0438 USB-miniUSB \u043f\u0440\u043e\u0432\u043e\u0434 \u0434\u043b\u044f \u043d\u0435\u0433\u043e<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/39b\/3d2\/eea\/39b3d2eea0eb5b4e4bb1cc48c317e93c.jpg\" alt=\"image\"\/> <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/27d\/bb8\/a84\/27dbb8a841f796b236eb44c30982892a.jpg\" alt=\"image\"\/><br \/>  3. \u041c\u0443\u043b\u044c\u0442\u0438\u043c\u0435\u0442\u0440 \u0438 LCD \u0434\u0438\u0441\u043f\u043b\u0435\u0439 (\u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435)<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/ddd\/ac2\/23f\/dddac223f3a3d224bc17856146ae1196.jpg\" alt=\"image\"\/> <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/2fa\/873\/258\/2fa87325834f5e8a7c07bdc160082981.jpg\" alt=\"image\"\/><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0428\u0430\u0433 2: \u0421\u0445\u0435\u043c\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043a\u0438\u043d\u0443\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0442\u043e\u0438\u0442 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0432\u043e\u043b\u044c\u0442-\u0430\u043c\u043f\u0435\u0440\u043d\u043e\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e\u043b\u0435\u0432\u043e\u0433\u043e \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440\u0430. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 I\u0441\u0438 (\u0442\u043e\u043a\u0430 \u0441\u0442\u043e\u043a-\u0438\u0441\u0442\u043e\u043a) \u043e\u0442 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f U\u0437(\u0443 \u0437\u0430\u0442\u0432\u043e\u0440\u0430). \u0422\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u043e-\u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0437\u0430\u0432\u044f\u0437\u0430\u043d\u044b \u043d\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0438 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f, \u043d\u0443\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u0441\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0442\u043e\u043a\u0430 \u043f\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u043c\u0443 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044e. \u0418 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0439 \u043d\u0430 \u0441\u0432\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430.<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/12a\/c20\/926\/12ac20926108774992ae38d396e5af4b.jpg\" alt=\"image\" align=\"left\"\/>\u0413\u0434\u0435:<br \/>  Vdd \u2014 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0451\u0440\u0430 \u0438 \u043f\u043b\u0430\u0442\u044b<br \/>  R1 \u2014 \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 <br \/>  Q1 \u2014 \u043f\u043e\u043b\u0435\u0432\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440<br \/>  DAC \u0438 ADC \u2014 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0446\u0438\u0444\u0440\u043e-\u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0439 \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e-\u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438.<\/p>\n<h4>\u0428\u0430\u0433 3: \u0412\u044b\u0431\u043e\u0440 \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440\u0430<\/h4>\n<p>  \u0412 \u043c\u0430\u043d\u0443\u0430\u043b\u0430\u0445 \u0431\u044b\u043b\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e, \u0447\u0442\u043e \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043f\u043b\u0430\u0442\u044b Vdd = 5\u0412, \u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0446\u0438\u0444\u0440\u043e-\u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u043b\u0435\u0431\u043b\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0442 0 \u0434\u043e 5\u0412. \u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440(Q1) \u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u0435\u043d\u0438\u0435(R1). \u0412\u044b\u0431\u043e\u0440 \u0443\u043f\u0430\u043b \u043d\u0430 \u041a\u041f103\u041c \u0438 \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 50 \u041e\u043c.<\/p>\n<h5>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440\u0430 \u041a\u041f103\u041c:<\/h5>\n<p>  \u2022 \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440\u0430: \u0441 p-n-\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c \u0438 p-\u043a\u0430\u043d\u0430\u043b\u043e\u043c;<br \/>  \u2022 \u0420\u0441\u0438 max \u2014 \u0420\u0430\u0441\u0441\u0435\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u0441\u0442\u043e\u043a-\u0438\u0441\u0442\u043e\u043a: 120 \u043c\u0412\u0442;<br \/>  \u2022 U\u0437\u0438 \u043e\u0442\u0441 \u2014 \u041d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043e\u0442\u0441\u0435\u0447\u043a\u0438 \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440\u0430 \u2014 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u0442\u0432\u043e\u0440\u043e\u043c \u0438 \u0438\u0441\u0442\u043e\u043a\u043e\u043c: 2,8&#8230;7 \u0412;<br \/>  \u2022 U\u0441\u0438 max \u2014 \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u043a-\u0438\u0441\u0442\u043e\u043a: 10 \u0412;<br \/>  \u2022 I\u0441 \u043d\u0430\u0447 \u2014 \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u043e\u043a \u0441\u0442\u043e\u043a\u0430: 3\u2026 12 \u043c\u0410;<br \/>  \u2022 S \u2014 \u041a\u0440\u0443\u0442\u0438\u0437\u043d\u0430 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438: \u0431\u043e\u043b\u0435\u0435 1,3\u2026 4,4 \u043c\u0410\/\u0412;<br \/>  \u2022 \u042111\u0438 \u2014 \u0412\u0445\u043e\u0434\u043d\u0430\u044f \u0435\u043c\u043a\u043e\u0441\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440\u0430 \u2014 \u0435\u043c\u043a\u043e\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u0442\u0432\u043e\u0440\u043e\u043c \u0438 \u0438\u0441\u0442\u043e\u043a\u043e\u043c: 20 \u043f\u0424;<br \/>  \u2022 \u042112\u0438 \u2014 \u0415\u043c\u043a\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u0432 \u0441\u0445\u0435\u043c\u0435 \u0441 \u043e\u0431\u0449\u0438\u043c \u0438\u0441\u0442\u043e\u043a\u043e\u043c \u043f\u0440\u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u043c \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0438 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u043f\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c\u0443 \u0442\u043e\u043a\u0443: 8 \u043f\u0424;<br \/>  \u2022 \u041a\u0448 \u2014 \u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0448\u0443\u043c\u0430 \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440\u0430: \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 3 \u0434\u0411 \u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0435 1 \u043a\u0413\u0446.<\/p>\n<p>  \u041f\u043e\u043b\u0434\u043d\u044f \u043d\u0430 \u0440\u044b\u043d\u043a\u0435 \u0438 \u0431\u044b\u043b\u0438 \u043a\u0443\u043f\u043b\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0435\u0449\u0438.<br \/>  1. \u041f\u043e\u043b\u0435\u0432\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440 \u041a\u041f103\u041c \u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u0435\u043d\u0438\u0435 50 \u041e\u043c<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/2b2\/b11\/478\/2b2b1147852a6ec2abc009624603d0c9.jpg\" alt=\"image\"\/> <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/b5e\/ec5\/da1\/b5eec5da163afdf3a92c520cf55ad9ac.jpg\" alt=\"image\"\/><br \/>  2. \u041a\u0430\u0431\u0435\u043b\u044c RS 232, \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043a\u043e\u043c\u043f (\u0445\u043e\u0442\u0435\u043b \u043a\u0443\u043f\u0438\u0442\u044c RS232-USB \u043d\u043e \u0446\u0435\u043d\u0430 \u0441\u044b\u0433\u0440\u0430\u043b\u0430 \u0441\u0432\u043e\u044e \u0440\u043e\u043b\u044c, \u0434\u0430 \u0435\u0449\u0451 \u043f\u043e\u0431\u043e\u044f\u043b\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 com-\u043f\u043e\u0440\u0442\u0430\u043c\u0438)<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/844\/6a7\/eab\/8446a7eab8f030bf1405eca7e309f114.jpg\" alt=\"image\"\/><\/p>\n<h4>\u0428\u0430\u0433 4: \u041f\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.<\/h4>\n<p>  <\/p>\n<h5>0. \u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0441\u0440\u0435\u0434\u0435 PSoC Designer 5.3 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u043e \u043d\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 (\u0445\u043e\u0442\u044f \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0441 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435\u043b\u044c\u0437\u044f, \u044d\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c). \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0441\u0440\u0435\u0434\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0445\u0435\u043c\u0443 \u0447\u0438\u043f\u0430. \u041d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 (\u0430 \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0447\u0442\u043e \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0442\u043e \u043d\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435) \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u042d\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c, \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0426\u0410\u041f, \u0410\u0426\u041f, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0434\u0438\u0441\u043f\u043b\u0435\u044f, \u0442\u0440\u0430\u043d\u0441\u0438\u0432\u0435\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0443\u0441\u0438\u043b\u0438\u0442\u0435\u043b\u0438, \u0442\u0430\u0439\u043c\u0435\u0440\u044b, \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0438, \u0434\u0430\u0442\u0447\u0438\u043a\u0438 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b (\u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432 \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u0443), \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0431\u043b\u043e\u043a\u0438, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0426\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u0435\u0440\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430, \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0435 \u0432 \u043d\u0438\u0436\u043d\u0435\u0439. \u0412 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0437\u043e\u043d\u0443 \u0432\u0445\u043e\u0434\u044f\u0442 \u0442\u0430\u043a\u0436\u0435 \u0448\u0438\u043d\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u0432\u0445\u043e\u0434\u044b \u0438 \u0432\u044b\u0445\u043e\u0434\u044b \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0445 \u0438 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u0440\u0442\u0430\u043c\u0438(\u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043d\u043e\u0433\u0438 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430). \u041f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u0440\u0438\u0442\u044f\u0433\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u043a\u043b\u0438\u043a\u0430\u043c\u0438 \u043c\u044b\u0448\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0435\u0433\u043e \u043a \u043f\u043e\u0440\u0442\u0430\u043c, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0447\u0442\u043e \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/11c\/354\/418\/11c3544183e0c783ebdc24bacd6c5dbe.jpg\" alt=\"image\"\/><br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/8a7\/448\/756\/8a744875605e2af28e5c17ffec36009e.png\" alt=\"image\" align=\"right\"\/><br \/>  \u0412 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043c\u0430\u043b\u043e\u0432\u0430\u0436\u043d\u0430\u044f \u043f\u0430\u043d\u0435\u043b\u044c \u00abGlobal resources\u00bb. \u0412 \u043a\u043e\u0442\u043e\u0440\u043e\u0439, \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0447\u0438\u043f\u0430, \u0442\u0430\u043a\u0438 \u043a\u0430\u043a: \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430, \u0440\u0435\u0436\u0438\u043c \u043f\u0438\u0442\u0430\u043d\u0438\u044f, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438 \u0447\u0430\u0441\u0442\u043e\u0442\u044b, \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0445 \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432.<br \/>  \u041a\u0440\u0430\u0441\u043d\u044b\u043c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u0442\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u0432 \u0445\u043e\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b. Ref Mux \u2014 \u044d\u0442\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0439, \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u044b. VC \u2014 \u044d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438 \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0438 \u0431\u043b\u043e\u043a\u043e\u0432 \u0426\u0410\u041f \u0410\u0426\u041f.<\/p>\n<h5>1. DAC<\/h5>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043c\u043e\u0434\u0443\u043b\u044c DAC8(\u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 8bit Digital-to-Analog Converter), \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 8\u043c\u0438 \u0431\u0438\u0442\u043d\u044b\u0439 \u0446\u0438\u0444\u0440\u043e-\u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. \u0420\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c \u0432 8\u043c\u044c \u0431\u0438\u0442 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 (Vmax-Vmin)\/256, \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f 5\u0412\/256. \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0412\u044b\u0445\u043e\u0434 DAC&#8217;\u043a\u0430 \u0431\u044b\u043b \u0432\u044b\u0432\u0435\u0434\u0435\u043d \u043d\u0430 \u0448\u0438\u043d\u0443 AnalogOutBus_0. \u0410 \u0441\u0430\u043c\u0430 \u0448\u0438\u043d\u0430 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u0430 \u043d\u0430 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u043e\u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0443 \u043c\u0435\u043d\u044f DAC \u0432\u044b\u0432\u0435\u0434\u0435\u043d \u043d\u0430 Port_0_3, \u0443\u0432\u044b, \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u0435\u0433\u043e \u043d\u0435 \u0432\u0438\u0434\u043d\u043e, \u043d\u043e \u043f\u043e\u0432\u0435\u0440\u0442\u0438 \u043c\u043d\u0435 \u043d\u0430 \u0441\u043b\u043e\u0432\u043e, \u043e\u043d \u0442\u0430\u043c \u0435\u0441\u0442\u044c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430.<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/2f6\/086\/2b6\/2f60862b695057e2d084d6838d687427.png\" alt=\"image\" align=\"left\"\/><br \/>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438 \u0426\u0410\u041f&#8217;\u043f\u0430. \u0412\u0430\u0436\u043d\u044b\u043c \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0447\u0442\u043e, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0421\u0438 \u0438 Assembly.  <\/p>\n<pre><code class=\"cpp\">#include &lt;m8c.h&gt;        \/\/ part specific constants and macros #include &quot;PSoCAPI.h&quot;    \/\/ PSoC API definitions for all User Modules  void main(void) { \tDAC8_1_Start(DAC8_1_HIGHPOWER); \tM8C_EnableGInt ; \/\/ Uncomment this line to enable Global Interrupts \twhile(1) \t{ \t\tDAC8_1_WriteBlind(255);\/\/ \u043e\u0442 0 \u0434\u043e 255 \u0442\u0430\u043a \u043a\u0430\u043a \u0426\u0410\u041f 8\u043c\u0438 \u0431\u0438\u0442\u043d\u044b\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u0445 \u043e\u0442 0 \u0434\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 5\u0412 \t} } <\/code><\/pre>\n<p>  <\/p>\n<pre>                                       \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043b\u0430\u0442\u0443 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0441\u0445\u0435\u043c\u043e\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0432 \u0448\u0430\u0433\u0435 2.<\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/18b\/1e2\/338\/18b1e23387527b120588214cd1e42458.jpg\" alt=\"image\" align=\"right\"\/><br \/>  \u041f\u0440\u043e\u0448\u0438\u0432\u0430\u0435\u043c \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0414\u0435\u0431\u0430\u0436\u0438\u043c \u0442\u0435\u0441\u0442\u0435\u0440\u043e\u043c, \u043f\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 DAC8_1_WriteBlind(); \u0435\u0441\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u043c\u0438 \u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438, \u0438\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441 \u0426\u0410\u041f \u0431\u043b\u043e\u043a\u043e\u043c.<\/p>\n<h5>2. ADC<\/h5>\n<p>  \u041d\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0426\u0410\u041f\u2019\u043e\u043c \u0434\u0435\u043b\u0430 \u043f\u043e\u0448\u043b\u0438 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0433\u0447\u0435. \u0414\u043b\u044f \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0446\u0435\u043b\u044b\u0445 3 \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u044d\u0442\u043e PGA (Programmable Gain Amplifier), \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0443\u0441\u0438\u043b\u0438\u0442\u0435\u043b\u044c. \u041e\u043d \u043d\u0443\u0436\u0435\u043d \u043d\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0443\u0441\u0438\u043b\u0435\u043d\u0438\u044f (\u0435\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0443\u0441\u0438\u043b\u0435\u043d\u0438\u044f \u0432 \u043d\u0435\u043c \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d 1, \u0434\u0430 \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043e\u043d \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0432\u044b\u0434\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0447\u0435\u043c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043f\u0438\u0442\u0430\u043d\u0438\u044f) \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u0435\u043d\u0438\u044f. \u0427\u0442\u043e \u0431\u044b \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0442\u043e\u043a\u0430 \u0432 \u0446\u0435\u043f\u0438 \u043d\u0435 \u0432\u043b\u0438\u044f\u043b\u0430 \u043d\u0430 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f. \u041e\u0434\u0438\u043d \u0432\u0445\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b, \u0432\u043e\u0442\u043a\u043d\u0443\u0442 \u0432 \u0437\u0435\u043c\u043b\u044e, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0432\u0435\u0448\u0435\u043d \u043d\u0430 port_0_1. \u0412\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u0441\u0442\u0430\u043b \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0430\u043c \u0426\u0410\u041f, \u043f\u043e\u043b\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 ADCINC12. \u0420\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 12bit, \u0447\u0442\u043e \u0435\u0441\u0442\u044c 4096 \u0448\u0430\u0433\u043e\u0432 \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u0438\u0433\u043d\u0430\u043b\u0443. \u041e\u0434\u0438\u043d \u0438\u0437 \u0432\u0445\u043e\u0434\u043e\u0432 \u0426\u0410\u041f&#8217;\u043f\u0430 \u0431\u044b\u043b \u0441\u043e\u0435\u0434\u0438\u043d\u0451\u043d \u0441 \u0432\u044b\u0445\u043e\u0434\u043e\u043c PGA, \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u043e\u0435\u0434\u0438\u043d\u0451\u043d \u0441 \u0437\u0435\u043c\u043b\u0451\u0439. \u0422\u0430\u043a \u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442 \u0447\u0442\u043e, \u0432\u0441\u0435 \u044d\u0442\u0438 \u0448\u0442\u0443\u043a\u0438 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f DAC&#8217;\u043a\u0430) \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0430\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0434\u0438\u043d \u0442\u0430\u043a\u0442\u043e\u0432\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440, \u0430 \u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u0435\u0435 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u0410\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u043f\u043e\u0441\u0430\u0436\u0430\u043d\u044b \u043d\u0430 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b VC1 \u0440\u0430\u0432\u043d\u043e\u0439 SysClock\/8(24\u041c\u0413\u0446\/8). \u0412\u0441\u0451 \u0432\u044b\u0448\u0435 \u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434.<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/e14\/a25\/1e1\/e14a251e1b66e733365eb4a1b26e3c7b.png\" alt=\"image\"\/><br \/>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0449\u0451 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u043b\u0438, \u044d\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c LCD, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u043c. \u0410 \u043d\u0443\u0436\u0435\u043d \u043e\u043d \u043d\u0430\u043c \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b ADC \u0438 PGA, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0437\u0432\u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u044d\u0442\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043d\u0430\u043c \u043d\u0435 \u0443\u0434\u0430\u0441\u0442\u0441\u044f. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0445\u0435\u043c\u0435 \u043e\u043d \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442, \u0438 \u0438\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0443 \u043d\u0435\u0433\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u044d\u0442\u043e LCDPort, \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d Port_2, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u0430\u0448\u0435\u0439 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0435. <br \/>  \u041d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0441\u043b\u0438 \u0447\u0442\u043e \u0443\u043f\u0443\u0441\u0442\u0438\u043b, \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432\u044b\u0448\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/e45\/deb\/4e0\/e45deb4e02a8562a9241c75b5e4cb7be.png\" alt=\"image\"\/><img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/7f7\/acf\/02e\/7f7acf02e5843daa9694222c3c738108.png\" alt=\"image\"\/><img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/c5e\/2a2\/648\/c5e2a2648261bb1468cfa187e2045f5d.png\" alt=\"image\"\/><br \/>  \u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"cpp\">#include &lt;m8c.h&gt;        \/\/ part specific constants and macros #include &quot;PSoCAPI.h&quot;    \/\/ PSoC API definitions for all User Modules  void main(void) { \tDAC8_1_Start(DAC8_1_HIGHPOWER);\t\t\t \tPGA_1_Start(PGA_1_HIGHPOWER);\t\t\t \tADCINC12_1_Start(ADCINC12_1_HIGHPOWER);\t \tADCINC12_1_GetSamples(0);     \t\t\t\/\/\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0440\u0435\u0436\u0438\u043c\u0430 \u0441\u0435\u043c\u043f\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f - \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f \tLCD_Start();\t\t\t\t\t\t\t \tLCD_Position(1,0);\t\t\t\t\t\t\/\/\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \tM8C_EnableGInt ; \/\/ Uncomment this line to enable Global Interrupts \twhile(1) \t{ \t\tDAC8_1_WriteBlind(255);\/\/ \u043e\u0442 0 \u0434\u043e 255 \u0442\u0430\u043a \u043a\u0430\u043a \u0426\u0410\u041f 8\u043c\u0438 \u0431\u0438\u0442\u043d\u044b\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u0445 \u043e\u0442 0 \u0434\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 5\u0412 \t\tresult = ADCINC12_1_iGetData() + 2048; \t\tADCINC12_1_ClearFlag(); \t\tLCD_Position(1,0); \t\tLCD_PrHexInt(result); \t} } <\/code><\/pre>\n<p>  \u042d\u043a\u0440\u0430\u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0446\u0438\u0444\u0440\u044b \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u043e\u0442 0 \u0434\u043e 0x0FFF, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f.\u0423\u0440\u0430! \u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e. \u0414\u0432\u0438\u0433\u0430\u0435\u043c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435.<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/d02\/0d0\/e8c\/d020d0e8c77edde79a221c1e9688e15f.jpg\" alt=\"image\"\/><\/p>\n<h5>3. UART<\/h5>\n<p>  UART \u044d\u0442\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 RS232. \u041d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u0442\u0430\u0448\u0438\u0442\u044c \u0431\u043b\u043e\u043a UART \u043d\u0430 \u0441\u0445\u0435\u043c\u0443. \u041c\u043e\u0434\u0443\u043b\u044c UART \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0432\u0430 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u0430, \u043e\u0434\u0438\u043d \u0434\u043b\u044f RX \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u043b\u0438\u043d\u0438\u044f, \u0432\u0442\u043e\u0440\u043e\u0439 \u0434\u043b\u044f TX, \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0449\u0430\u044f \u043b\u0438\u043d\u0438\u044e. \u0412\u044b\u0445\u043e\u0434\u044b \u044d\u0442\u0438\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0431\u044b\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u0440\u0442\u0430\u043c\u0438, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. Port_2_7 \u0434\u043b\u044f \u0432\u044b\u0445\u043e\u0434\u0430, Port_1_6 \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u0430. \u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e UART \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0435 VC3 = SysClock\/156, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0431\u0438\u0442\u0440\u0435\u0439\u0442\u043e\u043c 19200. \u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f UART_1_PutSHexInt().<br \/>  \u041d\u0443 \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0448\u0442\u0440\u0438\u0445\u043e\u043c \u0431\u044b\u043b\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0446\u0438\u043a\u043b \u0441 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043d\u0430 while(i&lt;255). \u0427\u0442\u043e \u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0430\u0440\u044c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043f\u043e\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u0432 DAC \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0441\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435.<br \/>  \u0424\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043a\u043e\u0434\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/\/---------------------------------------------------------------------------- \/\/ C main line \/\/----------------------------------------------------------------------------  #include &lt;m8c.h&gt;        \/\/ part specific constants and macros #include &quot;PSoCAPI.h&quot;    \/\/ PSoC API definitions for all User Modules  int result; int i;  void main(void) { \tDAC8_1_Start(DAC8_1_HIGHPOWER); \tPGA_1_Start(PGA_1_HIGHPOWER); \tADCINC12_1_Start(ADCINC12_1_HIGHPOWER); \tADCINC12_1_GetSamples(0);      \tLCD_Start(); \tLCD_Position(1,0); \t \tUART_1_Start(UART_PARITY_NONE);        \tM8C_EnableGInt ; \/\/ Uncomment this line to enable Global Interrupts \twhile(i&lt;255) \t{ \t\tDAC8_1_WriteBlind(i); \t\tif(ADCINC12_1_fIsDataAvailable() != 0) \t\t{ \t\t\tresult = ADCINC12_1_iGetData() + 2048; \t\t\tADCINC12_1_ClearFlag(); \t\t\tLCD_Position(1,0); \t\t\tLCD_PrHexInt(result); \t\t\t \t\t\tUART_1_PutSHexInt(result);    \/* Print result to UART *\/ \t\t\t \t\t\ti++; \t\t} \t} } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <habracut\/>  <\/p>\n<h4>\u0428\u0430\u0433 5: \u041f\u0440\u043e\u0441\u043b\u0443\u0448\u043a\u0430 COM-\u043f\u043e\u0440\u0442\u0430<\/h4>\n<p>  <img decoding=\"async\" src=\"http:\/\/cs537409.vk.me\/u26632194\/docs\/cec988243d06\/despetcher_ustroystv.png?extra=9DnNTvOlOMV_Oh9jc8HAX65PlG6-g2dS0wtqPsb724j2plpOIctGRK2mY6F0AJV5v8YL2uX2aSW34t2zvmloi1u9q53NIEH4ng\" alt=\"image\" align=\"right\"\/><br \/>  \u041a\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043b\u0438 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043a\u043e\u043c\u043f? \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u043a\u043b\u044e\u0447\u0451\u043d \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 com-\u043f\u043e\u0440\u0442. \u0414\u043b\u044f windows 7 -&gt; \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u041c\u043e\u0439 \u041a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 -&gt; \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 -&gt; \u0438 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u0440\u0430\u0441\u0441\u043f\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u0443 \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0442 \u0442\u0435\u043a\u0441\u0442\u0430. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c com-\u043f\u043e\u0440\u0442 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d, \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432 BIOS.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c.<\/p>\n<p>  \u0412\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044f<br \/>  Bit per second \u2014 19200<br \/>  Data bits \u2014 8<br \/>  Parity \u2014 None<br \/>  Stop bits \u2014 1<br \/>  Flow control \u2014 none<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/cs538100.vk.me\/u26632194\/docs\/ddf5b7f2ed49\/ComPortSittings.png?extra=fZYCcK4ypMgLdx_nwr4ihtePTNX4lGE1bBaBRQtt7t0vL_4wQGlecOJPXmYBOSwbeENzJp_FRm4T6SKSGcWe_IIN6dNLUYTr_Q\" alt=\"image\"\/><\/p>\n<p>  \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0433\u0443 HyperTerminal \u0438\u043b\u0438 \u0447\u0442\u043e \u043b\u0438\u0431\u043e \u043f\u043e\u0445\u043e\u0436\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c \u0447\u0442\u043e \u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0451. \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0430\u0448 \u043f\u043e\u0440\u0442 COM1.<br \/>  \u0418 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0431\u0435\u0437\u0443\u043c\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0431\u0430\u0439\u0442\u043e\u0432.<br \/>  <img decoding=\"async\" src=\"http:\/\/cs537504.vk.me\/u26632194\/docs\/c5d9ae0783f9\/HyperTerminal.png?extra=Qkjm_0_658F8-4hqTV2JQj9VkLWydzXuj8FFNI-ZnmsskVbUIiO2HFmomn7O538BTd80GZp_7b-9_EpxMJykgu1xE_rTYDFHRA\" alt=\"image\"\/><br \/>  \u0422\u0440\u0430\u043d\u0441\u043c\u0438\u0442\u0442\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<h4>\u0428\u0430\u0433 6: C# \u043a\u043b\u0438\u0435\u043d\u0442<\/h4>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043b\u044e\u0431\u043e\u0439 VisualStudio \u0421#. \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0443\u0434\u0430 \u0434\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430. \u041e\u0434\u0438\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Com \u0434\u0440\u0443\u0433\u043e\u0439 c Excel ( \u042f \u0442\u0430\u043a \u0438\u0445 \u0438 \u043d\u0430\u0437\u0432\u0430\u043b). \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Excel(\u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 References -&gt; Add Reference\u2026 -&gt; Extensions -&gt; Microsoft.Office.Interop.Excel). \u0412\u0441\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437 Hex&#8217;\u043e\u0432 \u0432 int&#8217;\u044b \u0438 \u0438\u0437 int&#8217;\u043e\u0432 \u0432 \u0442\u043e\u043a, \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0432 Program.cs.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Program.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">    class Program     {         public static List&lt;double&gt; ConvInToAmp(List&lt;int&gt; input)         {             List&lt;double&gt; converted = new List&lt;double&gt;();             double stap = 0.00116822;             double Vdd = 4.8;             double R = 50;             for (int i = 0; i &lt; 255; i++)             {                 converted.Add(input[i] * stap);                 converted[i] = Vdd - converted[i];                 converted[i] = converted[i] \/ R;                 \/\/Console.WriteLine(converted[i]);             }             return converted;         }         public static List&lt;double&gt; CreateVolt()         {             List&lt;double&gt; volts = new List&lt;double&gt;();             double stap = 0.0188235294117647;             for (int i = 0; i &lt; 255; i++)             {                 volts.Add(i*stap);             }             return volts;         }         static void Main(string[] args)         {             Com port = new Com();             port.Strart();             while (!port.Full()) ;             port.Stop();             Console.WriteLine(&quot;Data transmission complite&quot;);             List&lt;int&gt; input = port.GetData();             List&lt;double&gt; converted = ConvInToAmp(input);             Console.WriteLine(&quot;Conversin complite&quot;);             Excel exel = new Excel(CreateVolt(), converted);             Console.Read();         }     } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Com.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">    class Com     {         private List&lt;int&gt; values = new List&lt;int&gt;();         private SerialPort port = new SerialPort(&quot;COM1&quot;, 19200, Parity.None, 8, StopBits.One);         private void received(object sender, SerialDataReceivedEventArgs e)         {             string buf;             buf = port.ReadExisting();             while (!String.IsNullOrEmpty(buf))             {                 string str = buf.Substring(0, 4);                 int v = Convert.ToInt32(str, 16);                 buf = buf.Remove(0, 4);                 Console.WriteLine(v);                 values.Add(v);             }         }         public void Strart()         {             Console.WriteLine(&quot;Incoming data:&quot;);             port.DataReceived += new SerialDataReceivedEventHandler(received);             port.Open();         }         public void Stop()         {             port.Close();         }         public bool Full()         {             if (values.Count == 255)                 return true;             else                 return false;         }         public List&lt;int&gt; GetData()         {             return values;         }     }&lt;source lang=&quot;cs&quot;&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Excel.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">    class Excel     {         private List&lt;double&gt; xScale;         private List&lt;double&gt; yScale;         private Application exApp = new Application();         private Sheets sheets;         private Worksheet worksheet;         private Range range;         public Excel(List&lt;double&gt; x,List&lt;double&gt; y)         {             xScale = x;             yScale = y;             exApp.Visible = true;             exApp.SheetsInNewWorkbook = 1;             exApp.Workbooks.Add(Type.Missing);             sheets = exApp.Worksheets;             worksheet = (Worksheet)sheets.get_Item(1);             for (int i = 1; i &lt; 255; i++)             {                 range = worksheet.get_Range(&quot;A&quot; + Convert.ToString(i), &quot;A&quot; + Convert.ToString(i));                 range.Value = xScale[i];                 range = worksheet.get_Range(&quot;B&quot; + Convert.ToString(i), &quot;B&quot; + Convert.ToString(i));                 range.Value = yScale[i];             }             ChartObjects chartObjs = (ChartObjects)worksheet.ChartObjects();             ChartObject chartObj = chartObjs.Add(150, 20, 700,500);             Chart xlChart = chartObj.Chart;             xlChart.ChartType = XlChartType.xlXYScatterLinesNoMarkers;             \/\/PlotArea.                      Range xValues = worksheet.Range[&quot;A1&quot;, &quot;A254&quot;];             Range values = worksheet.Range[&quot;B1&quot;, &quot;B254&quot;];              SeriesCollection seriesCollection = xlChart.SeriesCollection();              Series series1 = seriesCollection.NewSeries();             series1.MarkerSize = 3;             series1.XValues = xValues;             series1.Values = values;          }     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0438 \u0441\u0434\u0435\u043b\u0430\u043d\u043e, \u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0448\u0435\u0442, \u0447\u0442\u043e \u043e\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0433\u0440\u0430\u0444\u0438\u043a \u0432 Excel.<br \/>  <img decoding=\"async\" src=\"http:\/\/cs537300.vk.me\/u26632194\/docs\/7266758e6172\/Result2.png?extra=iXDEQQCCMgW9MmaTffhqYEu8RVfmMRks3vM2UzWjkko_qKEA6YtaUWahPMWAnYRrPcGBjYWOyvKooKrCwTa5E4fy88GHRw\" alt=\"image\"\/> \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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=\"http:\/\/habrahabr.ru\/post\/208016\/\"> http:\/\/habrahabr.ru\/post\/208016\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h4>\u0428\u0430\u0433 1: \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b<\/h4>\n<p>  \u0418\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0434\u043e\u043c\u0430 \u0431\u044b\u043b\u0438:<br \/>  1. \u041c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0444\u0438\u0440\u043c\u044b Cypress \u201cCY8C29466 \u2013 24PXI&quot; \u0438 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0430 \u201cPSoCEVAL1 RevE\u201d<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/c65\/0f4\/038\/c650f403825400ac855a9ee1cc709750.jpg\" alt=\"image\"\/> <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/73e\/4a1\/3ba\/73e4a13bac53d0fd3aa1cf71fb02ab5c.jpg\" alt=\"image\"\/><br \/>  2. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0442\u043e\u0440 PSoC MiniProg \u0438 USB-miniUSB \u043f\u0440\u043e\u0432\u043e\u0434 \u0434\u043b\u044f \u043d\u0435\u0433\u043e<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/39b\/3d2\/eea\/39b3d2eea0eb5b4e4bb1cc48c317e93c.jpg\" alt=\"image\"\/> <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/27d\/bb8\/a84\/27dbb8a841f796b236eb44c30982892a.jpg\" alt=\"image\"\/><br \/>  3. \u041c\u0443\u043b\u044c\u0442\u0438\u043c\u0435\u0442\u0440 \u0438 LCD \u0434\u0438\u0441\u043f\u043b\u0435\u0439 (\u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435)<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/ddd\/ac2\/23f\/dddac223f3a3d224bc17856146ae1196.jpg\" alt=\"image\"\/> <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/2fa\/873\/258\/2fa87325834f5e8a7c07bdc160082981.jpg\" alt=\"image\"\/>  <\/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-208016","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208016","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=208016"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208016\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}