From 9369d75516d5edb0e892f5ce1a5d7781917a64a5 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 20 Nov 2011 18:04:07 +0000 Subject: STM32F4-Discovery demo working. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3516 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32L152-DISCOVERY/readme.txt | 2 +- demos/ARMCM4-STM32F407-DISCOVERY/main.c | 6 +++--- demos/ARMCM4-STM32F407-DISCOVERY/readme.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'demos') diff --git a/demos/ARMCM3-STM32L152-DISCOVERY/readme.txt b/demos/ARMCM3-STM32L152-DISCOVERY/readme.txt index a79e306a4..ce8ade8fc 100644 --- a/demos/ARMCM3-STM32L152-DISCOVERY/readme.txt +++ b/demos/ARMCM3-STM32L152-DISCOVERY/readme.txt @@ -11,7 +11,7 @@ The demo runs on an ST STM32L-Discovery board. The demo shows how to use the ADC, PWM and SPI drivers using asynchronous APIs. The ADC samples two channels (temperature sensor and PC0) and modulates the PWM using the sampled values. The sample data is also transmitted using -the SPI port 1. +the SPI port 2 (NSS=PB12, SCK=PB13, MISO=PB14, MOSI=PB15). By pressing the button located on the board the test procedure is activated with output on the serial port COM1 (USART1). diff --git a/demos/ARMCM4-STM32F407-DISCOVERY/main.c b/demos/ARMCM4-STM32F407-DISCOVERY/main.c index 34893edda..e7e05d0bb 100644 --- a/demos/ARMCM4-STM32F407-DISCOVERY/main.c +++ b/demos/ARMCM4-STM32F407-DISCOVERY/main.c @@ -128,11 +128,11 @@ void adccb(ADCDriver *adcp, adcsample_t *buffer, size_t n) { /* Changes the channels pulse width, the change will be effective starting from the next cycle.*/ pwmEnableChannelI(&PWMD4, 0, PWM_FRACTION_TO_WIDTH(&PWMD4, 4096, avg_ch1)); -// pwmEnableChannelI(&PWMD4, 3, PWM_FRACTION_TO_WIDTH(&PWMD4, 4096, avg_ch2)); + pwmEnableChannelI(&PWMD4, 3, PWM_FRACTION_TO_WIDTH(&PWMD4, 4096, avg_ch2)); /* SPI slave selection and transmission start.*/ -// spiSelectI(&SPID2); -// spiStartSendI(&SPID2, ADC_GRP1_NUM_CHANNELS * ADC_GRP1_BUF_DEPTH, samples); + spiSelectI(&SPID2); + spiStartSendI(&SPID2, ADC_GRP1_NUM_CHANNELS * ADC_GRP1_BUF_DEPTH, samples); chSysUnlockFromIsr(); } diff --git a/demos/ARMCM4-STM32F407-DISCOVERY/readme.txt b/demos/ARMCM4-STM32F407-DISCOVERY/readme.txt index ab3c5199a..b82983548 100644 --- a/demos/ARMCM4-STM32F407-DISCOVERY/readme.txt +++ b/demos/ARMCM4-STM32F407-DISCOVERY/readme.txt @@ -9,9 +9,9 @@ The demo runs on an ST STM32F4-Discovery board. ** The Demo ** The demo shows how to use the ADC, PWM and SPI drivers using asynchronous -APIs. The ADC samples two channels (temperature sensor and PC0) and modulates +APIs. The ADC samples two channels (temperature sensor and PC1) and modulates the PWM using the sampled values. The sample data is also transmitted using -the SPI port 1. +the SPI port 2 (NSS=PB12, SCK=PB13, MISO=PB14, MOSI=PB15). By pressing the button located on the board the test procedure is activated with output on the serial port SD2 (USART2). -- cgit v1.2.3