[[ºî¶ÈÆü»ï]]
Ìܼ¡
#contents();
²áµî¤ÎÆüµ
-[[./¼«¼ç²ÝÂê]]
-[[./¥Þ¥¤¥³¥ó¥Ú]]
-[[./2009ǯÅÙ]]
[[¤Ä¤¯¤Ã¤¿¤â¤Î>./¤Ä¤¯¤Ã¤¿¤â¤Î]]
*¤´°Õ¸« [#y42b8a4b]
- main.lis¤Ï¥Ç¥Þ¥ó¥°¥ë²½¤µ¤ì¤¿¥·¥ó¥Ü¥ë¤ò½Ð¤·¤Æ¤ë¤È»×¤ï¤ì¤Þ¤¹¤ë¡£ -- [[nishino]] &new{2010-06-11 (¶â) 00:40:32};
- PSoC¤Ë¤Ä¤¤¤Æ¤ë¤ÎC¥³¥ó¥Ñ¥¤¥é¤À¤«¤é¡¢¥Ç¥Þ¥ó¥°¥ë¤Ê¤ó¤«¤¢¤ë¤ï¤±¤Ê¤¤¤¸¤ã¤óorz
¤È¤¤¤¦¤ï¤±¤Ç¸«¤¿¤È¤³¤í¡¢main.lis¤Ïmain.o¤Î¥¢¥»¥ó¥Ö¥ê¤Ç¤·¤¿¡£(¥×¥í¥¸¥§¥¯¥È̾).lst¤Ï¼Â¹Ô²Äǽ¥Õ¥¡¥¤¥ë¤Î¥¢¥»¥ó¥Ö¥ê¤Ç¤·¤¿¡£ -- [[nishino]] &new{2010-06-14 (·î) 01:32:05};
- ¤Ê¤ë¤Û¤É¡£¤Æ¤³¤È¤Ïmain.c¤Ç½ñ¤¤¤¿Éôʬ¤¬¤É¤¦¥¢¥»¥ó¥Ö¥ê¤Ë¤Ê¤Ã¤Æ¤ë¤Î¤«¤Ê¡Á¤Ã¤Æ»×¤Ã¤¿¤émain.lis¤ò¤ß¤ì¤Ð¤¤¤¤¤Î¤Í¡£ -- [[komatsubara]] &new{2010-06-17 (ÌÚ) 21:03:45};
- ¥Õ¥é¥°¤Îȿž(6/10)¤Ã¤Æ¡¢flg=1-flg ¤¸¤ã¤À¤á¤Ç¤·¤ç¤¦¤«¡©»ä¤Ï¤¤¤Ä¤â¤³¤¦¤ä¤Ã¤Æ¤Þ¤¹¡£ -- [[akita]] &new{2010-06-29 (²Ð) 23:04:26};
- ¢¬¤½¤ÎȯÁۤϤʤ«¤Ã¤¿¤Ç¤¹¡¡¥Õ¥é¥°½èÍý¤Ê¤é¤½¤ÎÊý¤¬¥¹¥Þ¡¼¥È¤ÇÍý²ò¤·¤ä¤¹¤¤¤Ç¤¹¤Í¡£ -- [[komatsubara]] &new{2010-07-02 (¶â) 00:27:43};
- ²¶¡¢¾ºÅ·¤Ê¤¦¡£È¿±þ¤¬°¤¤¤Ê¤éCds¤È¥È¥é¥ó¥¸¥¹¥¿¤Çºî¤ë¤È¤¤¤¦¼ê¤â¡£ -- [[nishino]] &new{2010-07-11 (Æü) 20:09:16};
- ¤ä¤ä¸Å¤¤ÏäǤ¹¤¬¡¢AMUX¤ÇÀÚ¤êÂؤ¨¤Æ¤Î¿ÅÀADC¤ÎÏäϡ¢¾ðÊó½èÍý³Ø²ñ»ï¤Î½©ÅĤÎPSoCµ»ö¤ËºÜ¤Ã¤Æ¤Þ¤¹¤è¡£ -- [[akita]] &new{2011-11-26 (ÅÚ) 01:12:43};
#comment();
*11/25 ½©·î¤Î¥ª¥·¥í¥¹¥³¡¼¥×¥¥Ã¥È [#w3384439]
¤³¤ì¢ªhttp://akizukidenshi.com/catalog/g/gK-04279/
¼ã´³¹â¤¤¤±¤É¡¢ÇòÈ´¤¤ÎÊý¤¬¤«¤Ã¤³¤¤¤¤¤«¤é¤Í¡ª
¤³¤Á¤é¢ªhttp://ynk.jp/electronics/kit/oscilloscope/index.html
¤È¡¢¤½¤³¤«¤é¤Î¥ê¥ó¥¯¤ò»²¹Í¤Ë¤Ï¤ó¤ÀÉÕ¤±¡£
¤À¤¤¤Ö¥Ï¡¼¥É¥¦¥§¥¢¤Î¥Ð¡¼¥¸¥ç¥ó¤¬¾å¤¬¤Ã¤Æ¤¤¤ë¡©¤Î¤Ç¡¢ÀâÌÀ½ñ¡¦»²¹ÍHP¤ò¿ï»þÆɤßÊѤ¨¤Ê¤¬¤é¤Ï¤ó¤ÀÉÕ¤±¡£
¤¢¤Ã¤È¤¤¤¦´Ö¤Ë´°À®¡£¥Æ¥¹¥È¿®¹æ¤Î500Hz¤ÎÊý·ÁÇɤ⤤줤¤Ë¼è¤ì¤Æ¤ë¡£
¤·¤«¤·¡¢¥È¥ê¥¬¤¬¤É¤³¤Çµ¯¤³¤Ã¤Æ¤¤¤ë¤Î¤«¤¬Ê¬¤«¤é¤Ê¤¤¡£¥È¥ê¥¬¤ÎÅÅ°µ¤Ï·è¤á¤ì¤ë¤ó¤À¤±¤É¡¢¤½¤ì¤¬²£¼´¾å¤Î¤É¤Î¾ì½ê¤Ê¤Î¤«É½¼¨¤µ¤ì¤Ê¤¤¤Î¤Ç¡¢¤Ê¤ó¤«Íî¤ÁÃ夫¤Ê¤¤¡£
¤¢¤È¡¢±£¤·¥³¥Þ¥ó¥É¡©¤È¤·¤Æ¡¢
-PC¤ØÇÈ·ÁÁ÷¿®
--HOLDÃæ¤ËLEBEL¥Ü¥¿¥ó¤Ç¡¢UART¤ò»È¤Ã¤ÆPC¤ËÇÈ·Á¤òÁ÷¿®¤Ç¤¤ë¡£
--¥Ñ¥½¥³¥ó¤ÏXMODEM(CRC)¤Ç¼õ¿®¤·¤Þ¤¹¡¢²èÁü·Á¼°¤ÏBMP¤Ç¤¹¡£
--ÄÌ¿®»ÅÍͤϡ¢38400bps¡¢¥Ç¡¼¥¿8bit¡¢¥¹¥¿¡¼¥È¡¦¥¹¥È¥Ã¥×¥Ó¥Ã¥È1bit¡¢¥Ñ¥ê¥Æ¥£Ìµ¤·¡¢¥Õ¥í¡¼À©¸æ̵¤·
-FFTµ¡Ç½
--NORMALÃæ¤Ë¡¢MODEĹ²¡¤·
¼þÇÈ¿ô¥«¥¦¥ó¥¿¤È¤«¤â¤Ä¤¤¤Æ¤¤¤Æ¡¢5000±ß¼å¤Ç¡¢PC¤ËÇÈ·Á¤âÊݸ¤Ç¤¤Æ¡¢·ë¹½¤ªÆÀ¡ª
&ref(OCR.jpg);
*7/14 Analog MUX [#x4ec6d93]
PSoC¤ÎADÊÑ´¹¤Ï¡¢Â¿¤¯¤Æ¤âTRIADC¤Î3ÅÀ¤·¤«¤Ç¤¤Ê¤¤¡£
¤·¤«¤·¡¢MUX¤ÇÇÛÀþ¤òÀÚ¤êÂؤ¨¤Æ¤ä¤ì¤Ð¡¢¤½¤ì°Ê¾å¤ÎÅÀ¿ô¤òÊÑ´¹¤Ç¤¤ë¡£¤â¤Á¤í¤óMUX¤òÀÚ¤êÂؤ¨¤ë¤Î¤Ç¡¢Æ±»þ¤Ë¤Ï¬Äê¤Ç¤¤Ê¤¤¡£AMUX4¤Ç4ÅÀ¤ÎMUX¤Ë¤Ê¤ë¡£
°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ì¤Ð¤¤¤¤¡£
main(){
unsigned char ADC_ALU_No[]={AMUX4_PORT0_7,AMUX4_PORT0_5,AMUX4_PORT0_3,AMUX4_PORT0_1};
AMUX4_Start();
while(1){
AMUX4_InputSelect(ADC_ALU_No[(++i)&3]);
ADCINC_GetSamples(1);
while(!ADCINC_fIsDataAvailable());
ADC_result[i]=ADCINC_iClearFlagGetData();
}
}
MUX¤¬ÊѲ½¤·¤¿Ä¾¸å¤ËADÊÑ´¹¤·¤¿¤é¡¢Ãͤ¬¤Õ¤é¤Ä¤¯¤«¤Ê¡©¤È»×¤Ã¤¿¤±¤É¤½¤ó¤Ê¤³¤È¤Ï̵¤«¤Ã¤¿¡£
http://shokai.org/blog/archives/5272
*7/14 itoa [#h5642dff]
PSoc¤ÇÍ·¤ó¤Ç¤¤¤ë¤È¡¢ÊÑ¿ô¤ÎÃæ¿È¤ò¸«¤¿¤¤»þ¤¬¤è¤¯¤¢¤ë¡£
ADÊÑ´¹¤Î·ë²Ì¤È¤«¡¢forʸ¤¬¤Á¤ã¤ó¤ÈÆ°¤¤¤Æ¤¤¤ë¤«¡¢¤È¤«¡£
¤·¤«¤·UART_1_PutChar(d);
¤À¤È£±Ê¸»ú¤·¤«É½¼¨¤Ç¤¤Ê¤¤¤·¡¢¤½¤â¤½¤â¿ô»ú¤Ç¤·¤«É½¤»¤é¤ì¤Ê¤¤¡£Ê¸»ú¤Çɽ¼¨¤µ¤»¤è¤¦¤Ë¤â¡¢Ê¸»ú¥³¡¼¥É¤ËÊÑ´¹¤È¤«¤·¤Ê¤¤ã¹Ô¤±¤Ê¤¤¡£
¤½¤ó¤Ê»þ¡¢itoa´Ø¿ô¤È»È¤¦¤ÈÊØÍø¡£BYTE·¿¤Î¿ô»ú¤ò¤½¤ì¤ËÂФ¹¤ëʸ»úÎó¤Ë¤·¤ÆÁ÷¿®¤·¤Æ¤¯¤ì¤ë¡£
£²£µ£µ¤È¤¤¤¦¿ô»ú¤ò¡¢2¤È£µ¤È£µ¤È¤¤¤¦Ê¸»ú£³¤Ä¤Îʸ»úÎó¤Ë¤·¤Æ¤¯¤ì¤ë¡£
#include <stdlib.h>
char line[3];
main(){
TX8_PutString(itoa(line,data,10));
}
¤È¤¹¤ë¤È¡¢Ê¸»ú¥³¡¼¥É¤ËÊÑ´¹¤·¤Æ¤¯¤ì¤¿·ë²Ì¤¬Á÷¿®¤µ¤ì¤ë¤Î¤Ç¡¢¤½¤Î¤Þ¤Þ¸«¤ë¤³¤È¤¬¤Ç¤¤ë¡£
¡ô°ìÈÌŪ¤ÊitoaÌ¿Îá¤ÎÂè1°ú¿ô¤ÈÂè2°ú¿ô¤¬¡¢psoc¤Ç¤ÏµÕ¤é¤·¤¤
Î㤨¤Ð¤³¤ó¤Ê¥×¥í¥°¥é¥à¤ò½ñ¤¯¤È¡¢
for(i=0;i<4;i++){
TX8_PutString(itoa(line,i,10));
TX8_CPutString(":");
TX8_PutString(itoa(line,data[i],10));
if(i==3){
TX8_PutCRLF();
}else{
TX8_CPutString(" ");
}
}
¤³¤ó¤Ê½ÐÎϤ¬½Ð¤Æ¤¯¤ë¤Î¤Ç¡¢¥Ç¥Ð¥Ã¥°¤¬³Ú
0:255 1:0 2:255 3:0
*05/10 c328¥«¥á¥é [#i1badecd]
»²¹Í¤Ë¤Ê¤ê¤½¤¦¤Ê¥µ¥¤¥È
http://blog.goo.ne.jp/mimipsoc/e/e7ce7d266cba4fbca015202c01370866
http://arms22.blog91.fc2.com/?tag=C328
http://arms22.blog91.fc2.com/blog-entry-261.html
*1·î05Æü HS15P ¼¾ÅÙ¥»¥ó¥µ¡¼ [#pc023695]
¬Äê²óÏ©Îã¤ò¸«¤¿»þ¤Ï°¢Á³¤È¤·¤¿¤±¤É¡¢¤³¤ì¤ò»È¤¨¤Ð´Êñ¤Ë¤Ê¤ë¡¦¡¦¤«¤Ê
http://homepage3.nifty.com/sudamiyako/zk/hs15/hs15.htm
*11·î12Æü¡¡¥¯¥í¥Ã¥¯¤¿¤¯¤µ¤ó [#a6a036ff]
¢½ñ¤¤Þ¤·¤¿
[[PSoCÆþÌ硧¥¯¥í¥Ã¥¯¤¿¤¯¤µ¤ó]]
*7·î11Æü¡¡Ì®Çï [#e412c529]
½©·î¥Ñ¥ë¥¹¤ò%%¤Ñ¤¯£ô£ô%%»²¹Í¤Ë¡¢Ì®Çï¤ò¬¤Ã¤Æ¤ß¤¿¡£
¥Õ¥©¥È¥ê¥Õ¥ì¥¯¥¿¤Ë¤ÏPRP-220¡¢¥¢¥ó¥×¤ÎÁýÉýΨ¤Ï8ÇÜ¡£
&ref(myaku.jpg);
µÕ»»¤¹¤ë¤Ë¡¢Ì®ÇÈ·Á¤Ï50mVp-p¤°¤é¤¤¡©
»Ø¤ÎÅö¤Æ¤ë¾ì½ê¡¢Åö¤Æ¤ë¶¯¤µ¤¬¤¹¤´¤¤Æñ¤·¤¯¤Æ¡¢¤Ê¤ì¤Ê¤¤¤È¤¤ì¤¤¤ÊÌ®ÇÈ·Á¤¬½Ð¤Æ¤³¤Ê¤¤¡£
¥ª¥·¥í¸«¤Ê¤¬¤é¤¸¤ã¤Ê¤¤ã̵Íý¡¦¡¦
¥Þ¥¤¥³¥ó¤Ú¤Ë¤ÏÆñ¤·¤¤¤«¤Ê¤¡¡¦¡¦
*7·î1Æü [#t8b2b6d9]
** PSoCÄã¾ÃÈñÅÅÎϲ½ [#n845bc70]
¥¢¥Ê¥í¥°¥Ö¥í¥Ã¥¯¤ò»È¤Ã¤Æ¤¤¤Ê¤¤»þ¡¢
global resourece¤Î¡¢analog power¤ò¡¢All Off¤Ë¤¹¤ë¤È¡¢
¥¹¥¤¥Ã¥Á¥É¥¥ã¥Ñ¥·¥¿¤ò¤ä¥ê¥Õ¥¡¥ì¥ó¥¹ÅÅ°µ¸»¤ÎÅŸ»¤òÍî¤È¤¹¡Ê?¡Ë¤Î¤Ç¤½¤Îʬ¾ÃÈñÅÅή¤¬¸º¤ë¤é¤·¤¤¡£
Í׼¬
http://dr.matrix.jp/psoc3.html
**¥Ñ¥¹¥³¥ó [#p40d6a8c]
¥Þ¥¤¥³¥ó¤Î²£¤Ë¤Ï¥Ñ¥¹¥³¥ó¤¬É¬Íסª¤Ã¤Æ¤³¤È¤ÇÌÕÌÜŪ¤Ë0.1uF¤ò¤Ä¤Ê¤¤¤Ç¤¤¤¿¤±¤É¡¢
¤½¤Î¾ÜºÙ¤ÊÍýͳ¤Ï¡¢
-ÅŸ»ÅÅ°µ¤Î½ÖȯŪ¤ÊÊѲ½¤òµÛ¼ý¤¹¤ë
--IC¤Ë½Ö»þŪ¤ËÅÅή¤¬Î®¤ì¤¿»þ¡¢ÅŸ»¥é¥¤¥ó¤«¤é¤Î¶¡µë¤Ç¤Ï´Ö¤Ë¹ç¤ï¤Ê¤¤¤Î¤Ç¡¢¥Ñ¥¹¥³¥ó¤«¤é¶¡µë¤¹¤ë
--ÅŸ»¥é¥¤¥ó¤ËÅÅ°µÊÑÆ°¤¬¤¢¤Ã¤¿¾ì¹ç¡¢ÊÑÆ°ð¸òήÀ®Ê¬¤ò¥³¥ó¥Ç¥ó¥µ¤ÇGND¤ËÍî¤È¤¹
-http://www.geocities.co.jp/HeartLand-Tachibana/9059/otasuke/pascon.htm
¤Ê¤¼0.1uF¤Ê¤Î¡©
-ñ¤Ë°Â¤¯¤ÆÍÆÎ̤¬¤¢¤ê¼þÇÈ¿ôÆÃÀ¤ËÍ¥¤ì¤Æ¤¤¤ë¤Î¤ÏÀÑÁØ¥»¥é¥ß¥Ã¥¯¤Î0.1u¡¡¤é¤·¤¤
-¤ß¤ó¤Ê»È¤Ã¤Æ¤¤¤ë¤«¤é¥Ç¥Õ¥¡¥¯¥È¥¹¥¿¥ó¥À¡¼¥É¤Ë¤Ê¤Ã¤¿¡©
--¤â¤Á¤í¤ó¤â¤Ã¤È¹â¤¤/Ä㤤¼þÇÈ¿ô¤Î¤¿¤á¤Ë¡¢¤¤¤í¤¤¤í¤Ê¥³¥ó¥Ç¥ó¥µ¤òÊÂÎó¤Ë·Ò¤°¤³¤È¤Ë¤³¤·¤¿¤³¤È¤Ï¤Ê¤¤
--ÅŸ»¤Ë10uF¤ÎÅų¦¥³¥ó¥Ç¥ó¥µ¤òÃÖ¤¯¤Î¤â²¦Æ»
-http://oshiete.goo.ne.jp/qa/1108642.html?order=asc
*6·î25Æü¡¡¶Ãس¤Î»ö¼Â¤Î»ö¼Â¡÷SPI [#h5be481b]
SPIM¤Î¥¯¥í¥Ã¥¯¤Î¾å¸Â¤è¤êÂ礤ʼþÇÈ¿ô¤ÇÄÌ¿®¤·¤è¤¦¤È¤·¤¿¡¢¤Î¤Ï´Ö°ã¤¤¡Ê¤¡
¥Ç¡¼¥¿¥·¡¼¥È¤ò³Î¤«¤á¤¿¤é¡¢SPIM¥â¥¸¥å¡¼¥ë¤Î¥¯¥í¥Ã¥¯¤ÎȾʬ¤Î¼þÇÈ¿ô¤¬ÄÌ¿®¤Î¼þÇÈ¿ô¤Ë¤Ê¤ë¤è¤¦¡£
¤Ä¤Þ¤ê8MHz¤ò¥¯¥í¥Ã¥¯¤ËÆþ¤ì¤Æ¤¤¤¿¤±¤É¡¢¼ÂºÝ¤ÎÄÌ¿®Â®ÅÙ¤Ï4MHz¤Ç¾å¸Â¤Ë¼ý¤Þ¤Ã¤Æ¤¤¤¿¡£
¤È¤¤¤¦¤³¤È¤Ç¡¢´ª°ã¤¤¤·¤Æ¤¤¤¿¤±¤É¡¢·ë²Ì¤È¤·¤Æ¾å¸Â¤Ë¼ý¤Þ¤ëÃͤˤʤäƤ¤¤¿¡£
¡¦¡¦¡¦Åö»þ¤Ê¤¼µ¤¤Å¤«¤Ê¤«¤Ã¤¿¡Á¡Á
*6·î21Æü¡¡¶Ãس¤Î»ö¼Â¡÷SPI [#h5be481a]
PSoC¤ÎSPIM¤Î¥¯¥í¥Ã¥¯¤Î¾å¸Â¤Ï4MHz¡£¤Ê¤Î¤Ë¡¢º£ºî¤Ã¤Æ¤¤¤ë¡Ê»È¤Ã¤Æ¤¤¤ë¡Ë¥×¥í¥°¥é¥à¤Ï¡¢8MHz¤ÇÄÌ¿®¤µ¤»¤è¤¦¤È¤·¤Æ¤¤¤¿¡£¡Ê¥ª¡¼¥Ð¥¯¥í¥Ã¥¯¡ª¡Ë
¡¦¡¦¡¦Åö»þ²¶¤Ï¤Ê¤¼µ¤ÉÕ¤«¤Ê¤«¤Ã¤¿¤ó¤À¤í¤¦¡©
¡¦¡¦¡¦¤½¤·¤Æ¡¢¤Ê¤¼Æ°¤¤¤Æ¤¿¤ó¤À¤í¤¦¡©
¡¦¡¦¡¦Â´¸¦È¯É½¤³¤ì¤Ç¤ä¤Ã¤¿¤è
¤¿¤Þ¤ËÁÇľ¤ËÆ°¤«¤Ê¤¯¤Ê¤Ã¤¿¤Î¤â¤³¤ì¤¬¸¶°ø¤Ê¤Î¤À¤í¤¦¤«¡¦¡¦¡©
¤È¤ê¤¢¤¨¤º¤·¤Ã¤«¤ê³Îǧ¤·¤Ê¤¬¤éÀ߷פò¤ä¤Ã¤Æ¤¤¤¤Þ¤¹orz
#ÄÌ¿®Â®ÅÙ¤òÍî¤È¤·¤¿¤È¤¤Ë¡¢½èÍý»þ´Ö¤¬¥Ç¥Ã¥É¥é¥¤¥ó¤òĶ¤¨¤Ê¤¤¤«¤¬Éݤ¤¡¦¡¦
[[6·î25Æü>#h5be481b]]¤ÎÆüµ¤Ø³¤¤Þ¤¹¡£
*6·î17Æü¡¡[#ned44e01]
**ECO¤Î¼þÇÈ¿ô [#w8bcddad]
¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Î¡¼¥È¤ÎAN32200¤Ë¤è¤ë¤È¡¢ECO¡Ê32.768kHz)¤Ï732Çܤµ¤ì¤Æ¡¢23.986MHz¤È¤·¤ÆIMO(=Sys Clock)¤Î¼þÇÈ¿ô¤Ë¤Ê¤ë¤è¤¦¤À¡£
¤Ä¤Þ¤ê½ã¿è¤Ê24MHz¤Ç¤Ï¤Ê¤¤¡£
¤½¤Î¤³¤È¤ò¹Íθ¤¹¤ë¤È¡¢[[6·î3Æü¤ÎÆüµ>#jc39eab7]]¤Ï¹Í¤¨Êý¤¬°ã¤Ã¤Æ¤Æ¡¢Æ°ºî¼«ÂΤÏÀµ¤·¤«¤Ã¤¿¤³¤È¤Ë¤Ê¤ë¡£
23.986M/12/200=9994.167Hz
¤Ç¡¢¤â¤¦°ìÅÙ·×»»¤·¤Æ¤ß¤ë¤È¡¢23.986MHz / 11 / 218 = 10.0026kHz
¼Â¬¤Ï10.0024kHz¤À¤Ã¤¿¡£Á°²ó¤è¤ê10kHz¤Ë¶á¤¤Ãͤˤʤä¿¡£
**ʬ¼þ·×»»¥¹¥¯¥ê¥×¥È [#w65405fa]
¥¯¥í¥Ã¥¯¼þÇÈ¿ô¤«¤é¡¢¤Û¤·¤¤¥¿¥¤¥Þ¤Î¼þÇÈ¿ô¤ò·×»»¤¹¤ë¤Î¤ÏÂçÊѤʤΤǡ¢¥¹¥¯¥ê¥×¥È¤òºî¤Ã¤Æ¤ß¤Þ¤·¤¿¡£
¤¹¤´¤¤¤ä¤Ã¤Ä¤±¤Ê¤Î¤Ç¡¢»È¤¨¤Ê¤¤¤«¤â¤Ç¤¹¤¬[[°ì±þ¸ø³«>http://merl.ec.t.kanazawa-u.ac.jp/micon-bu/index.php?plugin=attach&pcmd=open&file=clock.html&refer=komatsubara]]
*6·î10Æü [#t0c0c94c]
** PSoC¤Î¥³¥ó¥Ñ¥¤¥ë·ë²Ì [#p11e1e04]
PSoC¤Çc¸À¸ì¤Ç³«È¯¤·¤Æ¡¢¥³¥ó¥Ñ¥¤¥ë¤·¤¿·ë²Ì¤Î¥¢¥»¥ó¥Ö¥é¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡£
¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤È¿§¡¹¤Ê¥Õ¥¡¥¤¥ë¤¬½Ð¤Æ¤¯¤ë¤±¤É¤½¤Î¤Ê¤«¤Ë¡¢"main.lis"¤Ã¤Æ¤¤¤¦¤Î¤È¡¢"(¥×¥í¥¸¥§¥¯¥È̾).lst"¤Ã¤Æ¤¤¤¦¥Õ¥¡¥¤¥ë¤¬2¸Ä¤¢¤ë¡£
ξÊý¤È¤âÃæ¿È¤Ï¥¢¥»¥ó¥Ö¥é¤Ã¤Ý¤¤¤ó¤À¤±¤É¡¢¤½¤ì¤¾¤ì¤É¤¦¤¤¤¦°ÕÌ£¤Ê¤ó¤À¤í¤¦¡¦¡¦?
**¥Õ¥é¥°¤Î½èÍý [#r5fff154]
³ä¤ê¹þ¤ß¤Ç¥Õ¥é¥°¤ò½èÍý¤·¤¿¤¤¤Ã¤Æ¤¤¤¦¾ìÌ̤Ϥ褯¤¢¤ë¡£
//¤½¤ì¤¾¤ì¡¢flg¤ÎÃͤ¬0¤Ê¤é1¤Ë¡¢1¤Ê¤é0¤Ë¤¹¤ë½èÍý
flg = ++flg % 0x02;
flg = ++flg & 0x01;
¤½¤ì¤¾¤ì¥¢¥»¥ó¥Ö¥é¤Ç¸«¤Æ¤ß¤ë¤È¡¢
flg = ++flg&0x01;
--------
add [_flg],1
and [_flg],1
flg = ++flg%0x02;
--------
mov A,[_flg]
add A,1
mov [__r0],A
mov [_flg],A
mov A,2
push A
mov A,[__r0]
push A
xcall __divmodu_8X8_8
add SP,-1
pop A
mov [_flg],A
¤È¡¢Á´Á³ÊѤï¤Ã¤Æ¤¤Æ¤¤¤¿¡£
¥¿¥¤¥Þ³ä¤ê¹þ¤ß¿ô¤ò¥«¥¦¥ó¥È¤¹¤ë¤È¤¤È¤«¤â(2¤Î¤Ù¤¾è¤Î»þ¤À¤±¤À¤±¤É)¸å¼Ô¤¬»È¤¨¤½¤¦¡£
*6·î8Æü [#q2a741c3]
** _BV() [#n6770bba]
AVR¥Þ¥¤¥³¥ó¤ÎC¸À¸ì¤ÎÊý¸À(?)¤Ë¡¢_BV(bit)¤Ã¤Æ¤¤¤¦¥Þ¥¯¥í¤¬¤¢¤ë¡£
¤³¤ì¤Ï¡¢
#define _BV(bit) (1 << (bit))
¤È¤¤¤¦É÷¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
¤³¤ì¡¢¼Â¤Ï¤¹¤Ã¤´¤¤ÊØÍø¡£PSoC¤Ç¤Ï¥Ç¥Õ¥©¥ë¥È¤ÇÄêµÁ¤µ¤ì¤Æ¤Ê¤¤¤Î¤Ç¡¢²¶¤Ï¼«Ê¬¤ÇÄêµÁ¤·¤Æ»È¤Ã¤Æ¤ë¡£
PRT1DR |= 0x82;
¤Ã¤Æ½ñ¤¤¤Æ¤¢¤ë¤È¤Ê¤ó¤Î¤³¤Ã¤Á¤ã¡©¤Ã¤Æº®Í𤷤Ƥ·¤Þ¤¦¡£¤À¤±¤É¡¢
PRT1DR |= _BV(7)|_BV(1);
¤Ã¤Æ½ñ¤¯¤È¡¢¤¢¤¡¡¢1¥Ó¥Ã¥ÈÌܤÈ7¥Ó¥Ã¥ÈÌܤò1¤Ë¤·¤¿¤¤¤ó¤À¤Ê¡£¤Ã¤Æ¤Ñ¤Ã¤È¸«¤Æ¤ï¤«¤ë¡£
¤Û¤«¤Ë¤â¡¢
#define LED_blue 3
...
PRT1DR |= _BV(LED_blue);
PRT1DR &= ~_BV(LED_blue);
¤È¤«½ñ¤¯¤È¡¢¤¢¤¡¡¢ÀÄ¿§LED¤òÉÕ¤±¤¿¤¤/¾Ã¤·¤¿¤¤¤ó¤À¤Ê¤Ã¤Æ¤¹¤°¤ï¤«¤ë¡£
PSoC¤Ï2¿Ê¿ô¤¬»È¤¨¤ë¤±¤É¡¢Â¾¤Î¥Þ¥¤¥³¥ó¤Ç¤Ï»È¤¨¤Ê¤«¤Ã¤¿¤ê¡¢2¿Ê¿ô¤Ç¤â8¥±¥¿¤Ë¤Ê¤ë¤ÈÆɤߤˤ¯¤¤¤«¤é¡¢¤¢¤Þ¤ê»È¤Ã¤Æ¤Ê¤¤¡¦¡¦
¾¤Ë¤â¡¢AVR¤Ë¤Ï¥Ó¥Ã¥ÈÁàºî¤ò¤¹¤ë¤Î¤Ë³Ú¤Ê¥Þ¥¯¥í¤¬¤¤¤í¤¤¤í¤¢¤ë¡£
http://avrwiki.jpn.ph/wiki.cgi?page=Getting+Started+Notes+-+Ports#p9
** Timer¤Î¼þ´ü [#yc76b746]
dataseet¤Ë¤è¤ë¤È¡¢
OutputPeriod = sourceClockPeriod x (periodRegisterValue + 1)
¤È¤Ê¤Ã¤Æ¤¤¤ë¡£
º£¤¿¤È¤¨¤Ð¡¢Sysclock¤ò24MHz¡¢sourceClockPeriod(VC1¤ÎÃÍ)¤ò12¤Î¤È¤¡¢
10kHz¤¬¤Û¤·¤¤»þ¤Ï¡¢periodRegisterValue¤ò199¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
º£¤Þ¤Ç200¤òÆþ¤ì¤Æ¤¤¤¿¤±¤É¡¢¸·Ì©¤Ë¤Ï´Ö°ã¤¤¤À¤Ã¤¿¤è¤¦¤À¡¦¡¦orz
¼Â¬¤·¤Æ¤ß¤ë¤È¡¢
|period|frequancy[kHz]|
|200|9.94438|
|199|9.99410|
Ìó50Hz¤º¤ì¤Æ¤¤¤ë¡£(10kHz/200= 50Hz)
*6·î3Æü¡¡PSoC¤Ç¿å¾½¤ò»È¤¦ [#jc39eab7]
PSoCÆ⢤Υ¯¥í¥Ã¥¯¤À¤±(ILO)¤À¤È¡¢ºÇÂç+/-2.5%¤º¤ì¤ëÀºÅÙ(accuracy)
¤³¤³¤Ç¡¢³°ÉÕ¤±¤Î¿å¾½¤ò»È¤¦¤È¡¢¤µ¤é¤Ë¹âÀºÅÙ(accuracy)¤Ë¤Ê¤ë¡¢¤Ï¤º¡£
¤ä¤êÊý¤ÏTechnical Reference Manual(http://www.cypress.com/?rID=3208 )¤Ë½ñ¤¤¤Æ¤¢¤ë¤±¤É¡¢
Application Note¤ÎAN2027(http://jp.cypress.com/?id=1029&rtID=5&rID=26009 )¤ÎÊý¤¬¾Ü¤·¤¤¡£
#¤È¤¤¤¦¤«ºÇ½éTRM¤À¤±¸«¤Æ¤¿¤é¥Ï¥Þ¤Ã¤¿¡¦¡¦
**¼ê½ç [#y2c6589f]
P1[0]¤ÈP1[1]¤Î´Ö¤Ë¿å¾½¤òÃÖ¤¡¢¤½¤ì¤¾¤ì¤Îü»Ò¤«¤é¥³¥ó¥Ç¥ó¥µ¤òÉÕ¤±¤ÆVdd¤Ë·Ò¤°¡£
Designer¤Ç¡¢¤½¤ì¤¾¤ì¤Î¥Ô¥ó¤ÎÀßÄê¤ò°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¡£
| |Select|Drive|
|P1[0]|XtalOut|Hight Z|
|P1[1]|XtalIn|Hight Z|
¥°¥í¡¼¥Ð¥ë¥ê¥½¡¼¥¹¤òÊѹ¹
|32k_Select|External|
|PLL_Mode|Ext_Lock|
·ëÏÀ¤«¤é¸À¤¦¤È¡¢P1[1]¦¤Ë12pF¡¢P1[2]¦¤Ë100pF¤ò¤Ä¤Ê¤²¤ë(20 Pin SSOP¤Î¾ì¹ç¡Ë¡£
PLL¤ò»È¤ï¤Ê¤¤»þ¤Ï¡¢TRM¤Ë½ñ¤¤¤Æ¤¢¤ë¤è¤¦¤ËC1¤ÈC2(ð20pF)¤Ç¤¤¤¤¤ó¤À¤±¤É¡¢
¼ÂºÝ»È¤¦¤È¤¤ÏPLL¥â¡¼¥É¤Ç»È¤¦¡Ê¤é¤·¤¤¡Ë¡£
#¤³¤³¤ÏÆɤó¤Ç¤Æ¤â¤Ê¤ó¤È¤Ê¤¯¤·¤«Íý²ò¤Ç¤¤Ê¤«¤Ã¤¿¡¦¡¦
**Ãí°ÕÅÀ [#o8370c9a]
P1[0]¤ÈP1[1]¤Ï¡¢¥×¥í¥°¥é¥à¤ò½ñ¤¹þ¤à¥Ô¥ó¤Ç¤â¤¢¤ë¡£¿å¾½¤ò¤Ä¤Ê¤²¤¿¤Þ¤Þ¤Ç¤â¥×¥é¥°¥é¥à¤Ï½ñ¤¹þ¤á¤ë¡£
¤¿¤À¤·¡ª¼Â¹Ô¤µ¤»¤ë¤È¤¤ÏMiniProg¤Ï³°¤µ¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£MiniProgÍÆÎÌÉé²Ù¤¬Â礤¹¤®¤ë¡©¤Î¤«¿å¾½¤¬¤·¤Ã¤«¤êȯ¿¶¤Ç¤¤Ê¤¤¡£
&ref(miniprog.jpg,,50%);
**·ë²Ì [#r6ebc1b1]
10kHz¤´¤È¤Ë¥Ñ¥ë¥¹¤ò½Ð¤·¤Æ¤ß¤¿¡£¥ª¥·¥í¥¹¥³¡¼¥×¤Î¼þÇÈ¿ô¥«¥¦¥ó¥¿¤Îɽ¼¨¡£
|ILO(Æâ¢)|10.07kHz|
|ECO(¿å¾½)|9.94434kHz|
-Accuracy¤ÏÂçÂÎƱ¤¸Ãͤˤʤä¿¡£
--#¿å¾½¡Áü»Ò´Ö¤Î´ðÈĥ쥤¥¢¥¦¥È¤ò¤¦¤Þ¤¯¤¹¤ì¤Ð¤â¤Ã¤È¤¤¤¤Ãͤ¬½Ð¤¿¡©
-Precision¤Ï°ã¤¤¤¬½Ð¤Æ¤¤¿¡£
--ILO¤¬10.070kHz¡Á10.074kHz¤ÎÃͤò¤¦¤í¤¦¤í¤·¤Æ¤¤¤¿¤Î¤ËÂФ·¡¢ECO¤Ï9.94434kHz¤Ç¤º¤Ã¤È°ìÄê¤À¤Ã¤¿¡£
Äɵ¢ª[[6·î17Æü¤ÎÆüµ¤Ø>#ned44e01]]
¹Í¤¨Êý¤¬°ã¤Ã¤Æ¤Æ¡¢Æ°ºî¼«ÂΤÏÀµ¤·¤¤¤Ç¤¹¡£
**»²¹Í [#w4bda9c7]
¤³¤³¤Î¥µ¥¤¥È¤¬¤¹¤´¤¯¤Þ¤È¤Þ¤Ã¤Æ¤Þ¤·¤¿¡£http://bluefish.orz.hm/sdoc/psoc3.html
*6·î1Æü [#u830c0a1]
**¥ª¥·¥í¥¹¥³¡¼¥×(TDS2024B)¤ÎUSB¤Ø¤Î¥Ç¡¼¥¿¤ÎÊݸ [#tfd4027e]
ÀèÀ¸¤Î¥Ú¡¼¥¸¡Êhttp://akita11.jp/plan/osc/¡¡¢ª¡¡Know-hows / Tips¡Ë¤Ë½ñ¤¤¤Æ¤¢¤Ã¤¿¡£
¼ê»ý¤Á¤Î¡¢Trancend 2GB¤Ç¤Ï¤Á¤ã¤ó¤ÈÇÈ·Á¤òÊݸ¤Ç¤¤Þ¤·¤¿¡ª
**PSoC timer8¤Î³ä¤ê¹þ¤ß¼þ´ü [#md49642f]
¥°¥í¡¼¥Ð¥ë¥ê¥½¡¼¥¹
SysClk 24MHz
CPU_Clock CycClk/1
//³ä¤ê¹þ¤ß´Ø¿ô
#pragma interrupt_handler Timer8_ISR
void Timer8_ISR(){
//LED¥â¥¸¥å¡¼¥ë
LED_On();
LED_Off();
}
¾å¤Î¾ò·ï¤Î»þ¡¢¥¿¥¤¥Þ³ä¤ê¹þ¤ß¤Î¼þ´ü¤Î¾å¸Â¤ÏÌó46kHz¤À¤Ã¤¿¡£
¤³¤ì°Ê¾å¤Î¼þ´ü¤Ç³ä¤ê¹þ¤ß¤ò¤«¤±¤è¤¦¤È»×¤Ã¤Æ¤â¡¢46kHz¤ÇƬÂǤÁ¡£Î±°Õ¤·¤Þ¤·¤ç¤¦¡£
IP:133.28.96.26 TIME:"2011-11-26 (ÅÚ) 01:12:43" REFERER:"http://merl.ec.t.kanazawa-u.ac.jp/micon-bu/index.php?komatsubara" USER_AGENT:"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2"