{"id":89555,"date":"2026-08-03T08:56:48","date_gmt":"2026-08-03T00:56:48","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/89555.html"},"modified":"2026-08-03T08:56:48","modified_gmt":"2026-08-03T00:56:48","slug":"arm06-adc%ef%bc%88%e6%a8%a1%e6%95%b0%e8%bd%ac%e6%8d%a2%e5%99%a8%ef%bc%89%e5%92%8c-spi%e4%b8%b2%e8%a1%8c%e5%a4%96%e8%ae%be%e6%8e%a5%e5%8f%a3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/89555.html","title":{"rendered":"ARM06-ADC\uff08\u6a21\u6570\u8f6c\u6362\u5668\uff09\u548c SPI(\u4e32\u884c\u5916\u8bbe\u63a5\u53e3)"},"content":{"rendered":"<h2>\u4e00\u3001ADC&#xff08;\u6a21\u6570\u8f6c\u6362\u5668&#xff09;<\/h2>\n<h3>1.1 ADC\u529f\u80fd\u4ecb\u7ecd<\/h3>\n<p><span style=\"color:#fe2c24\">\u2460 ADC&#xff08;Analog-to-Digital Converter&#xff09;&#xff0c;\u6a21\u62df\u5230\u6570\u5b57\u8f6c\u6362\u5668<\/span>&#xff0c;\u7528\u4e8e\u5c06\u8fde\u7eed\u53d8\u5316\u7684\u6a21\u62df\u4fe1\u53f7\u8f6c\u6362\u4e3a\u79bb\u6563\u7684\u6570\u5b57\u4fe1\u53f7&#xff0c;\u4ee5\u4fbf\u6570\u5b57\u7cfb\u7edf&#xff08;\u5982\u5fae\u5904\u7406\u5668\u3001\u5fae\u63a7\u5236\u5668\u7b49&#xff09;\u80fd\u591f\u5bf9\u5176\u8fdb\u884c\u5904\u7406\u548c\u5206\u6790\u3002<\/p>\n<p><span style=\"color:#fe2c24\">\u2461 \u6a21\u62df\u4fe1\u53f7<\/span>\u4e00\u822c\u662f\u6307\u8fde\u7eed\u53d8\u5316\u7684\u7535\u538b\u4fe1\u53f7&#xff0c;\u5176\u6570\u503c\u5728\u4e00\u5b9a\u8303\u56f4\u5185\u53d8\u5316\u3002\u800c<span style=\"color:#fe2c24\">\u6570\u5b57\u4fe1\u53f7<\/span>\u662f\u7531\u4e00\u7cfb\u5217\u79bb\u6563\u7684\u6570\u5b57\u8868\u793a&#xff0c;\u53ea\u80fd\u53d6\u6709\u9650\u7684\u503c&#xff0c;\u901a\u5e38\u4ee5\u4e8c\u8fdb\u5236\u5f62\u5f0f\u8868\u793a\u3002<br \/>\n<span style=\"color:#fe2c24\">\u2462 ADC\u7684\u5de5\u4f5c\u539f\u7406<\/span>\u662f\u5c06\u6a21\u62df\u4fe1\u53f7\u5206\u5272\u6210\u4e00\u7cfb\u5217\u79bb\u6563\u7684\u53d6\u6837&#xff0c;\u5e76\u5c06\u6bcf\u4e2a\u53d6\u6837\u503c\u8f6c\u6362\u4e3a\u76f8\u5e94\u7684\u6570\u5b57\u8868\u793a\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u6d89\u53ca\u5230\u4e24\u4e2a\u4e3b\u8981\u6b65\u9aa4&#xff1a;\u91c7\u6837\u548c\u91cf\u5316\u3002<\/p>\n<ul>\n<li>\u91c7\u6837&#xff1a; ADC\u5c06\u8fde\u7eed\u53d8\u5316\u7684\u6a21\u62df\u4fe1\u53f7\u5728\u4e00\u5b9a\u65f6\u95f4\u95f4\u9694\u5185\u8fdb\u884c\u53d6\u6837\u3002\u53d6\u6837\u9891\u7387\u51b3\u5b9a\u4e86\u6bcf\u79d2\u91c7\u96c6\u7684\u6837\u672c\u6570&#xff0c;\u901a\u5e38\u4ee5\u8d6b\u5179&#xff08;Hz&#xff09;\u8868\u793a\u3002\u91c7\u6837\u8fc7\u7a0b\u901a\u8fc7\u4fdd\u6301\u5e76\u6d4b\u91cf\u6a21\u62df\u4fe1\u53f7\u5728\u6bcf\u4e2a\u91c7\u6837\u65f6\u95f4\u70b9\u7684\u7535\u538b\u503c\u6765\u5b9e\u73b0\u3002<\/li>\n<li>\u00a0\u91cf\u5316&#xff1a;\u91c7\u6837\u5f97\u5230\u7684\u8fde\u7eed\u6a21\u62df\u4fe1\u53f7\u7ecf\u8fc7\u91cf\u5316\u8f6c\u6362\u4e3a\u6570\u5b57\u5f62\u5f0f\u3002\u91cf\u5316\u662f\u5c06\u6bcf\u4e2a\u91c7\u6837\u503c\u6620\u5c04\u5230\u4e00\u4e2a\u79bb\u6563\u7684\u6570\u5b57\u503c\u7684\u8fc7\u7a0b\u3002\u8fd9\u901a\u5e38\u901a\u8fc7\u6bd4\u8f83\u91c7\u6837\u503c\u4e0e\u53c2\u8003\u7535\u538b\u4e4b\u95f4\u7684\u5dee\u5f02&#xff0c;\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a\u6570\u5b57\u8868\u793a\u3002<\/li>\n<\/ul>\n<p><span style=\"color:#fe2c24\">\u2463\u00a0\u9010\u6b21\u903c\u8fd1\u6cd5<\/span><\/p>\n<p><span style=\"color:#fe2c24\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ADC\u4f1a\u5c06\u5b9e\u9645\u7535\u538b\u4e0e1\/2*Vref&#xff08;\u57fa\u51c6\u7535\u538b&#xff09;\u8fdb\u884c\u6bd4\u8f83&#xff0c;\u5982\u679c\u5b9e\u9645\u7535\u538b\u5927\u5219\u7ed3\u679c\u4e3a1&#xff0c;\u5426\u5219\u4e3a0\u3002\u5f53\u7ed3\u679c\u4e3a1\u65f6&#xff0c;\u5c06\u5b9e\u9645\u7535\u538b\u4e0e1\/2*Vref&#043;1\/4*Vref\u8fdb\u884c\u6bd4\u8f83&#xff0c;\u5982\u679c\u5b9e\u9645\u7535\u538b\u5927&#xff0c;\u5219\u7ed3\u679c\u4e3a1&#xff0c;\u5426\u5219\u4e3a0&#xff1b;\u5f53\u7ed3\u679c\u4e3a0\u65f6&#xff0c;\u5c06\u5b9e\u9645\u7535\u538b\u4e0e1\/2*Vref-1\/4*Vref\u8fdb\u884c\u6bd4\u8f83&#xff0c;\u5982\u679c\u5b9e\u9645\u7535\u538b\u5927&#xff0c;\u5219\u7ed3\u679c\u4e3a1&#xff0c;\u5426\u5219\u4e3a0\u3002\u4f9d\u6b21\u7c7b\u63a8\u8fdb\u884c\u6bd4\u8f83&#xff0c;\u6bd4\u8f83\u7684\u6b21\u6570\u8d8a\u591a\u3002\u7ed3\u679c\u8d8a\u63a5\u8fd1\u4e8e\u5b9e\u9645\u503c\u3002\u6bd4\u8f83\u7684\u6b21\u6570\u51b3\u5b9a\u4e86\u7cbe\u5ea6&#xff0c;\u8fd9\u4e2a\u7cbe\u5ea6\u88ab\u79f0\u4e4b\u4e3aADC\u7684\u5206\u8fa8\u7387\u3002<\/span><br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"218\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803005644-6a6fe74c73c17.png\" width=\"1131\" \/><\/p>\n<p><span style=\"color:#956fe7\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5e38\u89c1\u7684\u5206\u8fa8\u7387\u5305\u62ec8\u4f4d&#xff08;0 ~ 255 &#xff09;&#xff0c; 10\u4f4d&#xff08;0 ~ 1023&#xff09;&#xff0c; 12\u4f4d&#xff08;0 ~ 4095&#xff09;\u548c16\u4f4d&#xff08;0 ~ 65535&#xff09;\u3002<\/span><span style=\"color:#956fe7\">\u00a0\u00a0<\/span><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"115\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803005644-6a6fe74c98b49.png\" width=\"859\" \/><br \/>\n\u00a0\u5982&#xff1a;12\u4f4dADC\u4f8b\u5b50&#xff1a;\u53c2\u8003\u7535\u538b3.3V&#xff0c;\u8bfb\u53d6\u5230\u7684\u539f\u59cbADC\u503c\u662f2048&#xff0c;\u4ee3\u5165\u8ba1\u7b97\u5f97\u5230\u5f85\u6d4b\u7535\u538b2048 \/ 4095 * 3.3\u22481.65V\u3002<\/p>\n<p><span style=\"color:#fe2c24\">\u2464 IMX6ULL\u7684ADC\u6a21\u5757\u6838\u5fc3\u7279\u6027&#xff1a;<\/span><\/p>\n<ul>\n<li>I.MX6ULL\u5185\u90e8\u5177\u6709\u4e24\u4e2aADC\u63a7\u5236\u5668&#xff0c;\u6bcf\u4e2aADC\u5185\u90e8\u90fd\u670910\u4e2a\u901a\u9053\u3002\u90fd\u662f\u91c7\u7528\u9010\u6b21\u903c\u8fd1\u6cd5\u8bbe\u8ba1\u7684\u3002<\/li>\n<li>\u5206\u8fa8\u7387&#xff1a;\u6bcf\u8defADC\u7684\u5206\u8fa8\u7387\u53ef\u9009&#xff0c;\u5206\u522b\u4e3a8\/10\/<span style=\"color:#956fe7\">12<\/span>\u4f4d\u3002<\/li>\n<li>I.MX6ULL\u5185\u90e8ADC\u5177\u6709\u81ea\u52a8\u6821\u51c6\u529f\u80fd&#xff0c;\u56e0\u6b64\u80fd\u591f\u4fdd\u8bc1\u66f4\u9ad8\u7684\u6d4b\u91cf\u7cbe\u5ea6&#xff1b;<\/li>\n<li><span style=\"color:#956fe7\">\u91c7\u6837\u7387&#xff1a;\u6700\u9ad8\u91c7\u6837\u7387 1MS\/s&#xff0c;\u5373 1s \u91c7\u7528 1 \u767e\u4e07\u6b21&#xff1b;\u6700\u5927\u8f6c\u6362\u901f\u7387\u4e3a1MHz&#xff0c;\u5373\u5b8c\u6210\u4e00\u6b21\u8f6c\u6362\u6240\u9700\u7684\u65f6\u95f4\u6700\u5feb\u53ea\u9700\u89811us\u3002<\/span><\/li>\n<li><span style=\"color:#956fe7\">ADC\u91cf\u7a0b&#xff1a;0 ~ 3.3V&#xff0c;\u57fa\u51c6\u7535\u538b\u8bbe\u7f6e\u4e3a3.3V&#xff1b;<\/span><\/li>\n<li><span style=\"color:#956fe7\">\u65f6\u949f\u9009\u62e9&#xff1a;\u9009\u62e9ADACK&#xff0c;<\/span>ADACK\u662fI.MX6ULL\u5185\u90e8\u63d0\u4f9b\u7684\u65f6\u949f\u6e90&#xff0c;\u53ea\u80fd\u63d0\u4f9b\u7ed9ADC\u5916\u8bbe\u4f7f\u7528&#xff0c;\u8fd9\u6837\u505a\u7684\u76ee\u7684\u662f<span style=\"color:#956fe7\">\u4fdd\u8bc1\u7cfb\u7edf\u5904\u4e8e\u4f4e\u529f\u8017\u72b6\u6001\u65f6&#xff0c; ADC\u4f9d\u65e7\u80fd\u591f\u8fd0\u884c\u3002 ADACK\u7684\u65f6\u949f\u9ed8\u8ba4\u4e3a20MHz\u3002<\/span><\/li>\n<\/ul>\n<p><span style=\"color:#fe2c24\">\u2465\u00a0\u00a0IMX6ULL \u7684 ADC \u7ed3\u6784\u56fe<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1532\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803005644-6a6fe74ca817b.png\" width=\"1424\" \/><\/p>\n<p><span style=\"color:#fe2c24\">\u2466\u00a0\u6838\u5fc3\u5bc4\u5b58\u5668&#xff08;\u5f00\u53d1\u5173\u952e&#xff09;<\/span><\/p>\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:659px\">\n<tbody>\n<tr><span style=\"color:#956fe7\">\u5bc4\u5b58\u5668<\/span><span style=\"color:#956fe7\">\u5168\u79f0<\/span><span style=\"color:#956fe7\">\u4f5c\u7528<\/span><span style=\"color:#956fe7\">\u4f4d<\/span><span style=\"color:#956fe7\">\u8bf4\u660e<\/span><\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"2\" style=\"width:102px\">ADCx_HC0<\/td>\n<td colspan=\"1\" rowspan=\"2\" style=\"width:117px\">Control register<\/td>\n<td colspan=\"1\" rowspan=\"2\" style=\"width:91px\">\u63a7\u5236\u5bc4\u5b58\u5668<\/td>\n<td style=\"width:116px\">AIEN(b7)<\/td>\n<td style=\"width:232px\">\u8f6c\u6362\u5b8c\u6210\u4e2d\u65ad\u4f7f\u80fd&#xff08;\u9ed8\u8ba4\u7981\u7528&#xff09;<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">ADCH(b0-b4)<\/td>\n<td style=\"width:232px\">\u9009\u62e9\u91c7\u96c6\u901a\u9053&#xff08;\u00a0\u00a0\u00a000000-01111 External channels 0 to 15&#xff09;&#xff0c;\u6bcf\u6b21\u5207\u6362\u901a\u9053\u65f6\u4f1a\u5f15\u53d1\u4e00\u6b21ADC\u8f6c\u6362<\/td>\n<\/tr>\n<tr>\n<td style=\"width:102px\">ADCx_HS<\/td>\n<td style=\"width:117px\">Status register<\/td>\n<td style=\"width:91px\">\u72b6\u6001\u5bc4\u5b58\u5668<\/td>\n<td style=\"width:116px\">COCO0(b0)<\/td>\n<td style=\"width:232px\">\u8f6c\u6362\u5b8c\u6210\u6807\u5fd7&#xff08;1&#061;\u5b8c\u6210&#xff0c;0&#061;\u672a\u5b8c\u6210&#xff09;\u542f\u52a8\u4e00\u6b21ADC\u8f6c\u6362\u540e\u7b49\u5f85\u8be5\u4f4d\u7f6e\u4f4d\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"width:102px\">ADCx_R0<\/td>\n<td style=\"width:117px\">Data result register<\/td>\n<td style=\"width:91px\">\u6570\u636e\u7ed3\u679c\u5bc4\u5b58\u5668<\/td>\n<td style=\"width:116px\">CDATA(b0-b11)<\/td>\n<td style=\"width:232px\">\u5b58\u50a8\u8f6c\u6362\u7ed3\u679c&#xff08;ADC \u7684\u5206\u8fa8\u7387\u662f12&#xff0c;\u4f4e12\u4f4d\u6709\u6548&#xff0c;\u8303\u56f40~4095&#xff09;<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"11\" style=\"width:102px\">ADCx_CFG<\/td>\n<td colspan=\"1\" rowspan=\"11\" style=\"width:117px\">Configuration register<\/td>\n<td colspan=\"1\" rowspan=\"11\" style=\"width:91px\">\u914d\u7f6e\u5bc4\u5b58\u5668<\/td>\n<td style=\"width:116px\">OVWREN(b16)<\/td>\n<td style=\"width:232px\">\u6570\u636e\u590d\u5199\u4f7f\u80fd\u4f4d(1&#061;\u4f7f\u80fd\u590d\u5199&#xff0c;0&#061;\u5931\u80fd\u590d\u5199)<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">AVGS(b14-b15)<\/td>\n<td style=\"width:232px\">\u786c\u4ef6\u5e73\u5747\u6b21\u6570&#xff0c;\u9ed8\u8ba400&#xff08;4\u6b21\u6837\u672c\u6c42\u5e73\u5747&#xff09;\u6b64\u4f4d\u9700\u8981ADC_GC\u5bc4\u5b58\u5668\u7684AVGE\u4f4d\u7f6e1\u624d\u80fd\u4f7f\u80fd\u786c\u4ef6\u5e73\u5747<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">ADTRG(b13)<\/td>\n<td style=\"width:232px\">\u8f6c\u6362\u89e6\u53d1\u9009\u62e9(\u00a00 &#061; \u9009\u62e9\u8f6f\u4ef6\u89e6\u53d1 ,1\u00a0&#061; \u4e0d\u9009\u62e9\u8f6f\u4ef6\u89e6\u53d1)<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">REFSEL(b11-b12)<\/td>\n<td style=\"width:232px\">\n<p>\u53c2\u8003\u7535\u538b\u9009\u62e9( \u4e3a 00 \u65f6\u9009\u62e9\u00a0VREFH\/VREFL\u00a0\u8fd9\u4e24\u4e2a\u5f15\u811a\u4e0a\u7684\u7535\u538b\u4e3a \u53c2\u8003\u7535\u538b\u56fa\u5b9a\u4e3a3.3v<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">ADHSC(b10)<\/td>\n<td style=\"width:232px\">\n<p>\u9ad8\u901f\u8f6c\u6362\u4f7f\u80fd\u4f4d(\u00a00\u00a0 &#061; \u6b63\u5e38\u6a21\u5f0f, 1\u00a0 &#061; \u9ad8\u901f\u6a21\u5f0f)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">ADSTS(b8-b9)<\/td>\n<td style=\"width:232px\">\u8bbe\u7f6e ADC \u7684\u91c7\u6837\u5468\u671f&#xff0c;\u4e0e ADLSMP \u4f4d\u4e00\u8d77\u51b3\u5b9a\u91c7\u6837\u5468\u671f,\u9ed8\u8ba400<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">ADLPC(b7)<\/td>\n<td style=\"width:232px\">\n<p>\u4f4e\u529f\u8017\u6a21\u5f0f\u914d\u7f6e\u4f4d(\u00a00 &#061; \u4e0d\u5904\u4e8e\u4f4e\u529f\u8017\u6a21\u5f0f, 1 &#061; \u5904\u4e8e\u4f4e\u529f\u8017\u6a21\u5f0f)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">ADIV(b5-b6)<\/td>\n<td style=\"width:232px\">\n<p>\u65f6\u949f\u5206\u9891\u9009\u62e9(\u00a0\u00a000 \u65f6\u4e0d\u5206\u9891)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">ADLSMP(b4)<\/td>\n<td style=\"width:232px\">\u957f\u91c7\u6837\u5468\u671f\u4f7f\u80fd\u4f4d(\u00a00 &#061;\u00a0 \u77ed\u91c7\u6837\u5468\u671f\u6a21\u5f0f&#xff0c;1 &#061; \u957f\u91c7\u6837\u5468\u671f\u6a21\u5f0f\u3002\u642d\u914d ADSTS \u4f4d\u4e00\u8d77\u63a7\u5236 ADC \u7684\u91c7\u6837\u5468\u671f)<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">MODE(b2-b3)<\/td>\n<td style=\"width:232px\">\u5206\u8fa8\u7387\u9009\u62e9\u4f4d(10\u4e3a 12\u4f4d\u7cbe\u5ea6 )<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">ADICLK(b0-b1)<\/td>\n<td style=\"width:232px\">\u8f93\u5165\u65f6\u949f\u9009\u62e9\u4f4d(11 \u4e3aADACK)<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"8\" style=\"width:102px\">ADCx_GC<\/td>\n<td colspan=\"1\" rowspan=\"8\" style=\"width:117px\">General control register<\/td>\n<td colspan=\"1\" rowspan=\"8\" style=\"width:91px\">\u901a\u7528\u63a7\u5236\u5bc4\u5b58\u5668<\/td>\n<td style=\"width:116px\">CAL(b7)<\/td>\n<td style=\"width:232px\">\u542f\u52a8\u81ea\u52a8\u6821\u51c6&#xff08;\u51991\u542f\u52a8&#xff0c;\u8bfb0\u5b8c\u6210&#xff09;<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">ADCO(b6)<\/td>\n<td style=\"width:232px\">\n<p>\u8fde\u7eed\u8f6c\u6362\u6a21\u5f0f\u4f7f\u80fd\u00a0( 0 &#061; \u5355\u6b21&#xff0c;\u6bcf\u6b21\u4eceR0\u53d6\u8d70\u6570\u636e, 1 &#061; \u591a\u6b21)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">AVGE(b5)<\/td>\n<td style=\"width:232px\">\n<p>\u786c\u4ef6\u5e73\u5747\u4f7f\u80fd\u4f4d\u00a0(\u00a00\u00a0&#061;\u786c\u4ef6\u5e73\u5747\u5931\u80fd&#xff0c;\u00a01\u00a0&#061;\u786c\u4ef6\u5e73\u5747\u4f7f\u80fd)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">ACFE(b4)<\/td>\n<td style=\"width:232px\">\u6bd4\u8f83\u529f\u80fd\u4f7f\u80fd\u4f4d(\u00a00\u00a0&#061;\u6bd4\u8f83\u529f\u80fd\u5931\u80fd&#xff0c;\u00a01\u00a0&#061;\u6bd4\u8f83\u529f\u80fd\u4f7f\u80fd)<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">ACFGT(b3)<\/td>\n<td style=\"width:232px\">\u914d\u7f6e\u6bd4\u8f83\u65b9\u6cd5(0 &#061; \u5c0f\u4e8e&#xff0c;1 &#061; \u5927\u4e8e\u6216\u7b49\u4e8e)<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">ACRENb2)<\/td>\n<td style=\"width:232px\">\u8303\u56f4\u6bd4\u8f83\u529f\u80fd\u4f7f\u80fd\u4f4d(\u00a00\u00a0&#061;\u8303\u56f4\u6bd4\u8f83\u5931\u80fd&#xff0c;\u00a01\u00a0&#061;\u8303\u56f4\u6bd4\u8f83\u4f7f\u80fd)<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">DMAAEN<\/td>\n<td style=\"width:232px\">DMA \u529f\u80fd\u4f7f\u80fd\u4f4d(\u00a00\u00a0&#061;DMA \u529f\u80fd\u5931\u80fd&#xff0c;\u00a01\u00a0&#061;DMA \u529f\u80fd\u4f7f\u80fd)<\/td>\n<\/tr>\n<tr>\n<td style=\"width:116px\">ADACKEN(b0)<\/td>\n<td style=\"width:232px\">ADACK\u65f6\u949f\u4f7f\u80fd\u4f4d(1&#061;\u4f7f\u80fd\u65f6\u949f&#xff0c;0&#061;\u5931\u80fd\u65f6\u949f)<\/td>\n<\/tr>\n<tr>\n<td style=\"width:102px\">ADCx_GS<\/td>\n<td style=\"width:117px\">General status register<\/td>\n<td style=\"width:91px\">\u901a\u7528\u72b6\u6001\u5bc4\u5b58\u5668<\/td>\n<td style=\"width:116px\">CALF&#xff08;b1&#xff09;<\/td>\n<td style=\"width:232px\">\u6821\u51c6\u5931\u8d25\u6807\u5fd7&#xff08;0&#061;\u6210\u529f&#xff0c;1&#061;\u5931\u8d25&#xff0c;\u9700\u51991\u6e05\u96f6&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>1.2 ADC\u4ee3\u7801\u5b9e\u73b0<\/h3>\n<p>\u2460 adc.c<\/p>\n<p>\/\/adc.c<br \/>\n#include &#034;adc.h&#034;<br \/>\n#include &#034;MCIMX6Y2.h&#034;<br \/>\n#include &#034;core_ca7.h&#034;<br \/>\n#include &#034;fsl_iomuxc.h&#034;<\/p>\n<p>\/\/ADC\u81ea\u6821\u51c6<br \/>\nint adc1_calibration(void)<br \/>\n{<br \/>\n    ADC1-&gt;GC |&#061; (1 &lt;&lt; 7); \/\/\u6821\u51c6\u4f7f\u80fd&#xff0c;\u6821\u51c6\u5b8c\u6210\u540e\u6b64\u4f4d\u4f1a\u81ea\u52a8\u6e05\u96f6<br \/>\n    while((ADC1-&gt;GC &amp; (1 &lt;&lt; 7)) !&#061; 0); \/\/\u7b49\u5f85\u6821\u51c6\u5b8c\u6210<br \/>\n   \/\/\u6821\u51c6\u6807\u5fd7\u4f4d&#xff1a;0&#xff1a;\u4ee3\u8868\u6210\u529f   1&#xff1a;\u4ee3\u8868\u5931\u8d25&#xff0c;\u51991\u6e05\u96f6<br \/>\n    if((ADC1-&gt;GS &amp; (1 &lt;&lt; 1)) &#061;&#061; 0)<br \/>\n    {<br \/>\n        return 1;<br \/>\n    }<br \/>\n    else<br \/>\n    {<br \/>\n        return 0;<br \/>\n    }<br \/>\n}<\/p>\n<p>\/\/ADC\u521d\u59cb\u5316<br \/>\nvoid adc1_channel_init(void)<br \/>\n{<br \/>\n    \/\/1.\u5f15\u811a\u590d\u7528<br \/>\n    IOMUXC_SetPinMux(IOMUXC_GPIO1_IO01_GPIO1_IO01,0);<br \/>\n    \/\/2.\u7535\u6c14\u5c5e\u6027<br \/>\n    IOMUXC_SetPinConfig(IOMUXC_GPIO1_IO01_GPIO1_IO01, IOMUXC_SW_PAD_CTL_PAD_PKE(1));<br \/>\n    IOMUXC_SetPinConfig(IOMUXC_GPIO1_IO01_GPIO1_IO01, IOMUXC_SW_PAD_CTL_PAD_PUE(0));<br \/>\n    \/\/3.\u914d\u7f6eADC<br \/>\n    ADC1-&gt;HC[0] &amp;&#061; ~( 1 &lt;&lt; 7); \/\/\u7981\u7528\u8f6c\u6362\u5b8c\u6210\u4e2d\u65ad<br \/>\n    ADC1-&gt;CFG &#061; 0;<br \/>\n    ADC1-&gt;CFG |&#061; (2 &lt;&lt; 2) | (3 &lt;&lt; 0); \/\/\u5206\u8fa8\u7387\u9009\u62e9 12 \u4f4d&#xff0c;\u65f6\u949f\u6e90\u9009\u62e9 ADACK<br \/>\n    ADC1-&gt;GC &#061; 0;<br \/>\n    ADC1-&gt;GC |&#061; (1 &lt;&lt; 0);  \/\/\u4f7f\u80fd ADACK \u8fd9\u4e2a\u65f6\u949f<br \/>\n    \/\/ADC\u6821\u51c6<br \/>\n    printf(adc1_calibration() ? &#034;calibration completed normally!\\\\n&#034; : &#034;calibration completed failed!\\\\n&#034;);<br \/>\n}<br \/>\n\/\/\u8bfb\u53d6ADC\u539f\u59cb\u503c<br \/>\nunsigned short adc1_get_origin_value(void)<br \/>\n{<br \/>\n    \/\/1.\u542f\u52a8ADC\u8f6c\u6362<br \/>\n    ADC1-&gt;HC[0] &#061; 0;   \/\/\u6bcf\u5207\u6362\u4e00\u6b21\u901a\u9053\u5c31\u4f1a\u5b8c\u6210\u4e00\u6b21ADC\u8f6c\u6362<br \/>\n    ADC1-&gt;HC[0] &#061; 1;<br \/>\n    \/\/2.\u7b49\u5f85ADC\u88c5\u6362\u5b8c\u6210<br \/>\n    while((ADC1-&gt;HS &amp; (1 &lt;&lt; 0)) &#061;&#061; 0);<br \/>\n    \/\/3.\u8bfb\u53d6ADC\u539f\u59cb\u503c<br \/>\n    return ADC1-&gt;R[0] &amp; 0xFFF;<br \/>\n}<br \/>\nfloat get_adc_value()<br \/>\n{<br \/>\n    \/\/\u91cf\u5316\u7ed3\u679c\u8f6c\u6362\u516c\u5f0f<br \/>\n    return ((get_adc_original_value() \/ 4096.0) * 3.3);<br \/>\n}<\/p>\n<p>\u00a0 \u901a\u8fc7\u7ed3\u679c\u770b\u5230\u5f53\u524d\u5b58\u5728\u8f83\u5927\u6ce2\u52a8&#xff0c;\u9700\u8981\u8fdb\u884c\u6ee4\u6ce2\u5904\u7406\u3002\u5e38\u7528\u7684\u6ee4\u6ce2\u65b9\u6cd5\u5305\u62ec&#xff1a;\u5747\u503c\u6ee4\u6ce2\u3001\u4f4e\u901a\u6ee4\u6ce2\u3001\u9ad8\u901a\u6ee4\u6ce2\u4ee5\u53ca\u5177\u6709\u9884\u6d4b\u6027\u7684\u5361\u5c14\u66fc\u6ee4\u6ce2\u7b49\u3002\u8fd9\u91cc\u6211\u4eec\u91c7\u7528\u5747\u503c\u6ee4\u6ce2\u7b97\u6cd5\u8fdb\u884c\u5904\u7406&#xff0c;\u5177\u4f53\u5b9e\u73b0\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u5176\u6838\u5fc3\u601d\u8def\u662f&#xff1a;\u6bcf\u6b21\u8f6c\u6362\u91c7\u6837100\u6b21\u6570\u636e&#xff0c;\u5bf9\u8fd9\u4e9b\u91c7\u6837\u503c\u8fdb\u884c\u6392\u5e8f\u540e&#xff0c;\u5254\u966410\u4e2a\u6700\u5927\u503c\u548c10\u4e2a\u6700\u5c0f\u503c&#xff0c;\u6700\u540e\u53d6\u5269\u4f59\u6570\u636e\u7684\u5e73\u5747\u503c\u4f5c\u4e3a\u6700\u7ec8\u91cf\u5316\u7ed3\u679c\u5e76\u8fdb\u884c\u8f6c\u6362\u3002<\/p>\n<p>\/\/adc.c<br \/>\n#include &#034;adc.h&#034;<br \/>\n#include &#034;MCIMX6Y2.h&#034;<br \/>\n#include &#034;core_ca7.h&#034;<br \/>\n#include &#034;fsl_iomuxc.h&#034;<\/p>\n<p>\/\/ADC\u81ea\u6821\u51c6<br \/>\nint adc1_calibration(void)<br \/>\n{<br \/>\n    ADC1-&gt;GC |&#061; (1 &lt;&lt; 7);<br \/>\n    while((ADC1-&gt;GC &amp; (1 &lt;&lt; 7)) !&#061; 0);<br \/>\n    if((ADC1-&gt;GS &amp; (1 &lt;&lt; 1)) &#061;&#061; 0)<br \/>\n    {<br \/>\n        return 1;<br \/>\n    }<br \/>\n    else<br \/>\n    {<br \/>\n        return 0;<br \/>\n    }<br \/>\n}<\/p>\n<p>\/\/ADC\u521d\u59cb\u5316<br \/>\nvoid adc1_channel_init(void)<br \/>\n{<br \/>\n    \/\/1.\u5f15\u811a\u590d\u7528<br \/>\n    IOMUXC_SetPinMux(IOMUXC_GPIO1_IO01_GPIO1_IO01,0);<br \/>\n    \/\/2.\u7535\u6c14\u5c5e\u6027<br \/>\n    IOMUXC_SetPinConfig(IOMUXC_GPIO1_IO01_GPIO1_IO01, IOMUXC_SW_PAD_CTL_PAD_PKE(1));<br \/>\n    IOMUXC_SetPinConfig(IOMUXC_GPIO1_IO01_GPIO1_IO01, IOMUXC_SW_PAD_CTL_PAD_PUE(0));<br \/>\n    \/\/3.\u914d\u7f6eADC<br \/>\n    ADC1-&gt;HC[0] &amp;&#061; ~( 1 &lt;&lt; 7);<br \/>\n    ADC1-&gt;CFG &#061; 0;<br \/>\n    ADC1-&gt;CFG |&#061; (2 &lt;&lt; 2) | (3 &lt;&lt; 0);<br \/>\n    ADC1-&gt;GC &#061; 0;<br \/>\n    ADC1-&gt;GC |&#061; (1 &lt;&lt; 0);<br \/>\n    \/\/ADC\u6821\u51c6<br \/>\n    printf(adc1_calibration() ? &#034;calibration completed normally!\\\\n&#034; : &#034;calibration completed failed!\\\\n&#034;);<br \/>\n}<br \/>\n\/\/\u8bfb\u53d6ADC\u539f\u59cb\u503c<br \/>\nunsigned short adc1_get_origin_value(void)<br \/>\n{<br \/>\n    \/\/1.\u542f\u52a8ADC\u8f6c\u6362<br \/>\n    ADC1-&gt;HC[0] &#061; 0;<br \/>\n    ADC1-&gt;HC[0] &#061; 1;<br \/>\n    \/\/2.\u7b49\u5f85ADC\u88c5\u6362\u5b8c\u6210<br \/>\n    while((ADC1-&gt;HS &amp; (1 &lt;&lt; 0)) &#061;&#061; 0);<br \/>\n    \/\/3.\u8bfb\u53d6ADC\u539f\u59cb\u503c<br \/>\n    return ADC1-&gt;R[0] &amp; 0xFFF;<\/p>\n<p>}<\/p>\n<p>\/\/\u4ea4\u6362<br \/>\nvoid swap(unsigned short *a, unsigned short *b)<br \/>\n{<br \/>\n    unsigned short t &#061; *a;<br \/>\n    *a &#061; *b;<br \/>\n    *b &#061; t;<br \/>\n}<br \/>\n\/\/\u5192\u6ce1\u6392\u5e8f<br \/>\nvoid sort(unsigned short *a, int len)<br \/>\n{<br \/>\n    int i &#061; 0;<br \/>\n    int j &#061; 0;<br \/>\n    for(i &#061; 0; i &lt; len-1; i&#043;&#043;)<br \/>\n    {<br \/>\n        for(j &#061; 0; j &lt; len &#8211; 1 -i; j&#043;&#043;)<br \/>\n        {<br \/>\n            if(a[j] &gt; a[j &#043; 1])<br \/>\n            {<br \/>\n                swap(&amp;a[j], &amp;a[j &#043; 1]);<br \/>\n            }<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\/\/ADC\u91c7\u6837\u503c\u6c42\u548c<br \/>\nunsigned int sum_of_array(unsigned short *a, int len)<br \/>\n{<br \/>\n    int i &#061;0;<br \/>\n    unsigned int sum &#061; 0;<br \/>\n    for(i &#061; 0; i &lt; len; i&#043;&#043;)<br \/>\n    {<br \/>\n        sum &#043;&#061; a[i];<br \/>\n    }<br \/>\n    return sum;<br \/>\n}<\/p>\n<p>\/\/\u8bfb\u53d6ADC\u7535\u538b\u503c<br \/>\nfloat adc1_get_value(void)<br \/>\n{<br \/>\n    unsigned short a[100];<br \/>\n    int i &#061; 0;<br \/>\n    for(i &#061; 0; i &lt; 100; i&#043;&#043;)<br \/>\n    {<br \/>\n        a[i] &#061; adc1_get_origin_value();<br \/>\n    }<br \/>\n    sort(a, sizeof(a) \/ sizeof(a[0]));<br \/>\n    return sum_of_array(a &#043; 10, 80) \/ 80 \/ 4095.0 * 3.3;<br \/>\n}<\/p>\n<p>\u2461 main.c\u00a0<\/p>\n<p>#include &#034;MCIMX6Y2.h&#034;<br \/>\n#include &#034;fsl_iomuxc.h&#034;<br \/>\n#include  &#034;led.h&#034;<br \/>\n#include  &#034;beep.h&#034;<br \/>\n#include &#034;key.h&#034;<br \/>\n#include &#034;core_ca7.h&#034;<br \/>\n#include &#034;interrupt.h&#034;<br \/>\n#include &#034;clock.h&#034;<br \/>\n#include &#034;epit.h&#034;<br \/>\n#include &#034;gpt.h&#034;<br \/>\n#include &#034;delay.h&#034;<br \/>\n#include &#034;uart.h&#034;<br \/>\n#include &#034;stdio.h&#034;<br \/>\n#include &#034;i2c.h&#034;<br \/>\n#include &#034;lm75.h&#034;<br \/>\n#include &#034;adc.h&#034;<br \/>\nint main(void)<br \/>\n{<br \/>\n    \/\/\u65f6\u949f\u521d\u59cb\u5316<br \/>\n    clock_init();<br \/>\n    \/\/GIC\u521d\u59cb\u5316<br \/>\n    system_interrupt_init();<br \/>\n    \/\/led\u521d\u59cb\u5316<br \/>\n    led_init();<br \/>\n    \/\/\u8702\u9e23\u5668beep\u521d\u59cb\u5316<br \/>\n    beep_init();<br \/>\n    \/\/\u6309\u952e\u521d\u59cb\u5316<br \/>\n    key_init();<br \/>\n    \/\/EPIT\u521d\u59cb\u5316<br \/>\n   \/\/ epit_init();<br \/>\n    \/\/GPT\u521d\u59cb\u5316<br \/>\n    gpt_init();<br \/>\n    \/\/\u4e32\u53e3uart\u521d\u59cb\u5316<br \/>\n    uart_init();<br \/>\n    \/\/I2C\u521d\u59cb\u5316<br \/>\n    i2c_init();<br \/>\n    \/\/ADC\u521d\u59cb\u5316<br \/>\n    adc1_channel_init();<br \/>\n    led_off();<br \/>\n    beep_off();<\/p>\n<p>    while (1)<br \/>\n    {<br \/>\n       short t &#061; adc1_get_origin_value();<br \/>\n        printf(&#034;origin_value:%d\\\\n&#034;, t);<br \/>\n        float f &#061; adc1_get_value();<br \/>\n        int k &#061; f * 1000;<br \/>\n        int m &#061; k \/ 1000;<br \/>\n        int n &#061; k % 1000;<br \/>\n        printf(&#034;voltage:%d.%d\\\\n&#034;, m, n);<br \/>\n    }<br \/>\n    return 0;<br \/>\n}<\/p>\n<h2 style=\"background-color:transparent\">\u4e8c\u3001SPI(\u4e32\u884c\u5916\u8bbe\u63a5\u53e3)<\/h2>\n<h3>2.1 SPI\u529f\u80fd\u4ecb\u7ecd<\/h3>\n<p><span style=\"color:#fe2c24\">\u2460 SPI&#xff08;Serial Peripheral interface&#xff09;&#xff1a;\u4e32\u884c\u5916\u8bbe\u63a5\u53e3&#xff0c;\u4e00\u79cd\u9ad8\u901f\u3001\u5168\u53cc\u5de5\u3001\u540c\u6b65\u7684\u4e32\u884c\u901a\u4fe1\u603b\u7ebf<\/span>&#xff0c;<span style=\"color:#956fe7\">\u6807\u51c6SPI\u7684\u901a\u4fe1\u901f\u7387\u4e00\u822c\u4e3a1MHz~100MHz<\/span>&#xff0c;\u5e7f\u6cdb\u5e94\u7528\u4e8eEEPROM\u3001FLASH\u5b58\u50a8\u5668\u3001\u5b9e\u65f6\u65f6\u949f\u3001AD\u8f6c\u6362\u5668\u7b49\u8bbe\u5907&#xff0c;\u4ee5\u53ca\u6570\u5b57\u4fe1\u53f7\u5904\u7406\u5668\u4e0e\u89e3\u7801\u5668\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u8be5\u63a5\u53e3\u4ec5\u9700\u5360\u7528\u82af\u7247\u7684\u56db\u6839\u5f15\u811a\u7ebf\u5373\u53ef\u5b9e\u73b0\u6570\u636e\u4f20\u8f93\u3002<\/p>\n<p><span style=\"color:#fe2c24\">\u2461\u00a0\u6807\u51c6SPI\u91c7\u7528\u56db\u7ebf\u5236\u7ec4\u7f51\u65b9\u5f0f<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"697\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803005645-6a6fe74d3f327.png\" width=\"1592\" \/><\/p>\n<\/p>\n<ul>\n<li><span style=\"color:#fe2c24\">SCLK&#xff1a;<\/span>\u65f6\u949f\u4fe1\u53f7\u7ebf\u3002\u4e0eI2C\u7c7b\u4f3c\u7684&#xff0c;\u6240\u6709\u8bbe\u5907\u90fd\u9700\u8981\u65f6\u949f\u4fe1\u53f7\u7ebf\u8fdb\u884c\u540c\u6b65&#xff0c;\u8be5\u4fe1\u53f7\u7531\u4e3b\u673a\u8d1f\u8d23\u63d0\u4f9b&#xff1b;<\/li>\n<li><span style=\"color:#fe2c24\">MOSI&#xff08;Master Output Slave Input&#xff09;&#xff1a;<\/span>\u4e3b\u51fa\u4ece\u5165&#xff0c;\u76f8\u5f53\u4e8e\u4e3b\u673a\u7684\u6570\u636e\u53d1\u9001\u7ebf&#xff1b;<\/li>\n<li><span style=\"color:#fe2c24\">MISO&#xff08;Master Input Slave Output&#xff09;&#xff1a;<\/span>\u4e3b\u5165\u4ece\u51fa&#xff0c;\u76f8\u5f53\u4e8e\u4e3b\u673a\u7684\u6570\u636e\u63a5\u6536\u7ebf&#xff1b;<\/li>\n<li><span style=\"color:#fe2c24\">CS(Slave Select\/Chip Select)&#xff1a;<\/span>\u7247\u9009\u4fe1\u53f7&#xff0c;\u4e0eI2C\u4e0d\u540c&#xff0c; SPI\u8bbe\u5907\u6ca1\u6709\u6240\u8c13\u7684\u4ece\u673a\u5730\u5740&#xff0c;\u8fde\u63a5\u5728\u603b\u7ebf\u4e0a\u7684\u8bbe\u5907\u901a\u8fc7CS\u7247\u9009\u4fe1\u53f7\u9009\u62e9\u9700\u8981\u8fdb\u884c\u901a\u4fe1\u7684\u4ece\u8bbe\u5907\u3002\u5728\u540c\u4e00\u65f6\u523b&#xff0c;\u603b\u7ebf\u4e0a\u53ea\u6709\u4e00\u4e2a\u5916\u8bbe\u88ab\u9009\u62e9&#xff0c;<span style=\"color:#fe2c24\"> CS\u4fe1\u53f7\u7ebf\u901a\u5e38\u662f\u4f4e\u7535\u5e73\u6709\u6548\u7684\u3002<\/span><\/li>\n<li><span style=\"color:#fe2c24\">\u6ce8\u610f&#xff1a;<\/span>MOSI\u548cMISO\u5e76\u975e\u5fc5\u987b\u540c\u65f6\u5b58\u5728&#xff0c;\u53ef\u4ee5\u4ec5\u4fdd\u7559MOSI\u6216MISO\u3002\u4f46\u8fd9\u79cd\u65b9\u5f0f\u4ec5\u652f\u6301\u5355\u5de5\u901a\u4fe1&#xff0c;\u6b64\u65f6SPI\u88ab\u79f0\u4e3a\u4e09\u7ebf\u5236\u3002\u5177\u4f53\u91c7\u7528\u4e09\u7ebf\u8fd8\u662f\u56db\u7ebf\u53d6\u51b3\u4e8e\u5916\u8bbe\u9700\u6c42\u3002\u4f8b\u5982&#xff0c;OLCD\u53ea\u9700\u8981\u4e3b\u673a\u53d1\u9001\u6570\u636e\u800c\u65e0\u9700\u4ece\u673a\u8fd4\u56de\u6570\u636e&#xff0c;\u56e0\u6b64\u9002\u5408\u91c7\u7528\u4e09\u7ebf\u5236SPI\u8fde\u63a5\u65b9\u5f0f\u3002<\/li>\n<\/ul>\n<p><span style=\"color:#fe2c24\">\u2462\u00a0SPI\u7684\u6570\u636e\u4f20\u8f93\u7684\u65f6\u5e8f<\/span><\/p>\n<\/p>\n<ul>\n<li><span style=\"color:#fe2c24\">\u65f6\u949f\u6781\u6027&#xff08;CPOL&#xff0c;Clock Polarity&#xff09;&#xff1a;<\/span>\u89c4\u5b9a\u4e86\u65f6\u949f\u4fe1\u53f7\u7ebf\u5728\u7a7a\u95f2\u65f6\u7684\u72b6\u6001&#xff0c; CPOL&#061;0\u8868\u793a\u65f6\u949f\u4fe1\u53f7\u7ebf\u5728\u7a7a\u95f2\u65f6\u4e3a\u4f4e\u7535\u5e73&#xff1b; CPOL&#061;1\u8868\u793a\u65f6\u949f\u4fe1\u53f7\u7ebf\u5728\u7a7a\u95f2\u662f\u4e3a\u9ad8\u7535\u5e73&#xff1b;<\/li>\n<li><span style=\"color:#fe2c24\">\u65f6\u949f\u76f8\u4f4d&#xff08;CPHA&#xff0c;Clock Phase&#xff09;&#xff1a;<\/span>\u4e0eI2C\u4e0d\u540c&#xff0c; SPI\u7684\u6570\u636e\u63a5\u6536\u65b9\u5e76\u4e0d\u662f\u5728\u65f6\u949f\u9ad8\u6216\u8005\u4f4e\u7535\u5e73\u65f6\u91c7\u6837\u7684&#xff0c;\u800c\u662f\u5728\u65f6\u949f\u4fe1\u53f7\u5904\u4e8e\u6cbf\u65f6&#xff08;\u63a5\u6536\u65b9\u5728\u7b2c\u51e0\u4e2a\u8fb9\u6cbf\u91c7\u6837\u6570\u636e&#xff09;&#xff0c;\u81f3\u4e8e\u662f\u5728\u4e0a\u5347\u6cbf\u8fd8\u662f\u4e0b\u964d\u6cbf\u53d6\u51b3\u4e8eCPHA\u3002 CPHA&#061;0\u8868\u793a\u662f\u5728\u65f6\u949f\u4fe1\u53f7\u53d8\u5316\u7684\u7b2c\u4e00\u4e2a\u6cbf\u65f6\u91c7\u6837&#xff0c;CPHA&#061;1\u8868\u793a\u662f\u5728\u65f6\u949f\u4fe1\u53f7\u53d8\u5316\u7684\u7b2c\u4e8c\u4e2a\u6cbf\u65f6\u91c7\u6837\u3002<\/li>\n<li><span style=\"color:#956fe7\">\u4f4d\u5e8f&#xff08;\u9ad8\u4f4d\u5148\u884c\/\u4f4e\u4f4d\u5148\u884c&#xff09;\u672a\u660e\u786e\u89c4\u5b9a&#xff0c;\u9ed8\u8ba4\u9ad8\u4f4dMSB\u5148\u884c\u3002<\/span><\/li>\n<li><span style=\"color:#956fe7\">SPI\u56db\u79cd\u5de5\u4f5c\u65b9\u5f0f&#xff1a;<\/span>\u5177\u4f53\u4f7f\u7528\u54ea\u79cd\u65b9\u5f0f\u662f\u7531\u5916\u8bbe\u5382\u5bb6\u89c4\u5b9a<\/li>\n<\/ul>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0CPOL &#061; 1&#xff0c;CPHA &#061; 0&#xff1a; SCLK\u7a7a\u95f2\u4e3a\u9ad8\u7535\u5e73&#xff0c; SPI\u4e0b\u964d\u6cbf\u91c7\u6837&#xff1b;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0CPOL &#061; 1&#xff0c;CPHA &#061; 1&#xff1a; SCLK\u7a7a\u95f2\u4e3a\u9ad8\u7535\u5e73&#xff0c; SPI\u4e0a\u5347\u6cbf\u91c7\u6837&#xff1b;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0CPOL &#061; 0&#xff0c;CPHA &#061; 0&#xff1a; SCLK\u7a7a\u95f2\u4e3a\u4f4e\u7535\u5e73&#xff0c; SPI\u4e0a\u5347\u6cbf\u91c7\u6837&#xff1b;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0CPOL &#061; 0&#xff0c;CPHA &#061; 1&#xff1a; SCLK\u7a7a\u95f2\u4e3a\u4f4e\u7535\u5e73&#xff0c; SPI\u4e0b\u964d\u6cbf\u91c7\u6837&#xff1b;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"971\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803005645-6a6fe74dbd890.png\" width=\"1424\" \/><\/p>\n<ul><\/ul>\n<p><span style=\"color:#fe2c24\">\u2463 SPI\u8bfb\u5199\u7279\u6027&#xff1a;\u5199\u5373\u662f\u8bfb&#xff0c; \u8bfb\u5373\u662f\u5199<\/span><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color:#fe2c24\">\u00a0SPI\u662f\u5168\u53cc\u5de5\u79fb\u4f4d\u901a\u4fe1&#xff1a;<\/span>\u8bfb\u5199\u65f6\u5e8f\u53ef\u4ee5\u4e00\u8d77\u5b8c\u6210\u3002\u4e3b\u4ece\u4e24\u4fa7\u5404\u6709\u4e00\u4e2a\u79fb\u4f4d\u5bc4\u5b58\u5668\u3002\u6bcf\u4e2a\u65f6\u949f\u6cbf\u5230\u6765\u65f6&#xff0c;\u4e3b\u673a\u901a\u8fc7 MOSI \u5f80\u5916\u201c\u79fb\u51fa\u201d1\u4f4d&#xff0c;\u540c\u65f6\u4ece MISO \u201c\u79fb\u5165\u201d1\u4f4d\u3002\u4e5f\u5c31\u662f\u2014\u6bcf\u201c\u5199\u201d\u4e00\u4f4d\u7684\u540c\u65f6\u5fc5\u7136\u201c\u8bfb\u201d\u5230\u4e00\u4f4d\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color:#fe2c24\">\u00a0\u5199\u5373\u662f\u8bfb&#xff1a;<\/span>\u4f60\u5f80\u603b\u7ebf\u201c\u5199\u201d\u4e00\u4e2a\u5b57\u8282&#xff08;\u79fb\u51fa8\u4f4d&#xff09;&#xff0c;\u540c\u4e00\u8fc7\u7a0b\u91cc\u4e5f\u4f1a\u201c\u8bfb\u201d\u56de\u4ece\u673a\u5728MISO\u4e0a\u76848\u4f4d&#xff08;\u53ef\u80fd\u662f\u65e0\u6548\/\u5360\u4f4d\u5b57\u8282&#xff09;\u3002<\/p>\n<p>\u00a0\u00a0\u00a0<span style=\"color:#fe2c24\">\u00a0\u00a0\u00a0\u00a0\u00a0\u8bfb\u5373\u662f\u5199&#xff1a;<\/span>\u4f60\u60f3\u4ece\u4ece\u673a\u201c\u8bfb\u201d\u6570\u636e&#xff0c;\u5fc5\u987b\u63d0\u4f9b\u65f6\u949f&#xff0c;\u6240\u4ee5\u4e3b\u673a\u5fc5\u987b\u540c\u65f6\u201c\u5199\u201d\u51fa\u4e00\u4e2a\u5360\u4f4d\u5b57\u8282&#xff08;\u901a\u5e38\u662f0xFF\u62160x00&#xff09;&#xff0c;\u7528\u8fd9\u4e9b\u65f6\u949f\u628a\u4ece\u673a\u7684\u6570\u636e\u201c\u79fb\u5165\u201d\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color:#fe2c24\">\u4e3b\u673a\u5199&#xff1a;<\/span>\u4e3b\u673a\u901a\u8fc7MOSI\u53d1\u9001\u5bc4\u5b58\u5668\u5730\u5740 -&gt; \u4e3b\u673a\u901a\u8fc7MOSI\u53d1\u9001\u6570\u636e-&gt; \u4ece\u673a\u901a\u8fc7MISO\u56de\u590d\u6570\u636e<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color:#fe2c24\">\u4e3b\u673a\u8bfb&#xff1a;<\/span>\u4e3b\u673a\u901a\u8fc7MOSI\u53d1\u9001\u5bc4\u5b58\u5668\u5730\u5740 -&gt; \u4e3b\u673a\u901a\u8fc7MOSI\u53d1\u9001dummy(0x00 ~ 0xFF) -&gt; \u4ece\u673a\u901a\u8fc7MISO\u56de\u590d\u4f20\u611f\u5668\u6570\u636e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1112\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803005646-6a6fe74e29225.png\" width=\"1629\" \/><\/p>\n<p><span style=\"color:#fe2c24\">\u2464\u00a0SPI \u4e0e I2C \u7684\u533a\u522b<\/span><\/p>\n<p><span style=\"color:#956fe7\">&#xff08;1&#xff09;\u63a5\u53e3\u7ebf\u6570<\/span><\/p>\n<ul>\n<li>I2C&#xff1a;\u56fa\u5b9a\u4f7f\u7528\u4e24\u6839\u7ebf&#xff08;SCL \u65f6\u949f\u7ebf&#xff0c;SDA \u6570\u636e\u7ebf&#xff09;<\/li>\n<li>SPI&#xff1a;\u901a\u5e38\u4f7f\u7528\u4e09\u7ebf\u6216\u56db\u7ebf&#xff08;SCLK \u65f6\u949f\u7ebf&#xff0c;CS \u7247\u9009\u7ebf&#xff0c;MOSI \u4e3b\u51fa\u4ece\u5165&#xff0c;MISO \u4e3b\u5165\u4ece\u51fa&#xff09;<\/li>\n<\/ul>\n<p><span style=\"color:#956fe7\">&#xff08;2&#xff09;\u5bfb\u5740\u65b9\u5f0f<\/span><\/p>\n<ul>\n<li>I2C&#xff1a;\u901a\u8fc7\u4e03\u4f4d\u4ece\u673a\u5730\u5740\u5bf9\u4ece\u673a\u8fdb\u884c\u5bfb\u5740<\/li>\n<li>SPI&#xff1a;\u901a\u8fc7\u5c06\u5bf9\u5e94\u7684\u7247\u9009(CS)\u7535\u5e73\u62c9\u4f4e\u62c9\u9009\u62e9\u4e0e\u54ea\u4e2a\u4ece\u673a\u8fdb\u884c\u901a\u4fe1<\/li>\n<\/ul>\n<p><span style=\"color:#956fe7\">&#xff08;3&#xff09;\u901a\u4fe1\u901f\u7387<\/span><\/p>\n<ul>\n<li>I2C&#xff1a;\u6807\u51c6\u6a21\u5f0f100Kbps&#xff0c;\u9ad8\u901f\u6a21\u5f0f400Kbps<\/li>\n<li>SPI&#xff1a;\u901f\u7387\u53ef\u8fbeMHz\u7ea7\u522b&#xff0c;\u901a\u5e38\u4e3a\u51e0\u5341\u81f3\u51e0\u767eMHz<\/li>\n<\/ul>\n<p><span style=\"color:#956fe7\">&#xff08;4&#xff09;\u901a\u4fe1\u7279\u6027<\/span><\/p>\n<ul>\n<li>I2C&#xff1a;\u534a\u53cc\u5de5\u3001\u540c\u6b65\u3001\u4e32\u884c\u901a\u4fe1<\/li>\n<li>SPI&#xff1a;\u5168\u53cc\u5de5\u3001\u540c\u6b65\u3001\u4e32\u884c\u901a\u4fe1<\/li>\n<\/ul>\n<h3>2.2\u00a0IMX6ULL \u7684 SPI \u6a21\u5757<\/h3>\n<p>\u2460 I.MX6ULL \u81ea\u5e26\u7684 SPI \u5916\u8bbe\u53eb\u505a ECSPI&#xff0c;\u5168\u79f0\u662f Enhanced Configurable Serial Peripheral Interface\u3002 ECSPI \u6709 64*32 \u4e2a\u63a5\u6536FIFO(RXFIFO)\u548c 64*32 \u4e2a\u53d1\u9001 FIFO(TXFIFO)\u3002<\/p>\n<p>\u2461 I.MX6ULL \u7684 ECSPI \u53ef\u4ee5\u5de5\u4f5c\u5728\u4e3b\u6a21\u5f0f\u6216\u4ece\u6a21\u5f0f&#xff0c;\u6211\u4eec\u4f7f\u7528\u4e3b\u6a21\u5f0f&#xff0c; I.MX6ULL \u6709 4 \u4e2aECSPI&#xff0c;\u6bcf\u4e2a ECSPI \u652f\u6301\u56db\u4e2a\u7247\u9009\u4fe1\u53f7<br \/>\n<span style=\"color:#fe2c24\">\u2462\u00a0ECSPI \u7684\u4e3b\u8981\u7279\u6027\u5305\u62ec&#xff1a;<\/span><\/p>\n<ul>\n<li>\u5168\u53cc\u5de5\u540c\u6b65\u4e32\u884c\u63a5\u53e3<\/li>\n<li>\u53ef\u914d\u7f6e\u4e3a\u4e3b\u673a\/\u4ece\u673a\u6a21\u5f0f<\/li>\n<li>\u56db\u4e2a\u7247\u9009&#xff08;SS&#xff09;\u4fe1\u53f7&#xff0c;\u652f\u6301\u591a\u4e2a\u5916\u8bbe<\/li>\n<li>\u4f20\u8f93\u7ee7\u7eed\u529f\u80fd\u5141\u8bb8\u8fdb\u884c\u65e0\u957f\u5ea6\u9650\u5236\u7684\u6570\u636e\u4f20\u8f93<\/li>\n<li>\u53d1\u9001\u548c\u63a5\u6536\u6570\u636e\u5747\u914d\u5907 32 \u4f4d\u5bbd\u300164 \u9879\u7684 FIFO&#xff08;\u5148\u8fdb\u5148\u51fa&#xff09;<\/li>\n<li>\u7247\u9009&#xff08;SS&#xff09;\u548c SPI \u65f6\u949f&#xff08;SCLK&#xff09;\u7684\u6781\u6027\u548c\u76f8\u4f4d\u53ef\u914d\u7f6e<\/li>\n<li>\u652f\u6301\u76f4\u63a5\u5185\u5b58\u8bbf\u95ee&#xff08;DMA&#xff09;<\/li>\n<li>\u6700\u9ad8\u5de5\u4f5c\u9891\u7387\u53ef\u8fbe\u53c2\u8003\u65f6\u949f\u9891\u7387<\/li>\n<\/ul>\n<p>\u2463 \u65f6\u949f\u9009\u62e9&#xff1a;\u4ece\u65f6\u949f\u6811\u53ef\u4ee5\u770b\u51fa&#xff0c; ECSPI\u65f6\u949f\u6e90\u662fpll3_sw_clk &#061; 480MHz&#xff0c;\u7ecf\u8fc7\u4e00<br \/>\n\u4e2a8\u5206\u9891\u7684\u9759\u6001\u5206\u9891\u5668&#xff0c;\u5b9e\u9645\u5de5\u4f5c\u9891\u7387\u662f60MHz&#xff1b;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color:#fe2c24\">\u00a0\u00a0\u6ce8\u610f&#xff1a;<\/span>PRE_DIVIDER\u548cPOST_DIVIDER\u8fd9\u4e24\u4e2a\u5206\u914d\u5668\u51b3\u5b9a\u4e86SPI\u6700\u7ec8\u7684\u65f6\u949f&#xff0c;\u7531\u4e8e\u9ed8\u8ba4\u60c5\u51b5\u4e0bSPI\u7684\u65f6\u949f\u6765\u6e90\u4e8epll3_sw_clk\u76848\u5206\u9891\u5373480M\/8&#061;60MHz&#xff0c;\u5982\u679c\u9700\u8981SPI\u65f6\u949f\u4fe1\u53f7\u4e3a1MHz&#xff0c;\u5219\u53ef\u5c06POST_DIVIDER\u8bbe\u7f6e\u4e3a4\u5206\u9891&#xff0c;60\/4&#061;15MHz,\u518d\u5c0615M\u8fdb\u884c15\u5206\u9891&#xff0c;<\/p>\n<p>15MHz\/15&#061;1MHz\u3002<br \/>\n<span style=\"color:#fe2c24\">\u2464\u00a0\u91cd\u70b9\u5bc4\u5b58\u5668\u4ecb\u7ecd<\/span><\/p>\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:651px\">\n<tbody>\n<tr>\u5bc4\u5b58\u5668\u5168\u79f0\u4f5c\u7528\u4f4d\u8bf4\u660e<\/tr>\n<tr>\n<td style=\"width:142px\">ECSPIx_RXDATA<\/td>\n<td style=\"width:101px\">Receive Data Register<\/td>\n<td style=\"width:52px\">\u63a5\u53d7\u6570\u636e\u5bc4\u5b58\u5668<\/td>\n<td style=\"width:160px\">ECSPI_RXDATA<\/td>\n<td style=\"width:148px\">32\u4f4d&#xff0c;\u8bfb\u53d6\u53ca\u5b58\u53d6 ECSPIx_RXDATA\u91cc\u9762\u7684\u6570\u636e\u5c31\u53ef\u4ee5\u5f97\u5230<br \/>\n\u521a\u521a\u63a5\u6536\u5230\u7684\u6570\u636e<br \/>\n\u00a0<\/td>\n<\/tr>\n<tr>\n<td style=\"width:142px\">ECSPIx_TXDATA<\/td>\n<td style=\"width:101px\">Transmit Data Register<\/td>\n<td style=\"width:52px\">\u53d1\u9001\u6570\u636e\u5bc4\u5b58\u5668<\/td>\n<td style=\"width:160px\">ECSPIx_TXDATA<\/td>\n<td style=\"width:148px\">32\u4f4d&#xff0c;\u53d1\u9001\u6570\u636e\u5c31\u5411\u5bc4\u5b58\u5668 ECSPIx_TXDATA \u5199\u5165\u6570\u636e<br \/>\n\u00a0<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"7\" style=\"width:142px\">ECSPIx_CONREG<\/td>\n<td colspan=\"1\" rowspan=\"7\" style=\"width:101px\">Control Register<\/td>\n<td colspan=\"1\" rowspan=\"7\" style=\"width:52px\">\u63a7\u5236\u5bc4\u5b58\u5668<\/td>\n<td style=\"width:160px\">BURST_LENGTH(b20-b31)<\/td>\n<td style=\"width:148px\">\n<p>\u6570\u636e\u957f\u5ea6\u4f4d&#xff1a;\u6bcf\u6b21\u4f20\u8f93\u4e00\u5b57\u8282\u7684\u8bdd\u5c31\u8bbe\u7f6e\u4e3a7<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:160px\">CHANNEL_SELECT(b18-b19)<\/td>\n<td style=\"width:148px\">\n<p>\u901a\u9053\u9009\u62e9\u4f4d<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 00&#xff1a;\u901a\u90530<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 01&#xff1a;\u901a\u90531<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 10&#xff1a;\u901a\u90532<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 11&#xff1a;\u901a\u90533<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:160px\">PRE_DIVIDER(b12-b15)<\/td>\n<td style=\"width:148px\">\n<p>SPI \u9884\u5206\u9891<\/p>\n<p>ECSPI \u65f6\u949f\u9891\u7387\u4f7f\u7528\u4e24\u6b65\u6765\u5b8c\u6210\u5206\u9891&#xff0c;\u6b64\u4f4d\u8bbe\u7f6e\u7684\u662f\u7b2c\u4e00\u6b65,\u53ef\u8bbe\u7f6e 0~15&#xff0c;\u5206\u522b\u5bf9\u5e94 1~16 \u5206\u9891\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:160px\">POST_DIVIDER(b8-b11)<\/td>\n<td style=\"width:148px\">\n<p>SPI \u5206\u9891\u503c<\/p>\n<p>ECSPI \u65f6\u949f\u9891\u7387\u7684\u7b2c\u4e8c\u6b65\u5206\u9891\u8bbe\u7f6e<\/p>\n<p>\u5206\u9891\u503c\u4e3a 2^ POST_DIVIDER<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:160px\">CHANNEL_MODE(b4-b7)<\/td>\n<td style=\"width:148px\">SPI \u901a\u9053\u4e3b\/\u4ece\u6a21\u5f0f\u8bbe\u7f6e,CHANNEL_MODE[3:0]\u5206\u522b\u5bf9\u5e94 SPI\u901a\u9053 3~0&#xff0c;\u4e3a 0 \u7684\u8bdd\u5c31\u662f\u8bbe\u7f6e\u4e3a\u4ece\u6a21\u5f0f&#xff0c;\u5982\u679c\u4e3a 1 \u7684\u8bdd\u5c31\u662f\u4e3b\u6a21\u5f0f\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"width:160px\">SMC(b3)<\/td>\n<td style=\"width:148px\">\u5f00\u59cb\u6a21\u5f0f\u63a7\u5236&#xff0c;\u6b64\u4f4d\u53ea\u80fd\u5728\u4e3b\u6a21\u5f0f\u4e0b\u8d77\u4f5c\u7528&#xff0c;\u4e3a 0 \u7684\u8bdd\u901a\u8fc7 XCH \u4f4d\u6765\u5f00\u542f SPI\u7a81\u53d1\u8bbf\u95ee&#xff0c;\u4e3a 1 \u7684\u8bdd\u53ea\u8981\u5411 TXFIFO \u5199\u5165\u6570\u636e\u5c31\u5f00\u542f SPI \u7a81\u53d1\u8bbf\u95ee&#xff1b;<\/td>\n<\/tr>\n<tr>\n<td style=\"width:160px\">EN(b0)<\/td>\n<td style=\"width:148px\">SPI \u4f7f\u80fd\u4f4d&#xff0c;\u4e3a 0 \u7684\u8bdd\u5173\u95ed SPI&#xff0c;\u4e3a 1 \u7684\u8bdd\u4f7f\u80fd SPI<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"4\" style=\"width:142px\">ECSPIx_CONFIGREG<\/td>\n<td colspan=\"1\" rowspan=\"4\" style=\"width:101px\">Config Register<\/td>\n<td colspan=\"1\" rowspan=\"4\" style=\"width:52px\">\u914d\u7f6e\u5bc4\u5b58\u5668<\/td>\n<td style=\"width:160px\">SCLK_CTL(b20-b23)<\/td>\n<td style=\"width:148px\">\n<p>\u8bbe\u7f6e SCLK \u4fe1\u53f7\u7ebf\u7a7a\u95f2\u72b6\u6001\u7535\u5e73<\/p>\n<p>SCLK_CTL[3:0]\u5206\u522b\u5bf9\u5e94\u901a\u9053 3 ~0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e3a 0 \u7684\u8bdd SCLK \u7a7a\u95f2\u72b6\u6001\u4e3a\u4f4e\u7535\u5e73<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e3a 1 \u7684\u8bdd SCLK \u7a7a\u95f2\u72b6\u6001\u4e3a\u9ad8\u7535\u5e73<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:160px\">SS_POL(b12-b15)<\/td>\n<td style=\"width:148px\">\n<p>\u8bbe\u7f6e SPI \u7247\u9009\u4fe1\u53f7\u6781\u6027\u8bbe\u7f6e<\/p>\n<p>SS_POL[3:0]\u5206\u522b\u5bf9\u5e94\u901a\u9053 3~0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e3a 0 \u7684 \u8bdd\u7247\u9009\u4fe1\u53f7\u4f4e\u7535\u5e73\u6709\u6548<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e3a 1 \u7684\u8bdd\u7247\u9009\u4fe1\u53f7\u9ad8\u7535\u5e73\u6709\u6548<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:160px\">SCLK_POL(b4-b7)<\/td>\n<td style=\"width:148px\">SPI \u65f6\u949f\u4fe1\u53f7\u6781\u6027\u8bbe\u7f6e&#xff0c;\u4e5f\u5c31\u662f CPOL&#xff0c;SCLK_POL[3:0]\u5206\u522b\u5bf9\u5e94\u901a\u9053 3~0&#xff0c;\u4e3a 0 \u7684\u8bdd SCLK \u9ad8\u7535\u5e73\u6709\u6548(\u7a7a\u95f2\u7684\u65f6\u5019\u4e3a\u4f4e\u7535\u5e73)&#xff0c;\u4e3a 1 \u7684\u8bdd SCLK \u4f4e\u7535\u5e73\u6709\u6548(\u7a7a\u95f2\u7684\u65f6\u5019\u4e3a\u9ad8\u7535\u5e73)&#xff1b;<\/td>\n<\/tr>\n<tr>\n<td style=\"width:160px\">SCLK_PHA()<\/td>\n<td style=\"width:148px\">SPI\u65f6\u949f\u76f8\u4f4d\u8bbe\u7f6e&#xff0c;\u4e5f\u5c31\u662fCPHA&#xff0c; SCLK_PHA[3:0]\u5206\u522b\u5bf9\u5e94\u901a\u90533~0&#xff0c;\u4e3a 0 \u7684\u8bdd\u4e32\u884c\u65f6\u949f\u7684\u7b2c\u4e00\u4e2a\u8df3\u53d8\u6cbf(\u4e0a\u5347\u6cbf\u6216\u4e0b\u964d\u6cbf)\u91c7\u96c6\u6570\u636e&#xff0c;\u4e3a 1 \u7684\u8bdd\u4e32\u884c\u65f6\u949f\u7684\u7b2c\u4e8c\u4e2a\u8df3\u53d8\u6cbf(\u4e0a\u5347\u6cbf\u6216\u4e0b\u964d\u6cbf)<br \/>\n\u91c7\u96c6\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"2\" style=\"width:142px\">ECSPIx_STATREG<\/td>\n<td colspan=\"1\" rowspan=\"2\" style=\"width:101px\">Status Register<\/td>\n<td colspan=\"1\" rowspan=\"2\" style=\"width:52px\">\u72b6\u6001\u5bc4\u5b58\u5668<\/td>\n<td style=\"width:160px\">RR(b3)<\/td>\n<td style=\"width:148px\">\n<p>RXFIFO \u5c31\u7eea\u6807\u5fd7\u4f4d<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e3a 0 \u7684\u8bdd RXFIFO \u6ca1\u6709\u6570\u636e<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e3a 1 \u7684\u8bdd\u8868\u793a RXFIFO \u4e2d \u81f3\u5c11\u6709\u4e00\u4e2a\u5b57\u7684\u6570\u636e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:160px\">TE(b0)<\/td>\n<td style=\"width:148px\">TXFIFO \u7a7a\u6807\u5fd7\u4f4d&#xff0c;\u4e3a 0 \u8868\u793a TXFIFO \u4e2d\u81f3\u5c11\u6709\u4e00\u4e2a\u5b57\u7684\u6570\u636e&#xff0c;\u4e3a 1 \u8868\u793a TXFIFO\u4e3a\u7a7a<br \/>\n\u00a0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>2.3\u00a0IMX6ULL \u4f7f\u7528 SPI\u00a0\u4e0eADXL345 \u901a\u4fe1<\/h3>\n<p><span style=\"color:#fe2c24\">\u00a0\u2460\u00a0ADXL345\u662f\u4e00\u6b3e\u4e09\u8f74\u52a0\u901f\u5ea6\u4f20\u611f\u5668<\/span>&#xff0c;\u4e3b\u8981\u7279\u70b9\u5982\u4e0b&#xff1a;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u27a2 \u6d4b\u91cf\u8303\u56f4&#xff1a; \u00b12g\u3001 \u00b14g\u3001 \u00b18g\u3001<span style=\"color:#956fe7\"> \u00b116g<\/span>\u8bbe\u7f6e&#xff1b;<span style=\"color:#956fe7\">1g &#061; 9.8m\/s^2<\/span><br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u27a2 <span style=\"color:#956fe7\">\u5206\u8fa8\u7387&#xff1a;\u6700\u9ad813\u4f4d&#xff08;3.9mg\/LSB&#xff09;&#xff1b;0 &#8211; 2^13-1<\/span><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u27a2 \u7075\u654f\u5ea6&#xff1a;32 \/ (2^13 &#8211; 1) &#061; 32\/8191 &#061; 0.0039 &#061; 3.9mg<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u27a2 <span style=\"color:#956fe7\">\u5de5\u4f5c\u7535\u538b&#xff1a; 2.0V\u81f33.6V&#xff1b;<\/span><br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u27a2 \u4f4e\u529f\u8017&#xff1a;\u6d4b\u91cf\u6a21\u5f0f\u4ec50.23mA&#xff0c;\u5f85\u673a\u6a21\u5f0f40\u03bcA&#xff1b;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u27a2 \u6838\u5fc3\u529f\u80fd&#xff1a; 1\u3001\u4e09\u8f74\u52a0\u901f\u5ea6\u6d4b\u91cf&#xff08;X\u3001 Y\u3001 Z&#xff09;&#xff1b; 2\u3001\u9759\u6001\u91cd\u529b\u52a0\u901f\u5ea6\u6d4b\u91cf&#xff1b; 3\u3001\u52a8\u6001\u52a0\u901f\u5ea6&#xff08;\u9707\u52a8\u3001\u8fd0\u52a8&#xff09;\u6d4b\u91cf&#xff1b; 4\u3001\u81ea\u7531\u843d\u4f53\u68c0\u6d4b&#xff1b; 5\u3001\u5355\u51fb\/\u53cc\u51fb\u68c0\u6d4b&#xff1b; 6\u3001\u6d3b\u52a8\/\u975e\u6d3b\u52a8\u76d1\u6d4b&#xff1b;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u27a2 \u63a5\u53e3\u652f\u6301&#xff1a; SPI&#xff08;3\u7ebf\u548c4\u7ebf\u6a21\u5f0f&#xff09;\u3001 I2C\u6570\u5b57\u63a5\u53e3<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u27a2 \u7279\u8272\u529f\u80fd&#xff1a; 1\u3001\u5185\u7f6e32\u7ea7FIFO\u7f13\u51b2&#xff1b; 2\u3001\u53ef\u7f16\u7a0b\u4e2d\u65ad\u529f\u80fd&#xff1b; 3\u3001\u81ea\u52a8\u4f11\u7720\u548c\u5524\u9192\u529f\u80fd&#xff1b;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u27a2 \u5e94\u7528\u573a\u666f&#xff1a; 1\u3001\u79fb\u52a8\u8bbe\u5907\u65b9\u5411\u68c0\u6d4b&#xff1b; 2\u3001\u6e38\u620f\u548c\u865a\u62df\u73b0\u5b9e\u63a7\u5236\u5668&#xff1b; 3\u3001\u8fd0\u52a8\u68c0\u6d4b\u548c\u8ba1\u6b65\u5668&#xff1b; 4\u3001\u9632\u76d7\u7cfb\u7edf\u7684\u8fd0\u52a8\u68c0\u6d4b&#xff1b; 5\u3001\u5de5\u4e1a\u632f\u52a8\u76d1\u6d4b&#xff1b; 6\u3001\u533b\u7597\u8bbe\u5907\u59ff\u6001\u68c0\u6d4b<\/p>\n<p>\u2461\u00a0\u901a\u4fe1\u65f6\u5e8f\u5982\u4e0b\u56fe&#xff0c;\u91c7\u7528\u56db\u7ebf\u5236SPI\u3002\u53ef\u89c1ADXL345\u91c7\u7528\u7684\u662fSPI\u901a\u4fe1\u6a21\u5f0f3&#xff0c;\u5373<span style=\"color:#956fe7\">CPOL&#061;1.CPHA&#061;1<\/span>\u3002\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\u4e00\u4e2a\u7ec6\u8282&#xff0c;<span style=\"color:#956fe7\"> ADXL345\u5728\u5411\u5bc4\u5b58\u5668\u5199\u5165\u548c\u8bfb\u53d6\u65f6&#xff0c;\u5bc4\u5b58\u5668\u7684\u6700\u9ad8\u4f4d\u662f\u4e0d\u4e00\u6837\u7684&#xff0c;\u8bfb\u7684\u65f6\u5019\u6700\u9ad8\u4f4d\u4e3a1&#xff0c;\u5199\u7684\u65f6\u5019\u6700\u9ad8\u4f4d\u4e3a0\u3002<\/span>\u4f8b\u5982\u5199\u6570\u636e\u52300x20\u5bc4\u5b58\u5668\u65f6&#xff0c;\u5148\u53d10x20\u518d\u53d1\u8981\u5199\u5165\u7684\u6570\u636e&#xff1b;\u8bfb\u53d6\u65f6\u5219\u9700\u8981\u5148\u53d10xA0&#xff0c;\u4e4b\u540e\u8fdb\u5165\u8bfb\u53d6\u65f6\u5e8f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"896\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803005646-6a6fe74ed4f0c.png\" width=\"1481\" \/><\/p>\n<p>\u2462 spi.c<\/p>\n<p>\/\/spi.c<br \/>\n#include &#034;spi.h&#034;<br \/>\n#include &#034;MCIMX6Y2.h&#034;<br \/>\n#include &#034;core_ca7.h&#034;<br \/>\n#include &#034;fsl_iomuxc.h&#034;<br \/>\n\/\/SPI\u521d\u59cb\u5316<br \/>\nvoid spi3_init(void)<br \/>\n{<br \/>\n    \/\/1.\u5f15\u811a\u590d\u7528<br \/>\n    IOMUXC_SetPinMux(IOMUXC_UART2_RX_DATA_ECSPI3_SCLK, 0);<br \/>\n    IOMUXC_SetPinMux(IOMUXC_UART2_RTS_B_ECSPI3_MISO, 0);<br \/>\n    IOMUXC_SetPinMux(IOMUXC_UART2_CTS_B_ECSPI3_MOSI, 0);<br \/>\n    IOMUXC_SetPinMux(IOMUXC_UART2_TX_DATA_GPIO1_IO20,0);<br \/>\n    \/\/2.\u7535\u6c14\u5c5e\u6027<br \/>\n    IOMUXC_SetPinConfig(IOMUXC_UART2_RX_DATA_ECSPI3_SCLK, 0x10B1);<br \/>\n    IOMUXC_SetPinConfig(IOMUXC_UART2_RTS_B_ECSPI3_MISO, 0x10B1);<br \/>\n    IOMUXC_SetPinConfig(IOMUXC_UART2_CTS_B_ECSPI3_MOSI, 0x10B1);<br \/>\n    IOMUXC_SetPinConfig(IOMUXC_UART2_TX_DATA_GPIO1_IO20, 0x10B1);<br \/>\n    \/\/3.\u901a\u4fe1\u524d&#xff0c;\u5148\u5c06CS\u62c9\u9ad8<br \/>\n    GPIO1-&gt;GDIR |&#061; (1 &lt;&lt; 20);<br \/>\n    GPIO1-&gt;DR |&#061; (1 &lt;&lt; 20); \/\/\u8f93\u51fa<br \/>\n    \/\/4.\u914d\u7f6eCONREG<br \/>\n    ECSPI3-&gt;CONREG &#061; 0;<br \/>\n    ECSPI3-&gt;CONREG |&#061; (7 &lt;&lt; 20) | (0x0E &lt;&lt; 12) | (2 &lt;&lt; 8) | (1 &lt;&lt; 4) | (1 &lt;&lt; 3);<br \/>\n    \/\/5.\u914d\u7f6eCONFIGREG<br \/>\n    ECSPI3-&gt;CONFIGREG &#061; 0;<br \/>\n    ECSPI3-&gt;CONFIGREG |&#061; (1 &lt;&lt; 20) | (1 &lt;&lt; 4) | (1 &lt;&lt; 0);<br \/>\n    \/\/6.\u4f7f\u80fdSPI<br \/>\n   ECSPI3-&gt;CONREG |&#061; (1 &lt;&lt; 0);<br \/>\n}<br \/>\n\/\/SPI\u8bfb\u5199\u51fd\u6570<br \/>\nunsigned int spi3_read_write(unsigned int data)<br \/>\n{<br \/>\n    while((ECSPI3-&gt;STATREG &amp;&#061; (1 &lt;&lt; 0)) &#061;&#061; 0); \/\/\u7b49\u5f85\u6570\u636e\u53d1\u9001\u5b8c\u6210<br \/>\n    ECSPI3-&gt;TXDATA &#061; data;<br \/>\n    while ((ECSPI3-&gt;STATREG &amp;&#061; (1 &lt;&lt; 3)) &#061;&#061; 0); \/\/\u7b49\u5f85\u6570\u636e\u63a5\u53d7\u5b8c\u6210<br \/>\n    return ECSPI3-&gt;RXDATA ;<br \/>\n}<\/p>\n<p>\u2463 adxl345.c<\/p>\n<p>\/\/adxl345.c<br \/>\n#include &#034;adxl345.h&#034;<br \/>\n#include &#034;spi.h&#034;<br \/>\n#include &#034;MCIMX6Y2.h&#034;<\/p>\n<p>\/\/ adxl345\u5199<br \/>\nvoid adxl345_write(unsigned char reg_address, unsigned char data)<br \/>\n{<br \/>\n    \/\/ 1. \u7247\u9009\u62c9\u4f4e<br \/>\n    GPIO1-&gt;DR &amp;&#061; ~(1 &lt;&lt; 20);<br \/>\n    \/\/ 2. \u53d1\u9001\u5bc4\u5b58\u5668\u5730\u5740<br \/>\n    spi3_read_write(reg_address);<br \/>\n    \/\/ 3. \u53d1\u9001\u5199\u5165\u7684\u6570\u636e<br \/>\n    spi3_read_write(data);<br \/>\n    \/\/ 4. \u7247\u9009\u62c9\u9ad8<br \/>\n    GPIO1-&gt;DR |&#061; (1 &lt;&lt; 20);<br \/>\n}<\/p>\n<p>\/\/ adxl345\u8bfb<br \/>\nunsigned char adxl345_read(unsigned char reg_address)<br \/>\n{<br \/>\n    unsigned char ret &#061; 0;<\/p>\n<p>     \/\/ 1. \u7247\u9009\u62c9\u4f4e<br \/>\n    GPIO1-&gt;DR &amp;&#061; ~(1 &lt;&lt; 20);<br \/>\n    \/\/ 2. \u53d1\u9001\u5bc4\u5b58\u5668\u5730\u5740<br \/>\n    spi3_read_write(reg_address | 0x80);<br \/>\n    \/\/ 3. \u53d1\u9001\u5360\u4f4d\u5b57\u8282<br \/>\n    ret &#061; spi3_read_write(0xFF);<br \/>\n    \/\/ 4. \u7247\u9009\u62c9\u9ad8<br \/>\n    GPIO1-&gt;DR |&#061; (1 &lt;&lt; 20);<\/p>\n<p>    return ret;<br \/>\n}<\/p>\n<p>\/\/adxl345\u521d\u59cb\u5316<br \/>\nvoid adxl345_init(void)<br \/>\n{<br \/>\n    \/\/\u5173\u95ed\u4e2d\u65ad<br \/>\n    adxl345_write(0x2E, 0x08);<br \/>\n    \/\/\u6ee1\u5206\u8fa8\u7387 13\u4f4d<br \/>\n    adxl345_write(0x31, 0x0B);<br \/>\n    \/\/\u901f\u738725HZ<br \/>\n    adxl345_write(0x2C, 0x08);<br \/>\n    \/\/\u5de5\u4f5c\u6a21\u5f0f<br \/>\n    adxl345_write(0x2D, 0x0B);<br \/>\n}<\/p>\n<p>struct ADXL345_Data adxl345_get_value(void)<br \/>\n{<br \/>\n    struct ADXL345_Data ret;<br \/>\n    \/\/X\u8f74\u6570\u636e<br \/>\n    ret.x &#061; adxl345_read(0x32);<br \/>\n    ret.x |&#061; adxl345_read(0x33) &lt;&lt; 8;<br \/>\n    \/\/y\u8f74\u6570\u636e<br \/>\n    ret.y &#061; adxl345_read(0x34);<br \/>\n    ret.y |&#061; adxl345_read(0x35) &lt;&lt; 8;<br \/>\n    \/\/z\u8f74\u6570\u636e<br \/>\n    ret.z &#061; adxl345_read(0x36);<br \/>\n    ret.z |&#061; adxl345_read(0x37) &lt;&lt; 8;<br \/>\n    \/\/\u52a0\u901f\u5ea6<br \/>\n    ret.xg &#061; ret.x * 0.0039;<br \/>\n    ret.yg &#061; ret.y * 0.0039;<br \/>\n    ret.zg &#061; ret.z * 0.0039;<br \/>\n    return ret;<br \/>\n}<br \/>\n\/\/adxl345.h<br \/>\n#ifndef __ADXL345_H__<br \/>\n#define __ADXL345_H__<br \/>\nstruct ADXL345_Data<br \/>\n{<br \/>\n    short x;<br \/>\n    short y;<br \/>\n    short z;<br \/>\n    float xg;<br \/>\n    float yg;<br \/>\n    float zg;<br \/>\n};<br \/>\nextern void adxl345_write(unsigned char reg_address, unsigned char data);<br \/>\nextern unsigned char adxl345_read(unsigned char reg_address);<br \/>\nextern void adxl345_init(void);<br \/>\nextern struct ADXL345_Data adxl345_get_value(void);<br \/>\n#endif <\/p>\n<p>\u2464 main.c<\/p>\n<p>#include &#034;MCIMX6Y2.h&#034;<br \/>\n#include &#034;fsl_iomuxc.h&#034;<br \/>\n#include  &#034;led.h&#034;<br \/>\n#include  &#034;beep.h&#034;<br \/>\n#include &#034;key.h&#034;<br \/>\n#include &#034;core_ca7.h&#034;<br \/>\n#include &#034;interrupt.h&#034;<br \/>\n#include &#034;clock.h&#034;<br \/>\n#include &#034;epit.h&#034;<br \/>\n#include &#034;gpt.h&#034;<br \/>\n#include &#034;delay.h&#034;<br \/>\n#include &#034;uart.h&#034;<br \/>\n#include &#034;stdio.h&#034;<br \/>\n#include &#034;i2c.h&#034;<br \/>\n#include &#034;lm75.h&#034;<br \/>\n#include &#034;adc.h&#034;<br \/>\n#include &#034;spi.h&#034;<br \/>\n#include &#034;adxl345.h&#034;<br \/>\nint main(void)<br \/>\n{<br \/>\n    \/\/\u65f6\u949f\u521d\u59cb\u5316<br \/>\n    clock_init();<br \/>\n    \/\/GIC\u521d\u59cb\u5316<br \/>\n    system_interrupt_init();<br \/>\n    \/\/led\u521d\u59cb\u5316<br \/>\n    led_init();<br \/>\n    \/\/\u8702\u9e23\u5668beep\u521d\u59cb\u5316<br \/>\n    beep_init();<br \/>\n    \/\/\u6309\u952e\u521d\u59cb\u5316<br \/>\n    key_init();<br \/>\n    \/\/EPIT\u521d\u59cb\u5316<br \/>\n   \/\/ epit_init();<br \/>\n    \/\/GPT\u521d\u59cb\u5316<br \/>\n    gpt_init();<br \/>\n    \/\/\u4e32\u53e3uart\u521d\u59cb\u5316<br \/>\n    uart_init();<br \/>\n    \/\/I2C\u521d\u59cb\u5316<br \/>\n    i2c_init();<br \/>\n    \/\/ADC\u521d\u59cb\u5316<br \/>\n    adc1_channel_init();<br \/>\n    \/\/SP\u521d\u59cb\u5316<br \/>\n    spi3_init();<br \/>\n    led_off();<br \/>\n    beep_off();<br \/>\n   \/\/ unsigned char t &#061; adxl345_read(0x00);<br \/>\n   \/\/ printf(&#034;adxl345_ID:%x\\\\n&#034;, t);<\/p>\n<p>    while (1)<br \/>\n    {<br \/>\n        struct ADXL345_Data t &#061; adxl345_get_value();<br \/>\n       \/\/ printf(&#034;x:%d y:%d z:%d\\\\n&#034;, t.x, t.y, t.z);<br \/>\n       int i, j, k;<br \/>\n        i &#061; t.xg * 10;<br \/>\n        j &#061; t.yg * 10;<br \/>\n        k &#061; t.zg * 10;<br \/>\n        printf(&#034;x_accel:%d.%d y_accel:%d.%d z_accel:%d.%d\\\\n&#034;, i \/ 10, i % 10, j \/ 10, j % 10, k \/ 10, k % 10);<br \/>\n        delay_ms(1000);<br \/>\n    }<br \/>\n    return 0;<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001ADC&#xff08;\u6a21\u6570\u8f6c\u6362\u5668&#xff09;1.1 ADC\u529f\u80fd\u4ecb\u7ecd\u2460 ADC&#xff08;Analog-to-Digital Converter&#xff09;&#xff0c;\u6a21\u62df\u5230\u6570\u5b57\u8f6c\u6362\u5668&#xff0c;\u7528\u4e8e\u5c06\u8fde\u7eed\u53d8\u5316\u7684\u6a21\u62df\u4fe1\u53f7\u8f6c\u6362\u4e3a\u79bb\u6563\u7684\u6570\u5b57\u4fe1\u53f7&#xff0c;\u4ee5\u4fbf\u6570\u5b57\u7cfb\u7edf&#xff08;\u5982\u5fae\u5904\u7406\u5668\u3001\u5fae\u63a7\u5236\u5668\u7b49&#xff09;\u80fd\u591f\u5bf9\u5176\u8fdb\u884c\u5904\u7406\u548c\u5206\u6790\u3002\u2461 \u6a21\u62df\u4fe1\u53f7\u4e00\u822c\u662f\u6307\u8fde\u7eed\u53d8\u5316\u7684\u7535\u538b\u4fe1\u53f7&#xff0c;\u5176\u6570\u503c\u5728\u4e00\u5b9a\u8303\u56f4\u5185\u53d8\u5316\u3002\u800c\u6570\u5b57\u4fe1\u53f7\u662f\u7531\u4e00\u7cfb\u5217\u79bb\u6563\u7684\u6570\u5b57\u8868\u793a<\/p>\n","protected":false},"author":2,"featured_media":89548,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[174,58,103,270,269],"topic":[],"class_list":["post-89555","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c","tag-linux","tag-ubuntu","tag-270","tag-269"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>ARM06-ADC\uff08\u6a21\u6570\u8f6c\u6362\u5668\uff09\u548c SPI(\u4e32\u884c\u5916\u8bbe\u63a5\u53e3) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/89555.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ARM06-ADC\uff08\u6a21\u6570\u8f6c\u6362\u5668\uff09\u548c SPI(\u4e32\u884c\u5916\u8bbe\u63a5\u53e3) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001ADC&#xff08;\u6a21\u6570\u8f6c\u6362\u5668&#xff09;1.1 ADC\u529f\u80fd\u4ecb\u7ecd\u2460 ADC&#xff08;Analog-to-Digital Converter&#xff09;&#xff0c;\u6a21\u62df\u5230\u6570\u5b57\u8f6c\u6362\u5668&#xff0c;\u7528\u4e8e\u5c06\u8fde\u7eed\u53d8\u5316\u7684\u6a21\u62df\u4fe1\u53f7\u8f6c\u6362\u4e3a\u79bb\u6563\u7684\u6570\u5b57\u4fe1\u53f7&#xff0c;\u4ee5\u4fbf\u6570\u5b57\u7cfb\u7edf&#xff08;\u5982\u5fae\u5904\u7406\u5668\u3001\u5fae\u63a7\u5236\u5668\u7b49&#xff09;\u80fd\u591f\u5bf9\u5176\u8fdb\u884c\u5904\u7406\u548c\u5206\u6790\u3002\u2461 \u6a21\u62df\u4fe1\u53f7\u4e00\u822c\u662f\u6307\u8fde\u7eed\u53d8\u5316\u7684\u7535\u538b\u4fe1\u53f7&#xff0c;\u5176\u6570\u503c\u5728\u4e00\u5b9a\u8303\u56f4\u5185\u53d8\u5316\u3002\u800c\u6570\u5b57\u4fe1\u53f7\u662f\u7531\u4e00\u7cfb\u5217\u79bb\u6563\u7684\u6570\u5b57\u8868\u793a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/89555.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-03T00:56:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803005644-6a6fe74c73c17.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/89555.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/89555.html\",\"name\":\"ARM06-ADC\uff08\u6a21\u6570\u8f6c\u6362\u5668\uff09\u548c SPI(\u4e32\u884c\u5916\u8bbe\u63a5\u53e3) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-03T00:56:48+00:00\",\"dateModified\":\"2026-08-03T00:56:48+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/89555.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/89555.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/89555.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ARM06-ADC\uff08\u6a21\u6570\u8f6c\u6362\u5668\uff09\u548c SPI(\u4e32\u884c\u5916\u8bbe\u63a5\u53e3)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ARM06-ADC\uff08\u6a21\u6570\u8f6c\u6362\u5668\uff09\u548c SPI(\u4e32\u884c\u5916\u8bbe\u63a5\u53e3) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/89555.html","og_locale":"zh_CN","og_type":"article","og_title":"ARM06-ADC\uff08\u6a21\u6570\u8f6c\u6362\u5668\uff09\u548c SPI(\u4e32\u884c\u5916\u8bbe\u63a5\u53e3) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001ADC&#xff08;\u6a21\u6570\u8f6c\u6362\u5668&#xff09;1.1 ADC\u529f\u80fd\u4ecb\u7ecd\u2460 ADC&#xff08;Analog-to-Digital Converter&#xff09;&#xff0c;\u6a21\u62df\u5230\u6570\u5b57\u8f6c\u6362\u5668&#xff0c;\u7528\u4e8e\u5c06\u8fde\u7eed\u53d8\u5316\u7684\u6a21\u62df\u4fe1\u53f7\u8f6c\u6362\u4e3a\u79bb\u6563\u7684\u6570\u5b57\u4fe1\u53f7&#xff0c;\u4ee5\u4fbf\u6570\u5b57\u7cfb\u7edf&#xff08;\u5982\u5fae\u5904\u7406\u5668\u3001\u5fae\u63a7\u5236\u5668\u7b49&#xff09;\u80fd\u591f\u5bf9\u5176\u8fdb\u884c\u5904\u7406\u548c\u5206\u6790\u3002\u2461 \u6a21\u62df\u4fe1\u53f7\u4e00\u822c\u662f\u6307\u8fde\u7eed\u53d8\u5316\u7684\u7535\u538b\u4fe1\u53f7&#xff0c;\u5176\u6570\u503c\u5728\u4e00\u5b9a\u8303\u56f4\u5185\u53d8\u5316\u3002\u800c\u6570\u5b57\u4fe1\u53f7\u662f\u7531\u4e00\u7cfb\u5217\u79bb\u6563\u7684\u6570\u5b57\u8868\u793a","og_url":"https:\/\/www.wsisp.com\/helps\/89555.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-03T00:56:48+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803005644-6a6fe74c73c17.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"11 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/89555.html","url":"https:\/\/www.wsisp.com\/helps\/89555.html","name":"ARM06-ADC\uff08\u6a21\u6570\u8f6c\u6362\u5668\uff09\u548c SPI(\u4e32\u884c\u5916\u8bbe\u63a5\u53e3) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-03T00:56:48+00:00","dateModified":"2026-08-03T00:56:48+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/89555.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/89555.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/89555.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"ARM06-ADC\uff08\u6a21\u6570\u8f6c\u6362\u5668\uff09\u548c SPI(\u4e32\u884c\u5916\u8bbe\u63a5\u53e3)"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/89555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=89555"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/89555\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/89548"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=89555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=89555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=89555"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=89555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}