lunedì 12 settembre 2011

Stm32(cortex m3) project: Touchscreen click & drag scrolling with microcontroller Stm32

This is a continue of "beatstream project". I've update firmware implementing library to create fully customizable window (size and position window, color bar, header, background,object select,font) with touchscreen scroll. You can scroll up and down to select your item. The effect is similar to Iphone or android mobile (obviously not the same! XD ). The entire project works without O.S..Contact me for info or comment ( always welcome ).

venerdì 2 settembre 2011

STM32 ( cortex M3 ): microsd card touchscreen audio player with spectrum display

This is an update of project STM32: microSD Wav audio player with touchscreen.This version has a spectrum display during playback. I used DSP library for ARM Cortex-M3 based STM32 microcontrollers available from ST Microelectronics website. This license-free, and royalty-free DSP library holds large number of valuable functions coded in C or assembly language (as FFT ) including PID controller, Fourier transform functions, and a selection of digital filters such as 16-bit FIR, IIR direct-form, and IIR canonical-form filters.
The DSP library can be used with the IAR, Keil Toolchain for the STM32.
Alternative DSP functions for Cortex M3 are avaible at http://www.embeddedsignals.com









mercoledì 31 agosto 2011

DAC PWM glitch problem with STM32

With the project STM32: microSD Wav audio player with touchscreen I use microcontroller's PWM as 10 bit DAC but in first version of firmware I have found an annoying glitch during playback.


(coming soon video with glitch problem)

This problem is typical when you use TIM_OC1Init(TIM1,&TIM1_OCInitStructure) function to obtain PWM with costant frequency and variable duty cycle.

To solve this problem you can follow these steps:
First step: The initialization code

The initialization code is:

TIM_TimeBaseInitTypeDef  TIM_TimeBaseStructure;
TIM_OCInitTypeDef  TIM_OCInitStructure;

TIM_DeInit(TIM1);

/* Time Base configuration */
TIM1_TimeBaseStructure.TIM_Prescaler = 0x0;
TIM1_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Down;
TIM1_TimeBaseStructure.TIM_ClockDivision = 0x0;
TIM1_TimeBaseStructure.TIM_Period = 1020;

/* Channel 1,3 Configuration in PWM mode */
TIM1_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
TIM1_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
TIM1_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low;
TIM1_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set;
TIM1_OCInitStructure.TIM_Pulse = 1024/2;

TIM_TimeBaseInit(TIM1,&TIM1_TimeBaseStructure);

TIM_OC1Init(TIM1,&TIM1_OCInitStructure);

TIM_OC3Init(TIM1, &TIM1_OCInitStructure);

/* TIM1 counter enable */
TIM_Cmd(TIM1,ENABLE);
TIM_CtrlPWMOutputs(TIM1,ENABLE);

Second step: Update Duty cycle periodically
After initialization, if you want to update duty cycle periodically, you don't use a TIM_OC1Init(TIM1,&TIM1_OCInitStructure) function because you load all field of TIM1_OCInitStructure struct losing firmware efficiency inevitably and causing a glitch during playback but you must update the PWM writing the registers directly as follows:

TIM2->CCR2 = duty1;
TIM2->CCR3 = duty2;

 


 

lunedì 29 agosto 2011

TI Stellaris 8962 : microSD Wav audio player with PWM DAC

Stellaris 8962 is a TI's microcontroller with cortex m3 core.
The evaluation board LM3S8962 has OLED grayscale display(4bit 128 x 96), microSD adapter, 6 buttons(including reset), CAN, buzzer, Ethernet,Usb...
The board has an In-Circuit Debug Interface (ICDI) that provides hardware debugging functionality
The project play song on microSD with PWM's DAC. For this project I created template and firmware.
Display and microSD share same SPI.



STM32 ( cortex m3 ): piano with touchscreen and PWM

Play Piano with touchscreen!! I used PWM to generate a note.
I used a GUI, touchscreen library created for a project STM32: microSD Wav audio player with touchscreen .
Varying the frequency of PWM you can generate a single note.
For frequencies click on this link.



giovedì 25 agosto 2011

STM32: microSD Wav audio player with touchscreen

For this project I created GUI, touch screen library, template to develop a touch screen user interface (icons, menu, progress bar, font) and a firmware to play song .wav( I used PWM as 10 bit DAC to convert a sample in analog voltage).
I used module FATFS for the file system FAT32 on microSD.