Ìܼ¡
¥³¥á¥ó¥È¤Ï¤¢¤ê¤Þ¤»¤ó¡£ Comments/tsujino
¥Ñ¥¿¡¼¥óÀ߷פò½ª¤¨¤¿¸å¤ËDRC¤Ç¥¨¥é¡¼¤¬¤Ê¤¤¤«³Îǧ¤¹¤ë¤È¿¿ô¤Î¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
ÀèÀ¸¤Ë¤¤¤¯¤Ä¤«¤Î¥¨¥é¡¼¤Ë´Ø¤·¤Æ¶µ¤ï¤Ã¤¿¤Î¤Ç¥á¥â¡£
Ƽ¤òϪ½Ð¤·¤¿¤¤Éôʬ¤ËTop¤ÈtStop¤ò»È¤¨¤Ð¤è¤¤¡£
¸¡º÷¥¡¼¥ï¡¼¥É¤ÎÁ°¸å¤Ë¡ö¤ò¤Ä¤±¤ë¤È¤½¤ì¤ò´Þ¤à·ë²Ì¤òɽ¼¨¤Ç¤¤ë¡£
½Å¤Í¤Æ¤Ï¤ó¤À¤Å¤±¤¹¤ì¤Ð¤è¤¤¡£
ÅŸ»¤ÈGND¤Ë¤½¤ì¤¾¤ì¤Ä¤Ê¤¤¤ÀVia¤ò¥ê¡¼¥É¥¹¥¤¥Ã¥Á¤ÎŤµ¤Ë¹ç¤ï¤»¤ÆÀßÃÖ¤·¤Æ¤½¤³¤Ë¤Ï¤ó¤À¤Å¤±¡£
ºòÆü¥Õ¥ê¥¹¥¯¥±¡¼¥¹¤Ë¼ý¤á¤ë¤¿¤á¤Ë¤Ë´ðÈĤò¥«¥Ã¥È¤·¤Æ¤¤¤¿¤¬¡¢¥×¥é¥´¥ß¤Ë´ðÈĤ¬¼Î¤Æ¤é¤ì¤Æ¤¤¤ë¤Î¤ò¸«¤Æ»×¹ÍÄä»ß¤Ç¼«Ê¬¤â¼Î¤Æ¤Æ¤·¤Þ¤¤¡¢´ðÈĤÏËä¤áΩ¤Æ¥´¥ß¤À¤ÈÀèÀ¸¤Ë»ØŦ¤ò¤¤¤¿¤À¤¤Þ¤·¤¿¡£
°Ê¸åÃí°Õ¤·¤Þ¤¹¡£
»³Â¼·¯¤âºî¶ÈÆü»ï¤Ç¿¨¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢´ðÈÄÀß·×»þ¤Ë¤Ï¥Þ¥¤¥³¥ó¤Î½ñ¤¹þ¤ß¤ËɬÍפʥԥó¤ò¤¢¤é¤«¤¸¤á¥Ø¥Ã¥À¥Ô¥ó¤Ë¤Ä¤Ê¤¤¤Ç¤ª¤¯¤Ù¤¤Ç¤¹¡£
º£²ó»È¤¦¥Þ¥¤¥³¥ó¤ÏPSoC¤ÎCY8C27443¡¢SSOP¥Ñ¥Ã¥±¡¼¥¸¤Ç¤¹¤¬PSoC¤Î½ñ¤¹þ¤ß¤ËɬÍפʥԥó¤ÏVDD¡¢GND¡¢XRES¡¢SCLK(P1[1])¡¢SDATA(P1[0])¤Î£µ¤Ä¤Ç¤¹¡ÊXRES̵¤·¤Î£´¥Ô¥ó¤Ç¤â¤Ê¤ó¤È¤«¤Ê¤ë¤è¤¦¤Ç¤¹¡Ë¡£¤³¤ì¤Ë´Ø¤·¤Æ¤Ï¥Þ¥¤¥³¥ó¥Ö¤Î¶¦Í¾ðÊó¤Î¥Ú¡¼¥¸¤Ë¤â¤Þ¤È¤á¤é¤ì¤Æ¤¤¤Þ¤¹¡£
¼«Ê¬¤Ï¤½¤ì¤ò¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¤³¤È¤¬È¿¾ÊÅÀ¤Ç¤¹¡£¤³¤Î¾õ¶·¤Ç¤É¤Î¤è¤¦¤Ë½ñ¤¹þ¤ß¤ò¤¹¤ë¤«¤È¤¤¤¦ÏäòÀèÀ¸¤«¤é¤¤¤¿¤À¤¤Þ¤·¤¿¡£XRES¤¬²¿¤â¤Ä¤Ê¤¬¤ì¤Æ¤¤¤Ê¤¤¤Î¤Ç£´¥Ô¥ó¤Ç¤¹¤¬¡¢VDD¤ÈGND¤Ë´Ø¤·¤Æ¤Ï£²¥Ô¥ó¥Ø¥Ã¥À¤Ë·Ò¤¤¤Ç¤¢¤Ã¤¿¤Î¤Ç¤½¤ì¤ò»È¤¨¤Ð¤è¤¤¡£P1[0]¡¢P1[1]¤Ë´Ø¤·¤Æ¤Ï£·¥»¥°¤Ë·Ò¤¤¤Ç¤¢¤Ã¤¿¤Î¤Ç¤½¤³¤ò½ñ¤¹þ¤ßÃʳ¬¤À¤±·Ò¤¬¤º¥Á¥Ã¥×Äñ¹³Éôʬ¤«¤éÀþ¤ò·Ò¤¤¤Ç½ñ¤¹þ¤ß¤ò¹Ô¤¦¡£
À߷פ·¤¿´ðÈĤ˼ÂÁõ¤·¤Æ¤ß¤¿¤¬¡¢LED¤¬¤¿¤Þ¤Ë¤·¤«ÅÀÅô¤·¤Ê¤¤¸½¾Ý¤¬¡£¥³¥¤¥óÅÅÃÓ¤ÎÆâÉôÄñ¹³¤ÇɬÍפÊÅÅÎϤ¬ÆÀ¤é¤ì¤Æ¤¤¤Ê¤¤¤Î¤Ç¤Ï¤Ê¤¤¤«¤È¤Î»ØŦ¤ÇÅŸ»ÁõÃÖ¤ò»È¤Ã¤Æ3V¤ÇÆ°ºî³Îǧ¤·¤¿¤È¤³¤í¤·¤Ã¤«¤êÅÀÅô¤·¤Þ¤·¤¿¡£2.8V¤¯¤é¤¤¤Ë²¼¤²¤ë¤ÈÅÀÅô¤·¤Ê¤¯¤Ê¤Ã¤¿¤Î¤Ç¡¢¥³¥¤¥óÅÅÃÓ¤¬¤½¤ì¤ò²¼²ó¤Ã¤Æ¤¤¤¿¤è¤¦¤Ç¤¹¡£
ÅŸ»ÁõÃ֤ǤÎÆ°ºî³Îǧ¤Ï»öÁ°¤Ë¤·¤Þ¤·¤ç¤¦¡£
ÅŸ»ÁõÃ֤Υê¥ß¥Ã¥¿¥Ü¥¿¥ó¤ò²¡¤·¤Ê¤¬¤éÅÅή¤òÄ´À°¤¹¤ë¤È¤½¤ì¤¬¥ê¥ß¥Ã¥¿¤È¤Ê¤Ã¤Æ¤½¤ì°Ê¾åÅÅή¤¬Î®¤ì¤ë¤³¤È¤òÁ˻ߤ·¤Æ¤¯¤ì¤Þ¤¹¡£¤â¤·¤½¤ì°Ê¾å¤ËÅÅή¤¬Î®¤ì¤ë¾ì¹ç¤Ï¼«Æ°¤ÇÅÅ°µ¤ò²¼¤²¤ë¤è¤¦¤Ç¤¹¡£
£±¥Õ¥ì¡¼¥àÊÕ¤ê16¿Ê¿ô¤Ç8byteʬ¤Î¥Ç¡¼¥¿¤¬115200bps¤Î¥·¥ê¥¢¥ëÄÌ¿®¤ÇÁ÷¤é¤ì¤Æ¤¯¤ë¡£
0x80, X1, X2, X3, 0xC0, Y1, Y2, Y3
¤È¤¤¤Ã¤¿´¶¤¸¤Ç¡¢X = X1*128 + X2 + X3/128
YºÂɸ¤âƱÍͤǤ¢¤ê¡¢¿ôÃÍÉôʬ¤ÏºÇ¾å°Ìbit¤¬0¤È¤Ê¤ë¤Î¤Ç0x80¡¢0xC0¤ò¤È¤êÆÀ¤ë¤³¤È¤Ï¤Ê¤¤¡£¥¹¥È¥ì¡¼¥¸¤ÎÀî¾å¤µ¤ó¤Î¥Õ¥©¥ë¥À¤Ë¤³¤Î¥Ç¡¼¥¿¤¢¤ê¡£
¸¶°ø¤ÏTerminal¤ÇBinary¤Ë¥Á¥§¥Ã¥¯¤¬Æþ¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¤À¤±¤Ç¡¢Àµ¤·¤¤¥Ç¡¼¥¿¤ò¼õ¿®¤·¤Æ¤¤¤ë¤³¤È¤¬³Îǧ¤Ç¤¤¿¡£
VDD ¡æ 4.75V¡¡¢ª¡¡24MHz VDD ¡æ 3.0V¡¡¢ª¡¡12MHz VDD ¡æ 2.4V¡¡¢ª¡¡3MHz
¤½¤Î¸å¡¢PSoC¤«¤éÁ÷¤é¤ì¤Æ¤¯¤ë¥Ç¡¼¥¿¤ò16byte¡Ê£²¥Õ¥ì¡¼¥àʬ¡Ë¤À¤±¤Ë¤·¤Æ¤ß¤ë¤ÈTerminal¤¬Æ°ºî¤òÄä»ß¤¹¤ë¤³¤È¤Ï¤Ê¤«¤Ã¤¿¡£Terminal¤ÇÆ°ºî³Îǧ¤¹¤ë»þ¤ÏÁ÷¤ë¥Ç¡¼¥¿¤òÄø¡¹¤Ë¤¹¤ë¡£
ASC¶¤Ï¡¢¿ô»ú¡¦¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¡¦À©¸æÉä¹æ¤ò£·¥Ó¥Ã¥È¤Çɽ¤·¤Æ¤¤¤ë¡¢¥Ç¡¼¥¿ÄÌ¿®ÍѤÎÉä¹æÂηϡ£
»²¹Í¤Ë¤Ê¤ê¤½¤¦¤Ê¥Ú¡¼¥¸¢
https://developer.mbed.org/users/okini3939/notebook/mbed256/
640*480[pixel] ¢ª 210fps 640*175[pixel] ¢ª 500fps 640*64[pixel] ¢ª 1000fps
PSoC¤Ç¥µ¥Ã¥±¡¼¥ÉÃæ¤Î¤ßLED¤òÅÀÅô¤µ¤»¤ë¤Î¤¬¤É¤¦¤Ë¤â¤¦¤Þ¤¯¤¤¤Ã¤Æ¤¤¤Ê¤¤¡£
LED¤ÏÅÀÌǤ·¡¢¥«¥á¥éÁ´ÂΤòÇò¤«¹õ¤Ç£±Ãͤˤ·¤Æ¤ä¤ë¤È¾ÃÅô¤¹¤ë¡£¥µ¥Ã¥±¡¼¥É¬ÄêÃæ¤Ç¤âÅÀÌǤ¬¸«¤¨¤Æ¤·¤Þ¤¦¤¿¤áïçÃͤòºÆÄ´À°¤·¤¿¤¬¤ä¤Ï¤ê¤ª¤«¤·¤¤¡£
PSoC¥·¥ê¥¢¥ë¥Ç¡¼¥¿¤òÁ÷¤Ã¤Æ³Îǧ¤·¤Æ¤ß¤¿¤È¤³¤í£±¥Õ¥ì¡¼¥à¤Ë8byteʬ¤Î¥Ç¡¼¥¿¤¬Á÷¤é¤ì¤Æ¤¤¤Ê¤¤¡£°ì±þ¥«¥á¥é¥·¥¹¥Æ¥à¤«¤éľÀÜ¥·¥ê¥¢¥ë¥Ç¡¼¥¿¤ò¤â¤é¤Ã¤Æ³Îǧ¤·¤¿¤¬Àµ¾ï¡£
¤½¤Î¸åmain.c¤Îµ½Ò¤òÂçÉý¤Ë¥³¥á¥ó¥È¥¢¥¦¥È¤·¤¿¤È¤³¤íPSoC¤«¤é¤Î¥·¥ê¥¢¥ë¥Ç¡¼¥¿¤âÀµ¾ï¤Ë¤Ê¤ê¡¢¥³¥á¥ó¥È¥¢¥¦¥È¤ò¸º¤é¤·¤Æ¤¤¤Ã¤¿¤È¤³¤í½ù¡¹¤Ë£±¥Õ¥ì¡¼¥à¤ËÁ÷¤é¤ì¤ë¥·¥ê¥¢¥ë¥Ç¡¼¥¿¤¬¸º¤Ã¤Æ¤¤¤¯¾õÂÖ¤ò³Îǧ¤Ç¤¤¿¡£
¢ªPSoC¤Î½èÍý¤¬Äɤ¤¤Ä¤¤¤Æ¤¤¤Ê¤¤¤¿¤áGet¤¬Ã٤쥷¥ê¥¢¥ë¥Ç¡¼¥¿¤Î¼è¤êƨ¤·¤¬È¯À¸¤·¤Æ¤¤¤ë¤Î¤«¡£
¤·¤Ð¤é¤¯Á°¤Ë¶îÆ°ÅÅ°µ¤Ë¤è¤ëCPUCLKÀ©¸Â¤Ë¤Ä¤¤¤Æ¥á¥â¤·¤¿¤¬¡¢¶îÆ°ÅÅ°µ¤ò£µ£Ö¤ËÊѹ¹¤·¤ÆCPUCLK¤ò12¤«¤é24MHz¤ËÊѹ¹¤·¤¿¡£
¤À¤¬¤½¤ì¤Ç¤â¥·¥ê¥¢¥ë¥Ç¡¼¥¿¤Î¼è¤ê¤â¤é¤·¤¬È¯À¸¤·¤¿¡£¤·¤«¤·¡¢12MHz¤Î»þ¤ÈÈæ¤Ù¤ë¤È¤Û¤È¤ó¤É¥³¥á¥ó¥È¥¢¥¦¥È¤·¤Ê¤¯¤Æ¤âȯÀ¸¤·¤Ê¤«¤Ã¤¿¤Î¤Ç²þÁ±¤Ë¤Ê¤Ã¤¿¤È¤ß¤¨¤ë¡£
¤Á¤Ê¤ß¤Ëmbed NXP LPC1768¤Ï96MHz¤ÇÆ°ºî¤¹¤ë¤è¤¦¤À¡£
¥·¥ê¥¢¥ë¥Ç¡¼¥¿¤¬¼õ¿®¤Ç¤¤Ê¤¤»ö°Æ¤¬È¯À¸¡£PSoC¤ò²ð¤µ¤º¤ËÀܳ¤·¤Æ¤âƱÍÍ¡£¥«¥á¥é¤ÎÅŸ»¤ÏÆþ¤Ã¤Æ¤¤¤¿¤Î¤ÇÇÛÀþ¤ò³Îǧ¤·¤¿¤¬²ò·è¤»¤º¡£¸¶°ø¤ÏFPGA¤Î£²Ëç¤Î´ðÈפÎÀܳ¤¬´Ë¤ó¤Ç¤¤¤¿¤¿¤á¡£
main.c¤Î¡¢º£¤Þ¤Ç¤Ï0x80¤ò¼õ¿®¤·¤¿»þ¤Ë½èÍý¤·¤Æ¤¤¤¿ºÂɸ·×»»¤Ê¤É¤ò0xC0¤ò¼õ¿®¤·¤¿»þ¤Ë½èÍý¤¹¤ë¤è¤¦¤Ë¤·¡¢£ùºÂɸ¤Î·×»»¤ò¥ª¥ß¥Ã¥È¤·¤¿¡£
£ùºÂɸ¤Î¥Ç¡¼¥¿¤ò¤È¤Ã¤Æ¤¤¤ë´Ö¤ÏGet¤¬Äɤ¤¤Ä¤«¤º¡¢£ùºÂɸ¤Ï1byte¤·¤«¤È¤ì¤Ê¤¯¤Ê¤Ã¤¿¤¬£øºÂɸ¤Ï3byteʬ¤È¤ë¤³¤È¤¬¤Ç¤¤¿¤Î¤Ç£øºÂɸ¤Ë´Ø¤·¤Æ¤Ï¤³¤ì¤Ç½èÍý¤ÏÄɤ¤¤Ä¤¤¤Æ¤¤¤ë¤Ï¤º¡£
£ùºÂɸ¤â·×»»¤·¤¿¤¤¾ì¹ç¤Ê¤Éµ½Ò¤¬Áý¤¨¤ì¤ÐÆ°ºî¤¬´í¤¦¤¯¤Ê¤ë¤Î¤Ç¡¢CY8C27443¤Ç¤Ï¤«¤Ê¤ê¸·¤·¤¤¤«¡£
16Æü17Æü¤ËÎý½¬¡¢22Æü¤ËËÜȯɽ¤¬¤¢¤Ã¤¿¡£
ȯɽ»þ´Ö¤Ï£·Ê¬¤À¤¬Îý½¬¤Ç¤Ï8ʬ20Éá¢ËÜÈ֤ǤÏ5ʬ24ÉäÈÂçÉý¤Êȯɽ»þ´Öº¹¤¬½Ð¤Æ¤·¤Þ¤Ã¤¿¡£Îý½¬¤Ç¤ÏÀâÌÀ¤òÃúÇ«¤Ë¤·¤¹¤®¡¢ËÜÈ֤ǤÏÀâÌÀ¤ò´Êά²½¤·¾Ç¤ê¤¹¤®¤¿º¹¤¬½Ð¤¿¡£
¤Ï¤¸¤á¤Ë¥µ¥Ã¥±¡¼¥É¤È¥µ¥Ã¥±¡¼¥ÉÍÞÀ©¡¢¥µ¥Ã¥±¡¼¥É¥Ç¥£¥¹¥×¥ì¥¤¤Ë¤Ä¤¤¤Æ´Ê·é¤ËÀâÌÀ¤¹¤ë¤Î¤¬¤¦¤Þ¤¯¤¤¤«¤Ê¤«¤Ã¤¿¡£Æä˥ǥ£¥¹¥×¥ì¥¤¤Ë´Ø¤·¤Æ¤Ï¥Ç¥£¥¹¥×¥ì¥¤¤ÎÄêµÁ¡¢´Ä¶¤Ë¤è¤ëÍÞÀ©¤ÎƯ¤¡¢´Ä¶¤ÎÄêµÁ¡¢ÍøÅÀ¤Ê¤É¤òÄø¤è¤¯¤Þ¤È¤á¤Ê¤±¤ì¤Ð¡£
12/15¤ËxºÂɸ¤Ï¤È¤ë¤³¤È¤¬¤Ç¤¤¿¤È¤·¤¿¤¬¡¢xºÂɸ¤Ç¥µ¥Ã¥±¡¼¥ÉÃæ¤Î¤ßÅÀÅô¤µ¤»¤ë¤è¤¦¼ÂºÝ¤Ë¥Ç¥£¥¹¥×¥ì¥¤¤ÎÆ°ºî¤ò»î¤·¤Æ¤ß¤¿¡£LED¤¬ÅÀÅô¤·¤Æ¤¤¤ë¾õÂÖ¤òÃγФǤ¤Ê¤«¤Ã¤¿¤¬»£±Æ¤·¤¿Æ°²è¤Ç¤ÏÅÀÅô¤·¤Æ¤¤¤¿¤Î¤Ç°Õ¿ÞÄ̤ê¤ËÆ°ºî¤·¤¿¡£
mbed NXP LPC1768¤ò»È¤Ã¤ÆL¥Á¥«¤È¤«´Êñ¤Ê¥×¥í¥°¥é¥à¤ÇÍ·¤ó¤Ç¤ß¤¿¡£»È¤¤¾¡¼ê¤¬¤¤¤¤¤Î¤«¤É¤¦¤«¤Ï¤Þ¤À¤è¤¯¤ï¤«¤é¤Ê¤¤¡£
Î㡧Serial PC(USBTX, USBRX);
name.baud(baudrate);¤È¤Ç¤¤ë¤¬¡¢¤³¤ì¤ò¾Êά¤¹¤ë¤Èbaudrate = 9600¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¡£
BusOut myleds(LED1, LED2, LED3, LED4); for(int i=0; i<4; i++) { myleds = 1 << i;¤È¤¢¤ê¡¢"<<i" ¤Ï¥Ð¥¹¤Î¥Ó¥Ã¥È¡Ê0¡Á3¡Ë¤ò»ØÄꤷ¤Æ¤¤¤ë¤Î¤À¤í¤¦¡£"<<i - 1" ¤È¤·¤Æ¤ä¤ì¤ÐLED1¡Á3¤¬ÅÀÅô¤·¡¢"<<i + 1" ¤È¤·¤Æ¤ä¤ì¤ÐLED2¡Á4¤¬ÅÀÅô¤·¤¿¡£
LED1 = P1.18 LED2 = P1.20 LED3 = P1.21 LED4 = P1.23¤Ç¤¢¤ê¡¢¤³¤ì¤é¤ò»ØÄꤹ¤ë¤Ë¤Ï
#define LED_MASK 0x00B40000 PortOut ledport(Port1, LED_MASK);¤È¤¤¤Ã¤¿¤è¤¦¤Ë»ÈÍѤ¹¤ë¥Ô¥ó¤ÈƱ¤¸¥Ý¡¼¥È¤ò»ØÄꤷ¡¢Æ±¤¸¥Ó¥Ã¥ÈÌܤò£±¤Ë¤¹¤ì¤Ð¤è¤¤¡£ p21¡Áp26¤ò»ØÄꤷ¤¿¤¤¾ì¹ç¤Ï
PortOut ledport(Port2, 0x0000003F);
Windows´Ä¶¤Çmbed¤È¥·¥ê¥¢¥ë¥Ç¡¼¥¿¤Î¤ä¤ê¼è¤ê¤ò¤¹¤ë¤Ë¤Ï¥É¥é¥¤¥Ð¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ëɬÍפ¬¤¢¤ë¡£
¡Ö´ãµå±¿Æ°¤Î¼Â¸³¿´Íý³Ø¡×¤Î°úÍÑʸ¸¥p119¤«¤éÏÀʸ¤ò¸¡º÷¤·¤Æ¤¤¤¿¡£