ããã«ã¡ã¯
ååã®èšäºã§ã¯ãBLEã¹ã¿ãã¯ã®æå°éã®æ©èœã»ããã«ããã«æ £ãã2ã€ã®ãªã¢ãŒãããã€ã¹ãæ¥ç¶ããæåã®ãããžã§ã¯ããäœæããŸããã 次ã«ãnRF51822ã®ããŒããŠã§ã¢ãã€ãŸãCortex M0ã³ã¢ïŒ256kB / 128kBãã©ãã·ã¥+ 32kB / 16kB RAMïŒãåããARMã¢ãŒããã¯ãã£ã«åºã¥ã32ããããã€ã¯ãã³ã³ãããŒã©ãŒã«æ³šæãåãããšãã§ãã
ãã®èšäºã§ã¯ãããããBluetooth Low Energyããã€ã¹ã®äž»ãªæ©èœã®1ã€ã§ããæéãè²»ãããããšæããŸã-çãšãããããŠADCãã¿ã€ããŒãèå³æ·±ãPPIãããã¯ãªã©ã®æãäžè¬çã«äœ¿çšãããåšèŸºæ©åšã«ã€ããŠãèããŠããŸãã SPIãI2CãUARTãªã©ãé »ç¹ã«äœ¿çšãããæ®ãã®åšèŸºæ©åšã«ã€ããŠã¯ã以äžã®èšäºã§æ€èšããŸãã
ããã§ã¯å§ããŸãããã
çé»åã¢ãŒã
äžèšã®ããã«ãBLEãããã®éèŠãªæ©èœã®1ã€ã¯äœæ¶è²»é»åã§ãããå®éã«ããŸããŸãªSMARTããã€ã¹ã§ã®äœ¿çšã決å®ããŸãã BLEã»ã°ã¡ã³ãã®ãªãŒããŒã®1ã€ã§ãããã«ãã£ãã¯ã»ãã³ã³ãã¯ã¿ãŒãšãã®nRF51822ãæäŸãããã®ãæ€èšããŠãã ããã
ããŒã¿ã·ãŒãã«ãããšãnRF51822ã«ã¯2ã€ã®äž»èŠãªåäœã¢ãŒããããããã®ãã¡ã®1ã€ã¯éæ¢ã¢ãŒãã§ãããçãšãã®ãµãã¢ãŒããåãæ¿ããå¯èœæ§ããããŸãã
ã·ã¹ãã ãªã³ã¢ãŒã
ã·ã¹ãã ON-ã³ã³ãããŒã©ãŒãå®å šã«æ©èœãã宣èšããããã¹ãŠã®æ©èœãå®è¡ããã¡ã€ã³ã¢ãŒãã ã³ã³ãããŒã©ã¯WFIããã³WFEåœä»€ãä»ããŠã¹ãªãŒãã¢ãŒãã«å ¥ããŸããæåã®ã±ãŒã¹ã§ã¯ãNVICã§èš±å¯ãããå²ã蟌ã¿ã§ãŠã§ã€ã¯ã¢ãããçºçãã2ã€ç®ã§ã¯ãNVICã§èš±å¯ãããŠãããã©ããã«ããããããã€ãã³ããããŠã§ã€ã¯ã¢ãããçºçããŸãã ã·ã¹ãã ONã¯ãã¹ãªãŒãã¢ãŒãã§ã¯2ã€ã®ç¶æ ïŒäœé»åãšäžå®ã®åŸ æ©æéïŒã«ãªãå¯èœæ§ãããããšã§æ³šç®ã«å€ããŸãã
äœé»å -äœé»åæ¶è²»ã¢ãŒããé»å管çã·ã¹ãã ãæé©åããããšã§å®çŸãããŸãã ãã®å Žåãã¬ã®ã¥ã¬ãŒã¿ãŒã®äžéšïŒè©³çŽ°ã«ã€ããŠã¯è£œåä»æ§ãåç §ïŒãšæ°Žæ¶æ¯ååããªãã«ãªããŸããããã«ãããã«ãŒãã«ã®èµ·åã«å¿ èŠãªæéééãé·ããªããPPIã¢ãžã¥ãŒã«ã®èŠæ±ãžã®å¿çãé ããŸãïŒPPIã¢ãžã¥ãŒã«ã®è©³çŽ°ã«ã€ããŠã¯ä»¥äžãåç §ïŒããã®ã®ã£ããã¯åžžã«äžå®ã§ã¯ãªããäžæã®åå ãšãªã£ãåšèŸºæ©åšã«ãã£ãŠç°ãªãå ŽåããããŸãã äœé»åãå ¥åããã«ã¯ã LOWPWRã¬ãžã¹ã¿ã§ã¿ã¹ã¯ãã¢ã¯ãã£ãã«ããå¿ èŠããããŸãã ãã®ã¢ãŒãã¯æšæºã§ããããªã»ããåŸã«ã³ã³ãããŒã©ãé 眮ãããã¢ãŒãã§ãã
Constant Latencyã¯ã以åã®ã¢ãŒããšã»ãŒåãã¢ãŒãã§ããå¯äžã®éãã¯ãã«ãŒãã«ã®ã¬ã€ãã³ã·ãšPPIã¢ãžã¥ãŒã«èŠæ±ãžã®å¿çãäžå®ã§æå°ã§ããããšã§ãã ãã ããããã¯ãæå°æ¶è²»ã¢ãŒãã§ã¯ãããŸãããæ°Žæ¶æ¯ååããªã³ã®ãŸãŸãªã®ã§ãæ¶è²»é»åãé«ããªããŸãã
äžå®ã®ã¬ã€ãã³ã·ãå ¥åããã«ã¯ã CONSTLATã¬ãžã¹ã¿ã§ã¿ã¹ã¯ãã¢ã¯ãã£ãã«ããå¿ èŠããããŸãã
System ON Low Powerã¢ãŒãã§ã®æ¶è²»ã¯ãã¢ã¯ãã£ããªã¡ã¢ãªãããã¯ã®æ°ã«çŽæ¥äŸåãã次ã®ãšããã§ãã
2.6ÎŒA -16 Kb RAMã¢ã¯ãã£ã
3.8ÎŒA -32 Kb RAMã¢ã¯ãã£ã
ã¹ãã·ã£ãªã¹ããšãã«ãã£ãã¯ã¯ãã·ã¹ãã ãªã³ã¢ãŒãã§ã®ãšãã«ã®ãŒæ¶è²»ãå€§å¹ ã«åæžããããã«ãããã€ãã®ã«ãŒã«ã«åŸãããšããå§ãããŸãã
-çµã¿èŸŒã¿ã®DC / DCã䜿çšããŸãïŒæ倧30ïŒ ã®ã²ã€ã³ïŒã
-åºåããã±ãŒãžã®ééãåºããŸãã
-å¯èœã§ããã°ãåºåããã±ãŒãžã®éãæžãããŸãã
-å¯èœã§ããã°ãç¡ç·éä¿¡æ©ã®é»åãæžãããŸãã
-ã¹ãªãŒãã¢ãŒãã«åãæ¿ããåã«ãæªäœ¿çšã®åšèŸºã¢ãžã¥ãŒã«ãåãå€ããŸãã
-éä¿¡/åä¿¡ãµã€ã¯ã«ã®å®äºåŸãSPIãTWIãUARTã¢ãžã¥ãŒã«ãç¡å¹ã«ããŸãã
ã·ã¹ãã ãªãã¢ãŒã
ã·ã¹ãã OFF-æãçµæžçãªãšãã«ã®ãŒæ¶è²»ã¢ãŒããéæãããã¢ãŒãã ãã®ã¢ãŒãã§ã¯ãã³ã³ãããŒã©ãŒã³ã¢ãç¡å¹ã«ãªãããã¹ãŠã®ããã»ã¹ãåæ¢ããŸãã ãã®å Žåã1ã€ä»¥äžã®RAMãããã¯ãã¢ã¯ãã£ãã®ãŸãŸã§ãã ãã®ã¢ãŒãã¯ãå€éšDETECTä¿¡å·ãå èµLPCOMPã³ã³ãã¬ãŒã¿ããã®ANADETECTä¿¡å·ãããã³RESETä¿¡å·ã«ãã£ãŠçµäºã§ããŸãã çµäºåŸãã·ã¹ãã ã®åŒ·å¶ãªã»ãããå®è¡ãããŸãã
ã·ã¹ãã ãªãã¢ãŒãã«å ¥ãã«ã¯ã次ã®ã¬ãžã¹ã¿ã§æ¬¡ã®æé ãå®è¡ããŸãã
1. RESETREAS-èŠéã€ãã³ããã¬ãžã¹ã¿ã«å®çŸ©ããŸãã
2. RAMONããã³RAMONB-ã¬ãžã¹ã¿ã§ã¢ã¯ãã£ããªRAMãããã¯ãå®çŸ©ããŸãã
3. SYSTEMOFF-ã¬ãžã¹ã¿ã§ã·ã¹ãã ãªãã¢ãŒããã¢ã¯ãã£ãã«ããŸãã
4.ã³ã³ãããŒã©ãŒãèµ·åãããŠããããæ§æããŸãã
SystemOFFã¹ã¿ãŒãæ©èœ
#define WAKEUP_PIN 1 void SystemOFF_active(void){ /* : */ NRF_POWER->RESETREAS = POWER_RESETREAS_OFF_Detected; /* RAM */ NRF_POWER->RAMON = POWER_RAMON_OFFRAM0_RAM0Off; /* P0.01 */ NRF_GPIO->PIN_CNF[WAKEUP_PIN] = (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos)| (GPIO_PIN_CNF_PULL_Pulldown << GPIO_PIN_CNF_PULL_Pos)| (GPIO_PIN_CNF_SENSE_High << GPIO_PIN_CNF_SENSE_Pos)| (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos); /* P0.01*/ NRF_GPIOTE->CONFIG[0] = (GPIOTE_CONFIG_MODE_Event << GPIOTE_CONFIG_MODE_Pos)| (WAKEUP_PIN << GPIOTE_CONFIG_PSEL_Pos)| (GPIOTE_CONFIG_POLARITY_LoToHi << GPIOTE_CONFIG_POLARITY_Pos); /* SystemOFF*/ NRF_POWER->SYSTEMOFF = 1; }
ãã®ã¢ãŒãã§ã®æ¶è²»ã¯ãã¢ã¯ãã£ããªã¡ã¢ãªãããã¯ã®æ°ã«çŽæ¥äŸåãã次ã®ãšããã§ãã
0.6ÎŒA-ã¢ã¯ãã£ãRAMãããã¯ãªã
1.8ÎŒA -16 Kb RAMã¢ã¯ãã£ã
3.0ÎŒA -32 KB RAMã¢ã¯ãã£ã
äžè¬ã«ãçãšãã®èå³æ·±ãã¢ãŒãã§ãããã³ã³ãããŒã©ãŒãèµ·åããããã®å¯èœæ§ã®ä¹ãããªã¹ãã®ããã«ã誰ãããããæ°ã«å ¥ãããã§ã¯ãããŸããã
A / Dã³ã³ããŒã¿ãŒïŒADCïŒ
A / Dã³ã³ããŒã¿ãŒïŒADCïŒã¯ãæãäžè¬çã«äœ¿çšããããã€ã¯ãã³ã³ãããŒã©ãŒåšèŸºæ©åšã®1ã€ã§ãã ããã«ã€ããŠã¯ããŸããŸãªæ·±ãã®ãµãŒãããŒãã£ã®èšäºãèšå€§ã«æžãããŠããããããã®åäœã®åçã説æããæå³ã¯ãããŸããã ãã ããADCã®æ§èœã®ç¹åŸŽã«æ³šæãã䟡å€ããããŸãã NRF51822ã«ã¯1ã€ã®ADCãããããã®ç¹æ§ã¯ããªãæ§ããã§ãã
-8ã€ã®ãã£ãã«+å€éšåºæºé»å§ãäŸçµŠããããã®2ã€ã®å€éšãã£ãã«ã
-解å床8.9.10ãããã
å®éãäž»ãªç¹åŸŽã«ã€ããŠèšããããšã¯ãã¹ãŠã ãã£ãã«ã¯å€éåãããŠããããšã«æ³šæããŠãã ããã åæã«ãµã³ããªã³ã°ã§ããã®ã¯1ã€ã®ãã£ãã«ããã®ã¿ã§ãããæ®å¿µãªããå€æã¢ãŒãã¯1ã€ã ãã§ãïŒåäžã®å€æïŒã ã¿ã€ããŒãšPPIã¢ãžã¥ãŒã«ã䜿çšããŠç¶ç¶çã«å®è£ ã§ããŸãããããã«ã€ããŠã¯åŸã»ã©èª¬æããŸãã
ãŸããéèŠãªãã©ã¡ãŒã¿ãŒã¯1åã®å€æã®æéã§ããããã¯ãäžéããŒã¿åŠçã§è€æ°ã®ãã£ãã«ãé£ç¶çã«å€æããå Žåã«èæ ®ããå¿ èŠããããŸãã
68ÎŒs -10ãããADC;
36ÎŒs -9ãããADC;
20ÎŒs -9ãããADCã
ã·ã³ã°ã«å€æã¢ãŒãã§ADCãã¢ã¯ãã£ãã«ããã«ã¯ã次ã®ã¬ãžã¹ã¿ã§æ¬¡ã®ã¢ã¯ã·ã§ã³ãå®è¡ããå¿ èŠããããŸãã
1. CONFIG-ã¬ãžã¹ã¿å ã®ADCã®è§£å床ã決å®ããŸãã
2. CONFIG-ã¬ãžã¹ã¿ã®åå§åšã決å®ããŸãã
3. CONFIG-ã¬ãžã¹ã¿å ã®å€æçšã®ãã£ãã«çªå·ã決å®ããŸãã
4. POWER-ã¬ãžã¹ã¿å ã®å²ã蟌ã¿ãã¢ã¯ãã£ãã«ããŸãïŒãªãã·ã§ã³ïŒã
5. æå¹ -ã¬ãžã¹ã¿å ã®ADCã«é»åãäŸçµŠããŸãã
6. TASKS_START-ã¬ãžã¹ã¿ã§å€æãéå§ããŸãã
以äžã¯ã1åã®å€æã§ADCãåæåããŠãå²ã蟌ã¿ã§çµæãåŠçããäŸã§ãã
ADCåæåé¢æ°
/* */ /* - 10 , - 1/3, - 2 */ NRF_ADC->CONFIG |= (ADC_CONFIG_RES_10bit << ADC_CONFIG_RES_Pos)| (ADC_CONFIG_INPSEL_AnalogInputOneThirdPrescaling << ADC_CONFIG_INPSEL_Pos)| (ADC_CONFIG_PSEL_AnalogInput2 << ADC_CONFIG_PSEL_Pos); /* */ NRF_ADC->INTENSET |= ADC_INTENSET_END_Enabled << ADC_INTENSET_END_Pos; /* */ NRF_ADC->ENABLE |= ADC_ENABLE_ENABLE_Enabled << ADC_ENABLE_ENABLE_Pos; /* NVIC */ NVIC_SetPriority(ADC_IRQn, 1); NVIC_EnableIRQ(ADC_IRQn); /* */ NRF_ADC->TASKS_START = 1;
ADCå²ã蟌ã¿ãã³ãã©ãŒ
/* */ #define ADC_REF 1200 #define ADC_PRESCALING 3 uint16_t adc_value, adc_value_in_mV; void ADC_IRQHandler(void){ /* , */ NRF_ADC->EVENTS_END = 0; /* */ switch(NRF_ADC->CONFIG >> ADC_CONFIG_PSEL_Pos){ case (ADC_CONFIG_PSEL_AnalogInput2): adc_value = NRF_ADC->RESULT; adc_value_in_mV = ((adc_value*ADC_REF)/1024)*ADC_PRESCALING break; /* */ default: break; } }
æå³ã®è©³çŽ°ãªèª¬æã¯ãããŸãããããŒã¿ã·ãŒããèªã人ã«ãšã£ãŠã¯èšå®ãé£ãããªãïŒã¬ãžã¹ã¿ãå°ãªãããã¹ãŠãçŽæçã§ãïŒãèªã¿ãããªã人ã«ãšã£ãŠã¯ããã®æ å ±ïŒããã³ä»¥äžã§èª¬æãããã®ïŒ ADCãå®è¡ããŠäœ¿çšããã«ã¯ååã§ãã
ã¿ã€ããŒïŒTIMERïŒ
NRF51822ã«ã¯ãã¿ã€ããŒã¢ãŒãïŒæ¯èŒïŒãšã«ãŠã³ã¿ãŒïŒãã£ããã£ïŒã®2ã€ã®ã¢ãŒãã§åäœã§ãã3ã€ã®ã¿ã€ããŒããããŸãã ãã¹ãŠã®ã¿ã€ããŒã¯8ã16ã24ã32ãããã§ãã
ã¿ã€ããŒã¢ãŒãïŒæ¯èŒïŒïŒæãäžè¬çãªã¿ã€ããŒã¢ãŒãã çŸåšã®ã«ãŠã³ã¿å€ã¯ã CC [n]ã¬ãžã¹ã¿ã®å€ãšæ¯èŒãããããã2ã€ã®å€ãäžèŽãããšã€ãã³ã/å²ã蟌ã¿ãçæããŸãã æéééã®ã«ãŠã³ãã«äœ¿çšã§ãããããæãäžè¬çã«äœ¿çšãããã¢ãŒãã
ã«ãŠã³ã¿ïŒä¿¡å·ãã£ããã£ïŒã¢ãŒãïŒå€éšãã«ã¹ãå°çãããšãã¿ã€ããŒã¯CC [n]ã¬ãžã¹ã¿ã®çŸåšã®ã«ãŠã³ã¿å€ããã£ããã£ïŒãã£ããã£ïŒããŸãã 次ã®ãã«ã¹ã§ãã¿ã€ããŒã¯åã³åãã¬ãžã¹ã¿ã®ã«ãŠã³ã¿å€ãä¿®æ£ããŸãã ãããã£ãŠãå ¥åãã«ã¹ã®åšæãŸãã¯æç¶æéãååŸã§ããŸãã èã®åãšè¡°éã®äž¡æ¹ãæããããšãã§ããŸãã éåžžã«äŸ¿å©ãªã¿ã€ããŒã¢ãŒãã
ã¿ã€ããŒã®é »åºŠã¯ã次ã®åŒã䜿çšããŠèšç®ãããŸãã
æ¯èŒã¢ãŒãã§ã¿ã€ããŒãã¢ã¯ãã£ãã«ããã«ã¯ã次ã®ã¬ãžã¹ã¿ã§æ¬¡ã®æé ãå®è¡ããŸãã
1. ã¢ãŒã -ã¬ãžã¹ã¿å ã®ã¿ã€ããŒã®åäœã¢ãŒãã決å®ããŸãã
2. ããªã¹ã±ãŒã© -ã¬ãžã¹ã¿å ã®ã¯ããã¯ä¿¡å·ã®é€æ°ã決å®ããŸãã
3. CC [n] -ã¬ãžã¹ã¿ãèªã¿åãå¿ èŠãããããã£ãã¯ãã®æ°ã決å®ããŸãã
4. POWER-ã¬ãžã¹ã¿ãŒã®ã¿ã€ããŒé»æºãæå¹ã«ããŸãã
5. TASKS_START-ã¬ãžã¹ã¿å ã®ã¿ã€ããŒãéå§ããŸãã
ã¿ã€ããŒãåæåããŠã1ç§ééã§ã«ãŠã³ãããŠã³ããããšãæ€èšããŠãã ããã 以äžã¯ã CC [n]ã¬ãžã¹ã¿ã«èšå®ãããå€ã«éãããšãã®ã¿ã€ããŒåæåé¢æ°ãšã¿ã€ããŒå²ã蟌ã¿ãã³ãã©ãŒã®é¢æ°ã§ãã
ã¿ã€ããŒåæåæ©èœ
NRF_TIMER1->POWER = 1; /* */ NRF_TIMER1->MODE = TIMER_MODE_MODE_Timer << TIMER_MODE_MODE_Pos; /* . : (16 MHz) 2 9 31250 "" */ NRF_TIMER1->PRESCALER = 9; NRF_TIMER1->CC[0] = 31250; /* */ NRF_TIMER1->INTENSET = (TIMER_INTENSET_COMPARE0_Enabled << TIMER_INTENSET_COMPARE0_Pos); /* NVIC */ NVIC_SetPriority(TIMER1_IRQn, NRF_APP_PRIORITY_HIGH); NVIC_EnableIRQ(TIMER1_IRQn); /* */ NRF_TIMER1->TASKS_START = 1;
ã¿ã€ããŒå²ã蟌ã¿ãã³ãã©ãŒé¢æ°
void TIMER1_IRQHandler(void){ /* , */ NRF_TIMER1->EVENTS_COMPARE[0] = 0; /* */ NRF_ADC->TASKS_CLEAR = 1; }
ã¯ãããã£ããã£/æ¯èŒå€ãä¿åããããã®ã¬ãžã¹ã¿ã¯4 CC [0]-CC [3]ã§ã ããã ããã«ãŠã³ãã¬ãžã¹ã¿ã¯1ã€ãããªããããé£ç¶ãã4ã€ã®çµæããã«ãŠã³ãã§ããŸããã
PPIã¢ãžã¥ãŒã«
ä»ã®ã³ã³ãããŒã©ãŒïŒSTM32ãªã©ïŒã®ã»ãšãã©ã®åæ§ã®èšäºã®ããã«ãåã¢ãžã¥ãŒã«ã«åå¥ã®ãã¹ããå²ãåœãŠãåã¬ãžã¹ã¿ã«ã€ããŠè°è«ããããšãå¯èœã§ãã£ããããã¿ã€ããŒãšADCã®æ©èœãç°¡åãã€äžå®å šã«èª¬æããçç±ã«åŸã ã«è¿ã¥ããŠããŸããããããã®...ãããŠãããã¯ãã¹ãŠéå±ã§äºæ¬¡çãªãã®ã§ãããADCãŸãã¯ã¿ã€ããŒã«é¢ããèšäºã¯å¿ èŠãªæå°éã®ç¥èããŒã¹ãæäŸãããã®ã§ãããäœåºŠãäœåºŠãäœæããæå³ã¯ãããŸããã èå³æ·±ãnRF51ã¢ãžã¥ãŒã«ãæ€èšããããã䜿çšããŠæšæºã®TIMER + ADCãã³ãã«ãå®è£ ããããšãææ¡ããŸããããã«ãããæå®ã®ãµã³ããªã³ã°åšæ³¢æ°ã§ã®é£ç¶å€æã¢ãŒããä¿èšŒãããŸãã
ãªãPPIã¢ãžã¥ãŒã«ãå¿ èŠãªã®ã§ããïŒ
PPIã¢ãžã¥ãŒã«ã¯ãã³ã³ãããŒã©ãŒã³ã¢ã®é¢äžãªãã«ã€ãã³ã/å²ã蟌ã¿ããŒã¿ã1ã€ã®åšèŸºæ©åšããå¥ã®åšèŸºæ©åšã«è»¢éããããã«å¿ èŠã§ãã ããšãã°ãRTCïŒãªã¢ã«ã¿ã€ã ã«ãŠã³ã¿ãŒïŒã®å²ã蟌ã¿ã¯ãCPUã®é¢äžãªãã§åšèŸºãŠããããããªã¬ãŒã§ããŸãã ããã«ãCPUãã¹ãªãŒããŸãã¯ãªãã®ãšãã«ãåšèŸºæ©åšéã®PPIã¢ãžã¥ãŒã«ãä»ããéä¿¡ãçºçããå¯èœæ§ããããŸãã
ãã®å Žåãã¿ã€ããŒãèšå®å€ã«éããã€ãã³ãã®çµæãšããŠããã®ã¢ãžã¥ãŒã«ã䜿çšããŠADCå€æãéå§ã§ããŸãã ãããã£ãŠãCPUã®é¢äžãªãã«ãADCã®ç¶ç¶çãªå€æãå®çŸããŸãã
ãã®ãããPPIã¢ãžã¥ãŒã«ã«ã¯4ã€ã®ã°ã«ãŒãã«ãŸãšãããã16ã®ããã°ã©ãã³ã°ãã£ãã«ããããŸãã ããã«ãã·ã¹ãã ã«ãã£ãŠæ¢ã«ããã°ã©ã ãããŠãã12ã®ãã£ãã«ããããŸãã 以äžã¯ããããã®12ãã£ãã«ã®èšå®ã§ãïŒ EEP-ã€ãã³ããåŒãèµ·ãããã€ãã³ãã®åšèŸºã®ã¢ãã¬ã¹ã TEP-ã€ãã³ãã®å Žåã«å®è¡ãããã¿ã¹ã¯ã®ã¢ãã¬ã¹ïŒã
åè¿°ããããã«ãåãã£ãã«ã®ã¢ãžã¥ãŒã«ã«ã¯2ã€ã®ã¬ãžã¹ã¿ããããŸããã€ãã³ãã¬ãžã¹ã¿ãšãã€ãã³ããçºçãããšãã«å®è¡ãããã¿ã¹ã¯ã®ã¬ãžã¹ã¿ã§ãã
PPIã¢ãžã¥ãŒã«ãã¢ã¯ãã£ãã«ããã«ã¯ã次ã®ã¬ãžã¹ã¿ã§æ¬¡ã®æé ãå®è¡ããå¿ èŠããããŸãã
1. CHENSET-ã¬ãžã¹ã¿å ã®å¿ èŠãªãã£ãã«ã§ã¢ãžã¥ãŒã«ãã¢ã¯ãã£ãã«ããŸãã
2. CH [n] .EPP-ã¬ãžã¹ã¿å ã®ã€ãã³ãã®ã¢ãã¬ã¹ã決å®ããŸãã
3. CH [n] .TEP-ã¬ãžã¹ã¿å ã®ã¿ã¹ã¯ã®ã¢ãã¬ã¹ã決å®ããŸãã
4. CHG [n] .EN-ãã®ãã£ã³ãã«ãã¬ãžã¹ã¿ãŒã«ããã°ã«ãŒããã¢ã¯ãã£ãã«ããŸãã
以äžã¯ãTIMER + ADCãã³ãã«ã®PPIã¢ãžã¥ãŒã«åæåé¢æ°ã§ãã
ã¿ã€ããŒåæåæ©èœ
/* . NRF_TIMER1->EVENTS_COMPARE[0] */ NRF_PPI->CH[0].EEP = 0x40009140; /* . NRF_ADC->TASKS_START */ NRF_PPI->CH[0].TEP = 0x40007000; /* */ NRF_PPI->CHEN |= PPI_CHEN_CH0_Enabled; NRF_PPI->CHENSET |= PPI_CHENSET_CH0_Enabled; /* PPI */ NRF_PPI->TASKS_CHG[0].EN = 1;
TIMER + PPI + ADCãªã³ã¯ã®ãããžã§ã¯ãã³ãŒããžã®ãªã³ã¯ã¯ãèšäºã®ä»é²ã«ãããŸãã
åã®èšäºãžã®ã³ã¡ã³ãã§äººã ãæ£ããä¿ããããã«ãnRF51822ã¯æãå®å®ãããããã§ã¯ãªããšããäºå®ã«æ³šæãåèµ·ããããšæããŸãã ããã«ã¯å€ãã®éèªæãªåé¡ããããŸãã ããã«ããããèªäœã¯ãäžæ¹ã§ã¯åšèŸºãè±ãã§ãä»æ¹ã§ã¯ããªã貧匱ã§ãã ADCãé ããããæãå¿ èŠãšãããåšèŸºã®éšåïŒSPIMãTWIãUARTãADCïŒã®DMAãäžè¶³ããŠãããFPUãäžè¶³ããŠãããããããã¹ãŠããã®ãããã®äœ¿çšãå¶éããŸãã å€ãã®äººã¯ãããã¯ãã³ã»ã³ã¹ã ãšèšãã§ãããããªããªããããªãã®æã ãããã®å Žæããæ¥ãŠããã°ããã貧匱ãªç¹æ§ã§å€ãã®ã¯ãŒã«ãªããã€ã¹ãäœãããšãã§ããããã§ãã ãããŠãååãšããŠã圌ãã¯æ£ããã§ãããã ããããçŸæç¹ã§ã¯ãnRF52832ããããæèŒããnRF52ãããã°ããŒãããããããããã¹ãŠã®æ¬ ç¹ããªããåãäŸ¡æ Œåž¯ã®51ã·ãªãŒãºãããã¯ããã«å®å®ããŠããŸãã ãã®ãããããŸããŸãªã¿ã¹ã¯ã«ã³ã³ãããŒã©ãŒãéžæããéã«ã¯æ³šæããŠãã ããã
次ã®èšäºã§ã¯ãããããã§ããã°ãããŸããŸãªã€ã³ã¿ãŒãã§ãŒã¹ïŒSPISãSPIMãTWIãUARTïŒã®å®è£ æ©èœã«ã€ããŠèª¬æããŸããRTCããã®ä»ã®åšèŸºæ©åšããã£ããã£ã§ããŸãã
è¿œå æ å ±
ãã³ãã«ã¿ã€ããŒ+ PPI + ADCã®ãããžã§ã¯ãå®è£
PPIã€ã³ã¿ãŒãã§ãŒã¹
nRF51822ã®æŠèŠïŒã¯ã€ãã¯ã¹ã¿ãŒã