ååã¯ããœãããŠã§ã¢ãããã¡ãŒã ãŠã§ã¢ã¬ãã«ãŸã§éšåçã«åé€ããããã¹ãããã³ã°ã¢ãŒã¿ãŒçšã®ãã«ã¹ãçæãããªãã·ã§ã³ãæ€èšããŸããã å®å šã«æåããå Žåãããã«ãããæ倧40 KHzã®åšæ³¢æ°ã§å°çããå²ã蟌ã¿ãåŠçããå¿ èŠããªããªããŸãã ãããããã®ãªãã·ã§ã³ã«ã¯ããã€ãã®æãããªæ¬ é¥ããããŸãã ãŸããå éã¯ãµããŒããããŠããŸããã 次ã«ããã®ãœãªã¥ãŒã·ã§ã³ã®èš±å®¹ã¹ãããåšæ³¢æ°ã®ç²åºŠã¯æ°çŸãã«ãã§ãïŒããšãã°ã40,000 Hzãš39966 Hzã®åšæ³¢æ°ãçæããããšã¯å¯èœã§ãããããã2ã€ã®å€ã®éã®å€§ããã®åšæ³¢æ°ãçæããããšã¯äžå¯èœã§ãïŒã
é«éåã®å®è£
ã·ã¹ãã ãè€éã«ããããšãªããåãUDBããŒã«ã䜿çšããŠãããã®æ¬ ç¹ãæé€ããããšã¯å¯èœã§ããïŒ æ£ããããŸãããã æãå°é£ãªãã®ããå§ããŸããã-å éã å éã¯ãã¹ã®æåãšæåŸã«è¿œå ãããŸãã ãŸããã¹ãããã³ã°ã¢ãŒã¿ãŒã«é«åšæ³¢ãã«ã¹ãããã«å°å ãããšãåäœãéå§ããããã«ãã倧ããªé»æµãå¿ èŠã«ãªããŸãã é«èš±å®¹é»æµã¯å ç±ãšãã€ãºã§ãããããå¶éããããšããå§ãããŸãã ãã ãããšã³ãžã³ã¯éå§æã«ã¹ããããã¹ãããã§ããŸãã ãã®ããããšã³ãžã³ãã¹ã ãŒãºã«å éããããšããå§ãããŸãã 第äºã«ãéãé ãçªç¶åæ¢ãããšãæ £æ§ã«é¢é£ããéæž¡çŸè±¡ãçºçããŸãã ãã©ã¹ããã¯ã«æ³¢ãèŠããŸãã ãããã£ãŠãåæ£ããã ãã§ãªããé ãæ¢ããããšãã¹ã ãŒãºã«å¿ èŠã§ãã åŸæ¥ããšã³ãžã³é床ã®ã°ã©ãã¯å°åœ¢ã§è¡šç€ºãããŸãã 以äžã¯ãMarlinãã¡ãŒã ãŠã§ã¢ã®ãœãŒã¹ã³ãŒãã®äžéšã§ãã
UDBã䜿çšããŠãããå®è£ ããããšãå¯èœãã©ãããææ¡ããããšã¯ããŸããã ããã¯ãå¥ã®çš®é¡ã®å éãçŸåšæµè¡ããŠãããšããäºå®ã«ãããã®ã§ããå°åœ¢ã§ã¯ãªããSã«ãŒãã§ãã ã¹ã±ãžã¥ãŒã«ã¯æ¬¡ã®ããã«ãªããŸãã
ããã¯ééããªãUDBã«ã¯åœãŠã¯ãŸããŸããã ãããããŸããïŒ ãŸã£ãããªãïŒ UDBã«ã¯ããŒããŠã§ã¢ã€ã³ã¿ãŒãã§ã€ã¹ãå®è£ ãããŠãããããœãããŠã§ã¢ã®ã³ãŒãã®äžéšããã¡ãŒã ãŠã§ã¢ã¬ãã«ã«è»¢éããã ãã§ããããšã¯æ¢ã«èª¬æããŸããã ãããã¡ã€ã«ã§CPUãèšç®ãããšãã¹ããããã«ã¹ã®åœ¢æã«ããUDBãå®è¡ãããŸãã äžå€®åŠçè£ çœ®ã¯èšç®ã«å€ãã®æéãè²»ãããŠããŸãã é »ç¹ãªäžæããªãããšããã¿ã¹ã¯ã¯åŒãç¶ãéåžžã«æŽç·Žããããã®ã§ããããã¡ãŒã ãŠã§ã¢ã¬ãã«ãŸã§ããã»ã¹ãå®å šã«åé€ããäºå®ã¯ãããŸããã
ãã¡ããããããã¡ã€ã«ãã¡ã¢ãªã«æºåããå¿ èŠããããUDBã¯DMAã䜿çšããŠããããããŒã¿ãååŸããŸãã ããããã©ã®ãããã®ã¡ã¢ãªãå¿ èŠã§ããïŒ 1ããªã«ã¯200ã¹ããããå¿ èŠã§ãã 24ããããšã³ã³ãŒãã£ã³ã°ã§ã¯ãããã¯1 mmã®é ã®åãã«ã€ã600ãã€ãã§ãïŒ ç¹°ãè¿ãã«ãªããŸããããã¹ãŠããã©ã°ã¡ã³ãã§éä¿¡ããããã«é »ç¹ã«ã§ã¯ãªããåžžã«äžæããããšãèŠããŠããŸããïŒ ããã§ããªãïŒ å®éãPSoCã®DMAã¡ã«ããºã ã¯èšè¿°åã«åºã¥ããŠããŸãã 1ã€ã®èšè¿°åããã¿ã¹ã¯ãå®è¡ãããšãDMAã³ã³ãããŒã©ãŒã¯æ¬¡ã®èšè¿°åã«é²ã¿ãŸãã ãããã£ãŠããã§ãŒã³ã«æ²¿ã£ãŠãå€ãã®èšè¿°åã䜿çšã§ããŸãã å ¬åŒææžããã®ããã€ãã®å³é¢ã§ããã説æããŸãã
å®éããã®ã¡ã«ããºã ã¯ã3ã€ã®èšè¿°åã®ãã§ãŒã³ãæ§ç¯ããããšã§ã䜿çšã§ããŸãã
ãã | 解説 |
---|---|
1 | ã¡ã¢ãªããFIFOã«ã¢ãã¬ã¹å¢åã§ã å éãããã¡ã€ã«ã®ããã»ã¯ã·ã§ã³ã瀺ããŸãã |
2 | ã¢ãã¬ã¹ã€ã³ã¯ãªã¡ã³ããªãã§ã¡ã¢ãªããFIFOãžã äžå®ã®é床ã®ããã«ãã¡ã¢ãªå ã®åãã¯ãŒãã«åžžã«éä¿¡ããŸãã |
3 | ã¡ã¢ãªããFIFOã«ã¢ãã¬ã¹å¢åã§ã ãã¬ãŒããããã¡ã€ã«ã®ããã»ã¯ã·ã§ã³ã瀺ããŸãã
|
ã¡ã€ã³ãã¹ã¯ã¹ããã2ã§èª¬æãããŠãããç©ççã«åãåèªã䜿çšãããäžå®ã®é床ãèšå®ãããŠããããšãããããŸãã ã¡ã¢ãªæ¶è²»ã¯å€§ãããããŸããã å®éã«ã¯ã2çªç®ãŸãã¯3ã€ã®èšè¿°åã§2çªç®ã®èšè¿°åãç©ççã«è¡šãããšãã§ããŸãã ããã¯ãTRMã«ãããšãæ倧ãã³ãé·ã64ãããã€ãã«ãªãå¯èœæ§ãããããã§ãïŒä¿®æ£ã¯ããå°ãªããªããŸãïŒã ã€ãŸãã32,767ã¯ãŒãã§ãã 1ããªã¡ãŒãã«ããã200ã¹ãããã®å Žåã163ããªã¡ãŒãã«ã®çµè·¯ã«å¯Ÿå¿ããŸãã ãšã³ãžã³ãäžåºŠã«ç§»åã§ããæ倧è·é¢ã«å¿ããŠã2ã€ãŸãã¯3ã€ã®éšåã®ã»ã°ã¡ã³ããäœæããå¿ èŠãããå ŽåããããŸãã
ããã§ããã¡ã¢ãªïŒããã³UDBãããã¯ã®æ¶è²»ïŒãç¯çŽããããã«ã24ãããã®DatapPathãããã¯ãæŸæ£ããããçµæžçãª16ãããã®ãããã¯ã«åãæ¿ããããšãææ¡ããŸãã
ã ããã æ¹èšã®æåã®ææ¡ã
ã¹ãããã®ç¶ç¶æéããšã³ã³ãŒãããé åãã¡ã¢ãªã«æºåãããŸãã ããã«ããã®æ å ±ã¯DMAã䜿çšããŠUDBã«éä¿¡ãããŸãã çŽç·ã»ã¯ã·ã§ã³ã¯1ã€ã®èŠçŽ ã®é åã«ãã£ãŠãšã³ã³ãŒããããDMAãããã¯ã¯ã¢ãã¬ã¹ãå¢ããããåžžã«åãèŠçŽ ãéžæããŸãã å éãçŽç·ãããã³å¶åã®åã»ã¯ã·ã§ã³ã¯ãDMAã³ã³ãããŒã©ãŒã§å©çšå¯èœãªæ段ã«ãã£ãŠæ¥ç¶ãããŸãã
ãããã¬ã³ãžã®åŸ®èª¿æŽ
ããã§ãåšæ³¢æ°ç²åºŠã®åé¡ãå æããæ¹æ³ãæ€èšããŸãã ãã¡ãããæ£ç¢ºã«èšå®ããããšã¯ã§ããŸããã ããããå®éã«ã¯ãå ã®ããã¡ãŒã ãŠã§ã¢ãã§ããããè¡ãããšã¯ã§ããŸããã 代ããã«ãBresenhamã¢ã«ãŽãªãºã ã䜿çšããŸãã äžéšã®ã¹ãããã«1å°ç¯ã®é 延ãè¿œå ãããŸãã ãã®çµæãå¹³ååšæ³¢æ°ã¯ãããå°ããªå€ãšãã倧ããªå€ã®éã®äžéã«ãªããŸãã å®æçæéãšå»¶é·æéã®æ¯çã調æŽããããšã«ãããå¹³åé »åºŠãã¹ã ãŒãºã«å€æŽã§ããŸãã é床ãããŒã¿ã¬ãžã¹ã¿ã§ã¯ãªãFIFOãä»ããŠéä¿¡ããããã«ã¹æ°ãDMAãä»ããŠéä¿¡ãããã¯ãŒãæ°ãä»ããŠèšå®ãããå ŽåãUDBã®äž¡æ¹ã®ããŒã¿ã¬ãžã¹ã¿ã解æŸãããŸãã ããã«ããã«ã¹æ°ãã«ãŠã³ãããããããªãŒã®1ã€ã解æŸãããŸãã ããã§ã¯ããããã«ç¹å®ã®PWMãæ§ç¯ããŸãã
éåžžãALUã¯åãã€ã³ããã¯ã¹ãæã€ã¬ãžã¹ã¿ãæ¯èŒããŠå²ãåœãŠãŸãã 1ã€ã®ã¬ãžã¹ã¿ã®ã€ã³ããã¯ã¹ã0ã§ããã1ã€ã®ã¬ãžã¹ã¿ã®ã€ã³ããã¯ã¹ã1ã®å Žåããã¹ãŠã®æäœãªãã·ã§ã³ãå®è£ ã§ããããã§ã¯ãããŸããã ããããç§ã¯ã¬ãžã¹ã¿ãããœãªãã£ã¢ããŸãšããPWMãå®è¡ããããšãã§ããŸããã å³ã®ããã«ãªããŸããã
æ¡ä»¶A0 <D1ãæºãããããšãæå®ããããã«ã¹é·ã«è¿œå ã®ããŒããè¿œå ãããŸãã æ¡ä»¶ãæºããããªãå Žåãæã ã¯ããŸããã
éåžžã®ç¶æ ã§ã®çç¶ã®éŠ¬
ãã®ãããæ°ããã¢ãŒããã¯ãã£ãèæ ®ããŠãUDBçšã«éçºããããããã¯ã®å€æŽãéå§ããŸãã ããŒã¿ãã¹ã®ããã深床ã眮ãæããŸãã
ååãããå€ãã®Datapathããã®åºå£ãå¿ èŠã«ãªããŸãã
ããããããã«ã¯ãªãã¯ãããšã詳现ã衚瀺ãããŸãã
Stateå€æ°ã«ã¯ããã«æ°åããããŸããå€ãæ°åãæ¥ç¶ããããšãå¿ããªãã§ãã ãã!!! å€ãããŒãžã§ã³ã§ã¯ãå®æ°0ããããŸããã
ç§ããã®ããã«ãªã£ããªãŒãããã³ã®é·ç§»ã°ã©ãïŒ
FIFO1ã空ã®éã ã¢ã€ãã«ç¶æ ã«ãªããŸãã ã¡ãªã¿ã«ãFIFO0ã§ã¯ãªãFIFO1ã§äœæ¥ããã®ã¯ããœãªãã£ã¢ããŸãã«åœ¢æãããçµæã§ãã ã¬ãžã¹ã¿A0ã¯PWMã®å®è£ ã«äœ¿çšãããããããã«ã¹å¹ ã¯ã¬ãžã¹ã¿A1ã«ãã£ãŠæ±ºå®ãããŸãã ãããŠãç§ã¯FIFO1ããã®ã¿ããŠã³ããŒãã§ããŸãïŒä»ã®ç§å¯ã®æ¹æ³ããããããããŸãããããããã¯ç§ã«ã¯ç¥ãããŠããŸããïŒã ãããã£ãŠãDMAã¯ããŒã¿ãFIFO1ã«æ£ç¢ºã«ã¢ããããŒããã ã¢ã€ãã«ç¶æ ãçµäºããã®ã¯FIFO1ã®ãŸãã«ã空ã§ã¯ãªããç¶æ ã§ãã
IDLEç¶æ ã®ALUã¯ã¬ãžã¹ã¿A0ãç¡å¹ã«ããŸãã
ããã¯ãPWMåäœã®éå§æã«åžžã«æåããäœæ¥ãéå§ããããã«å¿ èŠã§ãã
ããããããŒã¿ã¯FIFOã«å ¥ããŸããã ãã·ã³ã¯LoadDataç¶æ ã«ãªããŸãã
ãã®ç¶æ ã§ã¯ãALUã¯æ¬¡ã®ã¯ãŒããFIFOããã¬ãžã¹ã¿A1ã«ããŒãããŸãã éäžã§ãäžå¿ èŠãªç¶æ ãäœæããªãããã«ãPWMãæäœããããã«äœ¿çšãããã«ãŠã³ã¿ãŒA0ã®å€ãå¢å ããŸãã
ã«ãŠã³ã¿A0ããŸã å€D0ã«éããŠããªãå ŽåïŒã€ãŸããæ¡ä»¶A0 <D0ãããªã¬ãŒãããNoNeedReloadA0ãã©ã°ãèšå®ãããŠããå ŽåïŒã Oneç¶æ ã«ç§»è¡ããŸãã ãã以å€ã®å Žåã ClearA0ç¶æ ã«ãªããŸãã
ClearA0ç¶æ ã§ã¯ã ALUã¯åã«A0ã®å€ããŒãã«ããæ°ããPWMãµã€ã¯ã«ãéå§ããŸãã
ãã®åŸããã·ã³ã1ç¶æ ã«ãªãã1ããŒãåŸã«ãªããŸãã
1ã€ã¯ãå€ãããŒãžã§ã³ã®ãã·ã³ããç§ãã¡ã«ããç¥ãããŠããŸãã ãã®äžã®ALUã¯æ©èœãå®è¡ããŸããã
ãããã£ãŠããã®ç¶æ ã§ã¯ã Out_Stepã®åºåã§ãŠããããçæãããŸãïŒããã§ã¯ãæ¡ä»¶ã«ãã£ãŠãŠããããçæããããšãã«ãªããã£ãã€ã¶ãŒãããŸãæ©èœããããã¯çµéšçã«æ€åºãããŸããïŒã
ãã§ã«ããã£ãŠãã7ãããã«ãŠã³ã¿ãŒããŒãã«ãªã»ããããããŸã§ããã®ç¶æ ã«ãªããŸãã ãããã以åã«1ã€ã®ãã¹ã«æ²¿ã£ãŠãã®ç¶æ ãæããå ŽåãããŒããžã®çŽæ¥ãã¹ãšé 延ãã¹ã®2ã€ã®ãã¹ãå¯èœã«ãªããŸãã
æ¡ä»¶A0 <D1ãæºããããã«å²ãåœãŠãããŠããAddCycleãã©ã°ãèšå®ãããŠããå ŽåãExtraTickç¶æ ã«ãªããŸãã ãã®ç¶æ ã§ã¯ãALUã¯æçãªã¢ã¯ã·ã§ã³ãå®è¡ããŸããã ãµã€ã¯ã«ã1ããŒãé·ããªãã ãã§ãã ããã«ããã¹ãŠã®ãã¹ã¯é 延ç¶æ ã§åæããŸãã
ãã®æ¡ä»¶ã¯ããã«ã¹ã®æç¶æéã枬å®ããŸãã ã¬ãžã¹ã¿A1ïŒããŒãç¶æ ã®ãŸãŸããŒããããïŒã¯ããŒãã«éãããŸã§æžå°ããŸãã
ããã«ãFIFOã«è¿œå ããŒã¿ããããã©ããã«å¿ããŠããã·ã³ã¯ããŒãç¶æ ãŸãã¯ã¢ã€ãã«ç¶æ ã®æ¬¡ã®éšåã®ãã§ããã«åãæ¿ãããŸãã ããã¯å³ã§ã¯ãªãïŒé·ãç¢å°ãããããã¹ãŠãå°ãããªããŸãïŒãããŒãã«ã®åœ¢ã§ã é 延ç¶æ ãããã«ã¯ãªãã¯ããŠèŠãŠã¿ãŸãããïŒ
UDBãçµäºããŸãã ãªããã£ãã€ã¶ãŒãæè¯ã®çµæã瀺ããããã ã¢ã€ãã«ç¶æ ã®ãã©ã°ãéåææ¯èŒã«å€æããŸããïŒä»¥åã®ããŒãžã§ã³ã§ã¯ãããŸããŸãªç¶æ ã§ããªã¬ãŒããã³ãªã»ãããããããªã¬ãŒããããŸããïŒã ããã«ã ãã³ã°ãªãŒãã©ã°ãè¿œå ãããããŒã¿ãåä¿¡ããæºåãã§ããããšãDMAãŠãããã«éç¥ããŸãã ãFIFO1ã¯æ··éããŠããŸããããšãããã©ã°ã«ãŸãšããããŠããŸãã æ··éããŠããªãå ŽåãDMAã¯æ¬¡ã®ããŒã¿ã¯ãŒããããã«ããŒãã§ããŸãã
èªåéšåã«ã€ããŠ-ããã ãã§ãã
ã¡ã€ã³ãããžã§ã¯ãå³ã«DMAãããã¯ãè¿œå ããŸãã åœåã®éãDMAçµäºãã©ã°ã®å²ã蟌ã¿ãéå§ããŸãããããããæ£ãããšããäºå®ã§ã¯ãããŸããã ã¡ã¢ãªãžã®çŽæ¥ã¢ã¯ã»ã¹ã®ããã»ã¹ãå®äºãããšãåãã»ã°ã¡ã³ãã«é¢é£ããæ°ããããã»ã¹ãéå§ã§ããŸãããæ°ããã»ã°ã¡ã³ãã«é¢ããæ å ±ã®å ¥åãéå§ããããšã¯ã§ããŸããã FIFOã«ã¯ããŸã 3ã4åã®èŠçŽ ããããŸãã çŸæç¹ã§ã¯ãUDBã«åºã¥ããŠãããã¯ã®ã¬ãžã¹ã¿D0ããã³D1ãåããã°ã©ã ããããšã¯ãŸã äžå¯èœã§ãããããã¯æäœã«å¿ èŠã§ãã ãããã£ãŠã Out_Idleåºåã«åºã¥ãå²ã蟌ã¿ãåŸã§è¿œå ãããå¯èœæ§ããããŸãã ãã ãããã®ãããã³ã¯UDBãããã¯ããã°ã©ãã³ã°ãšã¯é¢ä¿ãªããããããã§ã¯èšåããŸãã
ãœãããŠã§ã¢å®éš
ä»ã§ã¯ãã¹ãŠãããã£ãŠããªãã®ã§ãç¹å¥ãªé¢æ°ã¯äœæããŸããã ãã¹ãŠã®ãã§ãã¯ã¯ãé¡ã«ãå®è¡ãããŸãã 次ã«ãæåããå®éšã«åºã¥ããŠãAPIé¢æ°ãäœæã§ããŸãã ã ããã mainïŒïŒé¢æ°ãæå°éã«ããŸãã 圌女ã¯ã·ã¹ãã ãã»ããã¢ããããéžæãããã¹ããåŒã³åºããŸãã
int main(void) { CyGlobalIntEnable; /* Enable global interrupts. */ // isr_1_StartEx(StepperFinished); StepperController_X_Start(); StepperController_Y_Start(); StepperController_Z_Start(); StepperController_E0_Start(); StepperController_E1_Start(); // TestShortSteps(); TestWithPacking (); for(;;) { }
é¢æ°ãåŒã³åºããŠãè¿œå ã®ãã«ã¹ãæ¿å ¥ããããšã確èªããŠããã«ã¹ã®ãã±ãããéä¿¡ããŠã¿ãŸãããã é¢æ°åŒã³åºãã¯ç°¡åã§ãïŒ
TestShortSteps();
ããããäœã«ã¯èª¬æãå¿ èŠã§ãã
æåã«æ©èœå
šäœãæäŸããŸã
void TestShortSteps() { // , // // , DMA !!! // , !!! StepperController_X_SingleVibrator_WritePeriod (6); // // â CY_SET_REG16(StepperController_X_Datapath_1_D0_PTR, 4); CY_SET_REG16(StepperController_X_Datapath_1_D1_PTR, 2); // . // static const uint16 steps[] = { 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001, 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001 }; // DMA , uint8 channel = DMA_X_DmaInitialize (sizeof(steps[0]),1,HI16(steps),HI16(StepperController_X_Datapath_1_F1_PTR)); CyDmaChRoundRobin (channel,true); // , uint8 td = CyDmaTdAllocate(); // . , . CyDmaTdSetConfiguration(td, sizeof(steps), CY_DMA_DISABLE_TD, TD_INC_SRC_ADR | TD_AUTO_EXEC_NEXT); // CyDmaTdSetAddress(td, LO16((uint32)steps), LO16((uint32)StepperController_X_Datapath_1_F1_PTR)); // CyDmaChSetInitialTd(channel, td); // CyDmaChEnable(channel, 1); }
次ã«ãéèŠãªéšåãæ€èšããŸãã
ãã«ã¹ã®æ£ã®éšåã®é·ãã92ã¯ããã¯ãµã€ã¯ã«ã«çããå Žåããªã·ãã¹ã³ãŒãã¯è² ã®éšåã«ã·ã³ã°ã«ãµã€ã¯ã«æ¿å ¥ããããã©ãããèå¥ã§ããŸããã ã¹ã±ãŒã«ã¯åãã§ã¯ãããŸããã åèšãã«ã¹ãæ¿å ¥ãããããŒããšã¹ã±ãŒã«ã§æ¯èŒã§ããããã«ãæ£ã®éšåãã§ããã ãçãããå¿ èŠããããŸãã ãããã£ãŠããã«ã¹ã®æ£ã®éšåã®æç¶æéãèšå®ããã«ãŠã³ã¿ãŒã®åšæã匷å¶çã«å€æŽããŸãã
// , // // , DMA !!! // , !!! StepperController_X_SingleVibrator_WritePeriod (6);
ãããããªã6ã€ã®å šäœçãªå¯Ÿçãããã®ã§ããããïŒ ãªã3ã€ã§ã¯ãªãã®ã§ããïŒ ãªã2ã€ã§ã¯ãªãã®ã§ããïŒ çµå±ã®ãšããã1ã€ã§ã¯ãªãã®ã¯ãªãã§ããïŒ ããã¯æ²ãã話ã§ãã æ£ã®ãã«ã¹ã6ãµã€ã¯ã«ããçãå Žåãã·ã¹ãã ã¯æ©èœããŸããã ãã¹ãã©ã€ã³ãå€éšã«åºåãããªã·ãã¹ã³ãŒãã§ã®é·æéã®ãããã°ã§ã¯ãDMAã¯é«éã§ã¯ãªãããšã瀺ãããŸããã ãã·ã³ãäžå®ã®æéããçãæéåäœããŠããå Žåã é 延ç¶æ ããæãåºããŸã§ã«ãFIFOã¯ã»ãšãã©ã®å Žå空ã®ãŸãŸã§ãã ãŸã 1ã€ã®æ°ããããŒã¿ã¯ãŒããé 眮ãããŠããªãå¯èœæ§ããããŸãã ãããŠããã«ã¹ã®æ£ã®éšåã®æç¶æéã6ãµã€ã¯ã«ã§ããå Žåã«ã®ã¿ãFIFOã¯ããŒãããæéãããããšãä¿èšŒãããŸã...
é 延è±ç·
ç§ã®é ã®äžã«ããå¥ã®ä¿®æ£æ¡ã¯ãRTOS MAXã®ã«ãŒãã«ã®ç¹å®ã®æ©èœã®ããŒããŠã§ã¢ã¢ã¯ã»ã©ã¬ãŒã·ã§ã³ã§ãã ããããæ²ããããªããããã®åãã¬ã€ãã³ã·ãŒã«é¢ããç§ã®æé«ã®ã¢ã€ãã¢ã¯ãã¹ãŠå£ããŠããŸãã
ã±ãŒã¹ããããCyclone V SoCã®ãã¢ã¡ã¿ã«ã¢ããªã±ãŒã·ã§ã³ã®éçºãç 究ããŸããã ããããåäžã®FPGAã¬ãžã¹ã¿ã䜿çšããŠïŒäº€äºã«æžã蟌ã¿ãèªã¿åããè¡ãïŒå Žåãã³ã¢ã®äœæ¥ãæ°çŸïŒ!!!ïŒååæžãããããšãããããŸããã ããªãã¯æ£ããèããã ããã¯æ°çŸåäœã§ãã ããã«ããããã¯ãã¹ãŠäžååã«ææžåãããŠããŸãããæåã¯å ã«æããŠãææžã®ãã¬ãŒãºã®æçããããªã¯ãšã¹ããå€æ°ã®æ©ãééããããšãã«é 延ãæ眪ã§ããããšã蚌æããŸããã 倧ããªã¢ã¬ã€ããã©ã€ãã¢ãŠãããå¿ èŠãããå Žåãã¬ã€ãã³ã·ãŒãçºçããŸããã1ã€ã®ãã³ããããã¯ãŒãã«é¢ããŠã¯éèŠã§ã¯ãããŸããã èŠæ±ãåäžã®å ŽåïŒããã³OSã«ãŒãã«ã®ããŒããŠã§ã¢ã¢ã¯ã»ã©ã¬ãŒã·ã§ã³ã¯ãããã ããæå³ããŸãïŒãã¹ããŒããŠã³ã¯æ£ç¢ºã«æ°çŸåé²ã¿ãŸãã ããã°ã©ã ãéæ¹ããªãé床ã§ãã£ãã·ã¥ãä»ããŠã¡ã€ã³ã¡ã¢ãªãæäœããå ŽåãçŽç²ã«ããã°ã©ã çãªæ¹æ³ã§ãã¹ãŠãå®è¡ããæ¹ãã¯ããã«é«éã§ãã
PSoCã§ã¯ãç¹å®ã®èšç»ããããŸããã å€èŠ³ã§ã¯ãDMAãšUDBã䜿çšããŠãé åå ã®ããŒã¿ãé©ãã»ã©æ¢ãããšãã§ããŸãã æ¬åœã«ããã«ãããã®ïŒ DMAèšè¿°åæ§é ã«ããããããã®ã³ã³ãããŒã©ãŒã¯ãªã³ã¯ãªã¹ãã§å®å šã«ããŒããŠã§ã¢æ€çŽ¢ãå®è¡ã§ããŸãã ããããäžèšã®ãã©ã°ãåãåã£ãåŸãç§ã¯ãããã¬ã€ãã³ã·ãŒã«ãé¢é£ããŠããããšã«æ°ä»ããŸããã ããã§ããã®ã¬ã€ãã³ã·ã¯ããã¥ã¡ã³ãã«è©³ãã説æãããŠããŸãã ãã¡ããªTRMããã³å¥ã®ããã¥ã¡ã³ãAN84810-PSoC 3ããã³PSoC 5LP Advanced DMA Topicsã®äž¡æ¹ ã ããã«ã¯ã»ã¯ã·ã§ã³3.2ããããŸãã ãããã£ãŠã次ã®ããŒããŠã§ã¢ã¢ã¯ã»ã©ã¬ãŒã·ã§ã³ã¯ãã£ã³ã»ã«ãããŸãã æ®å¿µã ããããSemyon Semyonovich Gorbunkovãèšã£ãããã«ïŒãæã ã¯æ€çŽ¢ããŸããã
ç¶ç¶çãªãœãããŠã§ã¢å®éš
次ã«ããã¬ãŒã³ãã ã¢ã«ãŽãªãºã ã®ãã©ã¡ãŒã¿ãŒãèšå®ããŸãã
// // â CY_SET_REG16(StepperController_X_Datapath_1_D0_PTR, 4); CY_SET_REG16(StepperController_X_Datapath_1_D1_PTR, 2);
ãããããDMAãä»ããŠãšã³ãžã³ã³ã³ãããŒã«ãŠãããXã®FIFO1ã«ã¯ãŒãã®é åã転éããéåžžã®ã³ãŒãããããŸãã
çµæã«ã¯èª¬æãå¿ èŠã§ãã ããã«ãããŸãïŒ
ãã·ã³ãOneç¶æ ã®å Žåãã«ãŠã³ã¿ãŒA0ã®å€ã¯èµ€ã§è¡šç€ºãããŸãã ç·è²ã®ã¢ã¹ã¿ãªã¹ã¯ã¯ããã·ã³ãExtraTickç¶æ ã«ããããã«é 延ãæ¿å ¥ãããå Žåã瀺ããŠããŸãã ãŸãã ClearA0ç¶æ ã«ããããã«é 延ãçºçããããŒãããããããã¯éãã°ãªããã§ããŒã¯ãããŠããŸãã
ã芧ã®ãšãããæåã«å ¥åãããšæåã®é 延ã¯å€±ãããŸãã ããã¯ãA0ãã¢ã€ãã«ç¶æ ã®ãšãã«ãªã»ããããããã LoadDataã«å ¥ããšå¢å ããããã§ã ã ãããã£ãŠãåæã®æç¹ãŸã§ïŒ Oneã®ç¶æ ããã®åºå£ïŒãããã¯ãã§ã«åäžã«çããã§ãã ã¢ã«ãŠã³ãã¯åœŒå¥³ããå§ãŸããŸãã ããããäžè¬çã«ãããã¯äžéåšæ³¢æ°ã«åœ±é¿ããŸããã 念é ã«çœ®ããŠããå¿ èŠããããŸãã A0ããªã»ãããããšãã¡ãžã£ãŒãæ¿å ¥ãããããšã«æ³šæããŠãã ããã å¹³åé »åºŠãèšç®ãããšãã¯ããããèæ ®ããå¿ èŠããããŸãã
ããããäžè¬çã«ããã«ã¹ã®æ°ã¯æ£ããã§ãã ãã®æéãä¿¡ããããŸãã
ããçŸå®çãªèšè¿°åã®ãã§ãŒã³ãããã°ã©ã ããŠã¿ãŸãããã
å éãçŽç·éåããã¬ãŒãã³ã°ã®ãã§ãŒãºã§æ§æãããŸãã
void TestWithPacking(int countOnLinearStage) { // , // . // , DMA !!! // , !!! StepperController_X_SingleVibrator_WritePeriod (6); // // â CY_SET_REG16(StepperController_X_Datapath_1_D0_PTR, 4); CY_SET_REG16(StepperController_X_Datapath_1_D1_PTR, 2); // static const uint16 accelerate[] = {0x0010,0x0008,0x0004}; // static const uint16 deccelerate[] = {0x004,0x0008,0x0010}; // . . static const uint16 steps[] = {0x0001}; // DMA , uint8 channel = DMA_X_DmaInitialize (sizeof(steps[0]),1,HI16(steps),HI16(StepperController_X_Datapath_1_F1_PTR)); CyDmaChRoundRobin (channel,true); // uint8 tdDeccelerate = CyDmaTdAllocate(); CyDmaTdSetConfiguration(tdDeccelerate, sizeof(deccelerate), CY_DMA_DISABLE_TD, TD_INC_SRC_ADR | TD_AUTO_EXEC_NEXT); CyDmaTdSetAddress(tdDeccelerate, LO16((uint32)deccelerate), LO16((uint32)StepperController_X_Datapath_1_F1_PTR)); // uint8 tdSteps = CyDmaTdAllocate(); // !!! // !!! CyDmaTdSetConfiguration(tdSteps, countOnLinearStage, tdDeccelerate, /*TD_INC_SRC_ADR |*/ TD_AUTO_EXEC_NEXT); CyDmaTdSetAddress(tdSteps, LO16((uint32)steps), LO16((uint32)StepperController_X_Datapath_1_F1_PTR)); // // !!! uint8 tdAccelerate = CyDmaTdAllocate(); CyDmaTdSetConfiguration(tdAccelerate, sizeof(accelerate), tdSteps, TD_INC_SRC_ADR | TD_AUTO_EXEC_NEXT); CyDmaTdSetAddress(tdAccelerate, LO16((uint32)accelerate), LO16((uint32)StepperController_X_Datapath_1_F1_PTR)); // CyDmaChSetInitialTd(channel, tdAccelerate); // CyDmaChEnable(channel, 1); }
ãŸããåã10ã¹ããããåŒã³åºããŸãïŒDMAã§ã¯ãå®éã«ã¯20ãã€ãããªããªããŸãïŒã
TestWithPacking (20);
çµæã¯æåŸ ã©ããã§ãã æåã¯å éãèŠããŸãã ãããŠã IDLE ïŒéç·ïŒãžã®åºå£ã¯ãæåŸã®ãã«ã¹ããã®å€§ããªé 延ã§çºçããæåŸã®ã¹ããããå®å šã«å®äºãããã®å€ã¯æåã®å€ã«ã»ãŒçãããªããŸãã
éåžžã®æ¡ä»¶äžã§ã®æ¬ç©ã®éŠ¬
æ©åšãæ¹é ãããšããç§ã¯ã©ãããããã24ãããã®ãã«ã¹å¹ ãã16ãããã®ãžã§ãã«ãžã£ã³ãããããšãæåã§ãã ãããããããã§ããªãããšãããããŸãããæå°ãã«ã¹åšæ³¢æ°ãé«ãããããšã«ãªããŸãã æå³çã«ãã£ãã äºå®ã16ãããã«ãŠã³ã¿ãŒã®ããã容éãæ¡åŒµããææ³ã¯éåžžã«è€éã§ããããšãå€æãããããã¡ã€ã³ãã·ã³ãšäžç·ã«èª¬æãå§ããå Žåããã¹ãŠã®æ³šæããããããšã«ãªããŸãã ãããã£ãŠãåå¥ã«æ€èšããŸãã
16ãããã®ããããªãŒããããŸãã äžäœãããã«éåžžã®7ãããã«ãŠã³ã¿ãŒãè¿œå ããããšã«ããŸããã ãã®7ãããã«ãŠã³ã¿ãŒãšã¯äœã§ããïŒ ããã¯ãåUDBãããã¯ã§äœ¿çšå¯èœãªèšèšã§ãïŒããŒã¹UDBãããã¯ã¯ãã¹ãŠã®8ãããã¬ãžã¹ã¿ã®ãããå¹ ãæã¡ãããã深床ã®å¢å ã¯ã°ã«ãŒãå ã®ãããã¯ã®çµã¿åããã«ãã£ãŠæ±ºãŸããŸãïŒã åããªãœãŒã¹ã®ãã¡ã å¶åŸ¡/ã¹ããŒã¿ã¹ã¬ãžã¹ã¿ãå®è£ ã§ããŸãã ããã§ãåäžã®Control / Statusãã¢ã§ã¯ãªãã16ãããã®ããŒã¿ã«å¯ŸããŠ1ã€ã®ã«ãŠã³ã¿ãŒãã§ããŸããã ãã®ãããã·ã¹ãã ã«å¥ã®ã«ãŠã³ã¿ãŒãè¿œå ããŠããäœåãªãªãœãŒã¹ã¯é 延ããŸããã ãã§ã«å²ãåœãŠãããŠãããã®ã䜿çšããŸãã ãããïŒ ãã®ã¡ã«ããºã ã«ãããã«ã¹å¹ ã«ãŠã³ã¿ãŒã®äžäœãã€ããäœæãã23ãããã«çãããã«ã¹å¹ ã«ãŠã³ã¿ãŒã®åèšå¹ ãååŸããŸãã
æåã«ç§ãèããŠããããšãèšããŸãã é 延ç¶æ ãçµäºããåŸããã®è¿œå ã«ãŠã³ã¿ãŒã®ã«ãŠã³ãã®å®äºã確èªãããšæããŸããã 圌ãã«ãŠã³ããçµäºããŠããªãå Žåããã®å€ãæžãããåã³é 延ç¶æ ã«åãæ¿ããŸãã ã«ãŠã³ããããšãäœåãªãµã€ã¯ã«ãè¿œå ããããšãªããããžãã¯ã¯åããŸãŸã«ãªããŸãã
ããã«ããã®ã«ãŠã³ã¿ãŒã®ããã¥ã¡ã³ãã«ã¯ãç§ãæ£ãããšæžãããŠããŸãã æåéãèšãïŒ
æé人çã¯ãã¹ãŠãç°ãªã£ãŠããããšã瀺ããŠããŸãã ãªã·ãã¹ã³ãŒãã®ã¿ãŒããã«ã«ãŠã³ãã©ã€ã³ã®ç¶æ ãæšæž¬ãã æéããã³ããã°ã©ã ã®ããŒãäžã«ãããªããŒãããããŒãã§ãã®å€ãç£èŠããŸããã ãããããã åžžã«é«ãç¶æ ã¯ãããŸããã§ããïŒ
åææéã¬ãžã¹ã¿å€ãå®çŸ©ããŸãã Nã¯ããã¯ã®æéã§ã¯ãæéå€ã¯N-1ã®å€ã«èšå®ããå¿ èŠããããŸãã ã«ãŠã³ã¿ã¯N-1ãã0ãŸã§ã«ãŠã³ãããNã¯ããã¯ãµã€ã¯ã«æéã«ãªããŸãã æéã¬ãžã¹ã¿å€0ã¯ãµããŒããããŠããªããããã¿ãŒããã«ã«ãŠã³ãåºåã¯äžå®ã®Highç¶æ ã«ä¿æãããŸãã
è©Šè¡é¯èª€ã«ãã£ãŠãã·ã¹ãã ãæ£åžžã«æ©èœãããããšãã§ããŸãããããããå®çŸããã«ã¯ãã«ãŠã³ã¿ãŒããå°ãªããšã1åæžç®ããå¿ èŠããããŸãã ãæžç®ãã®æ°ããç¶æ ã¯åŽã«ãããŸããã å¿ èŠãªãã¹ã«æŒã蟌ãŸããªããã°ãªããŸããã§ããã é 延ç¶æ ã®åã«ããã Next65536ãšåŒã°ããŸã ã
ãã®ç¶æ ã®ALUã¯ãæçšãªã¢ã¯ã·ã§ã³ãå®è¡ããŸããã å®éããã®ç¶æ ã«ãããšããäºå®ã«åå¿ããã®ã¯æ°ããã«ãŠã³ã¿ãŒã ãã§ãã ããã¯å³ã«ãããŸãïŒ
ããããã£ã®è©³çŽ°ã¯æ¬¡ã®ãšããã§ãã
äžè¬ã«ã以åã®èšäºãèæ ®ãããšããã®ã«ãŠã³ã¿ãŒã®æ¬è³ªã¯æããã§ãã æå¹ã«ãªã£ãŠããè¡ã®ã¿ã圱é¿ãåããŠããŸãã ç¹°ãè¿ãã«ãªããŸããããã·ã³ãLoadDataç¶æ ã«ãããšãã«ãªã³ã«ããå¿ èŠãããçç±ãå®å šã«ã¯ç解ããŠããŸããïŒã«ãŠã³ã¿ãŒãåšæå€ãåèªã¿èŸŒã¿ããŸãïŒã ç§ã¯ãLEDãå¶åŸ¡ããã«ãŠã³ã¿ãŒã®ããããã£ããããã®LEDã®ã³ã³ãããŒã«ãŠãããã®è±åœã®èè ãããã®ããªãã¯ãåããŸããã ããããªããšãæéã®ãŒãå€ã¯æ©èœããŸããã 圌女ã¯åœŒå¥³ãšäžç·ã«åããŠããŸãã
APIã³ãŒãã«ãæ°ããã«ãŠã³ã¿ãŒã®åæåãè¿œå ããŸãã éå§é¢æ°ã¯æ¬¡ã®ããã«ãªããŸãã
void `$INSTANCE_NAME`_Start() { `$INSTANCE_NAME`_SingleVibrator_Start(); //"One" Generator start `$INSTANCE_NAME`_Plus65536_Start(); }
æ°ããã·ã¹ãã ããã§ãã¯ããŠã¿ãŸãããã ãã¹ãçšã®æ©èœã³ãŒãã¯æ¬¡ã®ãšããã§ã
ïŒãã®äžã§ãæåã®è¡ã®ã¿ãæ¢ç¥ã®è¡ãšç°ãªããŸãïŒïŒ
void JustTest(int extra65536s) { // 65536 StepperController_X_Plus65536_WritePeriod((uint8) extra65536s); // // â CY_SET_REG16(StepperController_X_Datapath_1_D0_PTR, 4); CY_SET_REG16(StepperController_X_Datapath_1_D1_PTR, 2); // . // static const uint16 steps[] = { 0x1000,0x1000,0x1000,0x1000 }; // DMA , uint8 channel = DMA_X_DmaInitialize (sizeof(steps[0]),1,HI16(steps),HI16(StepperController_X_Datapath_1_F1_PTR)); CyDmaChRoundRobin (channel,true); // , uint8 td = CyDmaTdAllocate(); // . , . CyDmaTdSetConfiguration(td, sizeof(steps), CY_DMA_DISABLE_TD, TD_INC_SRC_ADR | TD_AUTO_EXEC_NEXT); // CyDmaTdSetAddress(td, LO16((uint32)steps), LO16((uint32)StepperController_X_Datapath_1_F1_PTR)); // CyDmaChSetInitialTd(channel, td); // CyDmaChEnable(channel, 1); }
次ã®ããã«åŒã³åºããŸãã
JustTest(0);
ãªã·ãã¹ã³ãŒãã§ã¯ã次ã®ããã«è¡šç€ºãããŸãïŒé»è²ã®ããŒã -STEPåºåãéè²-ããã»ã¹å¶åŸ¡çšã®ã«ãŠã³ã¿ãŒTCåºåã®å€ïŒã ãã«ã¹å¹ ã¯ã¹ãããé åã«ãã£ãŠèšå®ãããŸã ã åã¹ãããã§ãæéã¯0x1000ã¡ãžã£ãŒã§ãã
å¥ã®çµæã«äºææ§ãããããã«ãå¥ã®ã¹ãã£ã³ã«åãæ¿ããŸãã
é¢æ°åŒã³åºããããã«å€æŽããŸãã
JustTest(1);
çµæã¯æåŸ ã©ããã§ãã ãŸããTCåºåã¯0x1000ãã£ãã¯ã§ã¯ãŒãã次ã«0x10000ïŒ65536dïŒãã£ãã¯ã®åäœã§ãã åšæ³¢æ°ã¯ãããã700ãã«ãã«çããã®ã§ãèšäºã®æåŸã®éšåã§ããã£ãã®ã§ããã¹ãŠãæ£ããã§ãã
ããŠããã¥ãŒã¹ãè©ŠããŠã¿ãŸãããïŒ
JustTest(2);
ååŸãããã®ïŒ
ããã§ãã TCåºåã¯ãæåŸã®65536ã¯ããã¯ãµã€ã¯ã«ã§1ã«å転ããŸãã ãã®åã«ã圌ã¯0x1000 + 0x10000ã¯ããã¯ãµã€ã¯ã«ã®éãŒãã§ããã
ãã¡ããããã®ã¢ãããŒãã§ã¯ããã¹ãŠã®ãã«ã¹ã¯æ°ããã«ãŠã³ã¿ãŒã®åãå€ã§è¡ãå¿ èŠããããŸãã å éäžã«æé«ãã€ããããšãã°3ã1ã0ã§1ã€ã®ãã«ã¹ãäœæããããšã¯äžå¯èœã§ããããããå®éããã®ãããªäœåšæ³¢æ°ïŒ700ãã«ãæªæºïŒã§ã¯ãå éã«ã¯ç©ççãªæå³ããªãããããã®åé¡ã¯ç¡èŠã§ããŸãã ãã®é »åºŠã§ããšã³ãžã³ãçŽç·çã«æäœã§ããŸãã
è»èã§é£ã¶
PSoC5LPãã¡ããªã®TRMããã¥ã¡ã³ãã«ã¯æ¬¡ã®ããã«èšèŒãããŠããŸãã
åãã©ã³ã¶ã¯ã·ã§ã³ã¯1ã64 KBã§ãããããããã§ã«è¿°ã¹ãAN84810ã«ã¯ã次ã®ãããªãã¬ãŒãºããããŸãã
1. DMAã䜿çšããŠ4095ãã€ã以äžããããã¡ããã«ã¯ã©ãããã°ããã§ããïŒèª°ãæ£ããïŒ å®éšãè¡ãå Žåãçµæã¯ææªã®ã¹ããŒãã¡ã³ããæ¯æããåŸåããããŸãããåäœã¯å®å šã«ç解ã§ããŸããã å šäœã®æ¬ ç¹ã¯ãAPIã®ãã®ãã§ãã¯ã§ãïŒ
TDã®æ倧転éã«ãŠã³ãã¯4095ãã€ãã«å¶éãããŠããŸãã åäžã®DMAãã£ãã«ã䜿çšããŠ4095ãã€ã以äžã転éããå¿ èŠãããå Žåã¯ãè€æ°ã®TDã䜿çšããäŸ5ã«ç€ºãããã«ãããããã§ãŒã³ããŸãã
åãããã¹ãã
cystatus CyDmaTdSetConfiguration(uint8 tdHandle, uint16 transferCount, uint8 nextTd, uint8 configuration) \ { cystatus status = CYRET_BAD_PARAM; if((tdHandle < CY_DMA_NUMBEROF_TDS) && (0u == (0xF000u & transferCount))) { /* Set 12 bits transfer count. */ reg16 *convert = (reg16 *) &CY_DMA_TDMEM_STRUCT_PTR[tdHandle].TD0[0u]; CY_SET_REG16(convert, transferCount); /* Set Next TD pointer. */ CY_DMA_TDMEM_STRUCT_PTR[tdHandle].TD0[2u] = nextTd; /* Configure the TD */ CY_DMA_TDMEM_STRUCT_PTR[tdHandle].TD0[3u] = configuration; status = CYRET_SUCCESS; } return(status); }
ãã©ã³ã¶ã¯ã·ã§ã³ã4095ãã€ãããé·ãæå®ãããŠããå Žåãåã®èšå®ã䜿çšãããŸãã ã¯ãããšã©ãŒã³ãŒãããã§ãã¯ããããšãèããŠããŸããã§ãã...
å®éšã§ã¯ããã®ãã§ãã¯ãåé€ãããšããã¹ã¯0xfffïŒ4096= 0x1000ïŒã䜿çšããŠå®éã®é·ããåãæšãŠãããããšã瀺ãããŸããã ãããããã 楜ããä»äºãžã®ãã¹ãŠã®åžæã¯åŽ©å£ããã ãã¡ããã4Kã§é¢é£ããèšè¿°åã®ãã§ãŒã³ãäœæã§ããŸãã ãããã64Kã¯16ãã§ãŒã³ã§ãã 3ã€ã®ã¢ã¯ãã£ããšã³ãžã³ïŒæŒåºæ©ã®ã¹ããããå°ãªããªããŸãïŒ-48ãã§ãŒã³ã ææªã®å Žåãåã»ã°ã¡ã³ãã®åã«æ£ç¢ºã«å€ãã®æ å ±ãå ¥åããå¿ èŠããããŸãã ããããããã¯æéå ã«åãå ¥ããããŸãã å°ãªããšã127åã®èšè¿°åã䜿çšå¯èœã§ããããã確å®ã«ååãªã¡ã¢ãªããããŸãã
å¿ èŠã«å¿ããŠäžè¶³ããŒã¿ãéä¿¡ã§ããŸãã DMAãã£ãã«ãäœæ¥ãå®äºãããšããå²ã蟌ã¿ãçºçããå¥ã®ã»ã°ã¡ã³ãã転éããŠããŸãã ãã®å Žåãèšç®ã¯äžèŠã§ãã»ã°ã¡ã³ãã¯ãã§ã«åœ¢æãããŠããããããã¹ãŠãé«éã«ãªããŸãã ãŸããããã©ãŒãã³ã¹èŠä»¶ã¯ãããŸãããå²ã蟌ã¿èŠæ±ãçºè¡ããããšãFIFOã«ã¯ããã«æ°çŸãŸãã¯æ°åã®ã¯ããã¯ãµã€ã¯ã«ã§ãµãŒãã¹ãããèŠçŽ ã4ã€è¿œå ãããŸãã ã€ãŸãããã¹ãŠãæ¬ç©ã§ãã ç¹å®ã®æŠç¥ã¯ãå®éã®äœæ¥äžã«éžæãããããªããŸãã ããããããã¥ã¡ã³ããŒã·ã§ã³ïŒTRMïŒã®èª€ããæ°åå šäœãå°ç¡ãã«ããŸããã ãããåãã£ãŠããã£ãŠããã°ãæ¹æ³è«ããã§ãã¯ããªãã£ãã ããã
ãããã«
å€èŠ³ã§ã¯ãéçºãããè£å©ãã¡ãŒã ãŠã§ã¢ããŒã«ãåãå ¥ããããããã«ãªã£ããããã¹ãããã³ã°ã¢ãŒã¿ãŒã®å²ã蟌ã¿ãã³ãã©ãŒã«åžžã«ååšããªãããã¡ãŒã ãŠã§ã¢ããããšãã°Marlinã®ããŒãžã§ã³ãäœæã§ããããã«ãªããŸããã ç§ã®ç¥ãéããããã¯ç¹ã«ã³ã³ãã¥ãŒãã£ã³ã°ãªãœãŒã¹ã®éèŠãéåžžã«é«ããã«ã¿ããªã³ã¿ãŒã«åœãŠã¯ãŸããŸãã ããããããã¯ãé ãæ¢ãŸãå Žæã§ç§ã®ãã«ã¿ã«çºçããæµå ¥ãæé€ããŸãã ãããã®åãå Žæã®MZ3Dã§ã¯ãæµå ¥ã¯èŠ³å¯ãããŸããã çå®ãã©ããã«ããããããæéãçµãŠã°ãããã®ã§ãããã«é¢ããã¬ããŒãã¯å®å šã«ç°ãªããã©ã³ãã«æçš¿ããå¿ èŠããããŸãã
ãããŸã§ã®éãUDBãããã¯ã§ã¯ããã®åçŽåã®ããã«ãã¡ã€ã³ããã»ããµãšé£æºããŠåäœããã¢ã³ããŒãã§ããã³ããã»ããµãå®è£ ããããšãéåžžã«å¯èœã§ãã ãããŠããããã®ãŠããããå€æ°ããå Žåãã³ããã»ããµãŒã¯äžŠè¡ããŠåäœã§ããŸãã
DMAã³ã³ãããŒã©ãŒã®ããã¥ã¡ã³ãã®ãšã©ãŒã«ãããçµæããŒãããŠããŸãã ããã«ãé¢ããããäžæã¯å¿ èŠã§ãããåãé »åºŠã§ã¯ãªããå ã®ããŒãžã§ã³ã«ãã£ãæéçãªéèŠæ§ããããŸããã ãããã£ãŠãã ãŒãã¯æãªãããŸãããUDBã«åºã¥ããã³ããã»ããµãŒãã®äœ¿çšã¯ãçŽç²ãªãœãããŠã§ã¢äœæ¥ãšæ¯èŒããŠãããªãã®å©çããããããŸãã
éäžã§ãDMAãããªãäœéã§åäœããããšãæããã«ãªããŸããã ãã®çµæãPSoC5LPãšSTM32ã®äž¡æ¹ã§ããã€ãã®æž¬å®ãå®è¡ãããŸããã çµæã¯å¥ã®èšäºãåŒãåºããŸãã ãããã¯ãèå³æ·±ãå Žåããããããã€ããããè¡ãã§ãããã
å®éšã®çµæã2ã€ã®ãã¹ããããžã§ã¯ããåæã«ååŸãããŸããã æåã®æ¹ãç解ããããã§ãã ããã§åãããšãã§ããŸã ã 2çªç®ã¯1çªç®ããç¶æ¿ãããŸããã7ãããã«ãŠã³ã¿ãŒãšé¢é£ããããžãã¯ãè¿œå ãããšæ··ä¹±ããŸãã ããã§åãããšãã§ããŸã ã ãã¡ããããããã®äŸã¯ãã¹ãçšã§ãã æ¬åœã®ããã¡ãŒã ãŠã§ã¢ãã«çµã¿èŸŒãèªç±ãªæéã¯ãŸã ãããŸããã ãããããããã®èšäºã®æ çµã¿ã®äžã§ãUDBãšã®é£æºãå®è·µããããšãããéèŠã§ãã