aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpcirillo <pcirillo@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-10-28 11:37:40 +0000
committerpcirillo <pcirillo@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-10-28 11:37:40 +0000
commit6c69c98272ebcde89120708a5cdb19e739d17386 (patch)
treeb98f9cad72859d323b31b30c6d56965b7324b3b9
parent757ece4f2bd1dde77d40f83ea9d96838577c3168 (diff)
downloadChibiOS-6c69c98272ebcde89120708a5cdb19e739d17386.tar.gz
ChibiOS-6c69c98272ebcde89120708a5cdb19e739d17386.tar.bz2
ChibiOS-6c69c98272ebcde89120708a5cdb19e739d17386.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6386 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--testhal/SPC563Mxx/ICU-PWM/main.c30
-rw-r--r--testhal/SPC563Mxx/ICU-PWM/mcuconf.h8
-rw-r--r--testhal/SPC563Mxx/ICU-PWM/readme.txt2
3 files changed, 20 insertions, 20 deletions
diff --git a/testhal/SPC563Mxx/ICU-PWM/main.c b/testhal/SPC563Mxx/ICU-PWM/main.c
index 51edb64c8..f8c9ec4c2 100644
--- a/testhal/SPC563Mxx/ICU-PWM/main.c
+++ b/testhal/SPC563Mxx/ICU-PWM/main.c
@@ -80,54 +80,54 @@ int main(void) {
*/
/* Sets PIN63 alternative function.*/
- SIU.PCR[179].R = 0b0000010100001100;
+ SIU.PCR[179].R = 0b0000011000001100;
- /* Sets PIN80 alternative function.*/
- SIU.PCR[202].R = 0b0000011000001100;
+ /* Sets PIN65 alternative function.*/
+ SIU.PCR[181].R = 0b0000010100001100;
- icuStart(&ICUD1, &icucfg);
- icuEnable(&ICUD1);
- pwmStart(&PWMD8, &pwmcfg);
+ icuStart(&ICUD2, &icucfg);
+ icuEnable(&ICUD2);
+ pwmStart(&PWMD1, &pwmcfg);
chThdSleepMilliseconds(2000);
/*
* Starts the PWM channel 0 using 75% duty cycle.
*/
- pwmEnableChannel(&PWMD8, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD8, 7500));
+ pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 7500));
chThdSleepMilliseconds(5000);
/*
* Changes the PWM channel 0 to 50% duty cycle.
*/
- pwmEnableChannel(&PWMD8, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD8, 5000));
+ pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000));
chThdSleepMilliseconds(5000);
/*
* Changes the PWM channel 0 to 25% duty cycle.
*/
- pwmEnableChannel(&PWMD8, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD8, 2500));
+ pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 2500));
chThdSleepMilliseconds(5000);
/*
* Changes PWM period and the PWM channel 0 to 50% duty cycle.
*/
- pwmChangePeriod(&PWMD8, 25000);
- pwmEnableChannel(&PWMD8, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD8, 5000));
+ pwmChangePeriod(&PWMD1, 25000);
+ pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000));
chThdSleepMilliseconds(5000);
/*
* Disables PWM channel 0 and stops the drivers.
*/
- pwmDisableChannel(&PWMD8, 0);
- pwmStop(&PWMD8);
+ pwmDisableChannel(&PWMD1, 0);
+ pwmStop(&PWMD1);
/*
* Disables and stops the ICU drivers.
*/
- icuDisable(&ICUD1);
- icuStop(&ICUD1);
+ icuDisable(&ICUD2);
+ icuStop(&ICUD2);
palClearPad(PORT11, P11_LED3);
palClearPad(PORT11, P11_LED4);
diff --git a/testhal/SPC563Mxx/ICU-PWM/mcuconf.h b/testhal/SPC563Mxx/ICU-PWM/mcuconf.h
index 391530843..a85edd579 100644
--- a/testhal/SPC563Mxx/ICU-PWM/mcuconf.h
+++ b/testhal/SPC563Mxx/ICU-PWM/mcuconf.h
@@ -80,20 +80,20 @@
/*
* ICU - PWM driver system settings.
*/
-#define SPC5_ICU_USE_EMIOS_CH0 TRUE
#define SPC5_ICU_USE_EMIOS_CH1 TRUE
#define SPC5_ICU_USE_EMIOS_CH2 TRUE
#define SPC5_ICU_USE_EMIOS_CH3 TRUE
#define SPC5_ICU_USE_EMIOS_CH4 TRUE
#define SPC5_ICU_USE_EMIOS_CH5 TRUE
#define SPC5_ICU_USE_EMIOS_CH6 TRUE
-#define SPC5_ICU_USE_EMIOS_CH8 TRUE
+#define SPC5_ICU_USE_EMIOS_CH11 TRUE
+#define SPC5_ICU_USE_EMIOS_CH13 TRUE
+#define SPC5_PWM_USE_EMIOS_CH0 TRUE
+#define SPC5_PWM_USE_EMIOS_CH8 TRUE
#define SPC5_PWM_USE_EMIOS_CH9 TRUE
#define SPC5_PWM_USE_EMIOS_CH10 TRUE
-#define SPC5_PWM_USE_EMIOS_CH11 TRUE
#define SPC5_PWM_USE_EMIOS_CH12 TRUE
-#define SPC5_PWM_USE_EMIOS_CH13 TRUE
#define SPC5_PWM_USE_EMIOS_CH14 TRUE
#define SPC5_PWM_USE_EMIOS_CH15 TRUE
#define SPC5_PWM_USE_EMIOS_CH23 TRUE
diff --git a/testhal/SPC563Mxx/ICU-PWM/readme.txt b/testhal/SPC563Mxx/ICU-PWM/readme.txt
index 90fcf6d5c..b65b14a65 100644
--- a/testhal/SPC563Mxx/ICU-PWM/readme.txt
+++ b/testhal/SPC563Mxx/ICU-PWM/readme.txt
@@ -13,7 +13,7 @@ The application demonstrates the use of the SPC563Mxx ICU and PWM drivers.
** Board Setup **
-Connect PIN63 and PIN80 together.
+Connect PIN63 and PIN65 together.
** Build Procedure **