Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

Sort By

USER REQUESTS

first | 1 | 2 | 3 | 4 | 5 | 6 last
Viktor Erdelyi
Co-Fi

posted on 2013/09/27 06:17:43 AM CEST

Internal MCU modules

STM32F3 Demoboard MikroC for ARM USB library

Hi!
I have an STM32F3 discovery board, with an STM32f303VC chip ot, and trying to make USB working. I haven't found a USB library for that. Can somebody help me, lease?
Thanks, and sorry about my english.
Viktor

Henk Kiela
hkiela

posted on 2013/08/01 07:20:13 AM CEST

Internal MCU modules

Pascal Sample code for quadrature encoders with STM32F407GT

I have tried a lot to get any of the four possible 16 quad encoder counters (Tim2 -5) running, with no success. Can anyone have a suggestion? See my sample code below.

// --------------- Init encoder
Procedure EncoderInit;
Begin
//Configure peripheral clocks


//Configure pins
GPIO_Config(@GPIOC_BASE, _GPIO_PINMASK_6 or _GPIO_PINMASK_7,
_GPIO_CFG_MODE_INPUT or _GPIO_CFG_PULL_UP or _GPIO_CFG_MODE_ALT_FUNCTION or _GPIO_CFG_SPEED_100MHZ); // Pin ChA and chB config
// GPIO_Config(@GPIOC_BASE, _GPIO_PINMASK_6 or _GPIO_PINMASK_7,
// _GPIO_CFG_MODE_INPUT or _GPIO_CFG_PULL_UP or _GPIO_CFG_SPEED_100MHZ); // Pin ChA and chB config

CEN_TIM3_CR1_bit:=0; // Disable timer
CEN_TIM4_CR1_bit:=0; // Disable timer

AFRL60_GPIOC_AFRL_bit:=0; //GPIOc_AFRH alternate function AF2 for PC6
AFRL61_GPIOC_AFRL_bit:=1;
AFRL62_GPIOC_AFRL_bit:=0;
AFRL63_GPIOC_AFRL_bit:=0;

AFRL70_GPIOC_AFRL_bit:=0; //GPIOc_AFRH alternate function AF2 for PC7
AFRL71_GPIOC_AFRL_bit:=1;
AFRL72_GPIOC_AFRL_bit:=0;
AFRL73_GPIOC_AFRL_bit:=0;

TIM3_ARR:=3000;
TIM4_ARR:=3000;

CC1S0_TIM3_CCMR1O_bit:=1; // Tim3_CCMR1 input mapping T1 map
CC1S1_TIM3_CCMR1O_bit:=0;

CC2S0_TIM3_CCMR1O_bit:=1; // Tim3_CCMR1 input mapping T2 map
CC2S1_TIM3_CCMR1O_bit:=0;

//Configure Timer
CC1P_TIM3_CCER_bit:=0; // Tim3_CCER Input polarity
CC2P_TIM3_CCER_bit:=0;

//Debounce filter

//Setup quadrature encoder and enable timer
// TIM3_SMCR
// Main Configuration of Timer 3: Tim3_SMCR.SMS -> Encoder Mode 3 (val 011)
SMS0_TIM3_SMCR_bit:=1; // Count on edge ch1
SMS1_TIM3_SMCR_bit:=1; // and channel 2
SMS2_TIM3_SMCR_bit:=0;
// SMS2_TIM3_SMCR_bit:=0;
ETF0_TIM3_SMCR_bit:=1;
ETF1_TIM3_SMCR_bit:=1;
ETF2_TIM3_SMCR_bit:=1;
ETF3_TIM3_SMCR_bit:=1;

// CC2P= ‘0’, CC2NP = ‘0’, IC2F =’0000’ (TIMx_CCER register, TI2FP2 noninverted, TI2FP2=TI2)

//Tim3_SMCR.TS -> TI1FP1 (val 101)
//Tim3_CR1.URS -> Counter over-/underflow, UG BIT, Slave mode controller (val 0)
//Tim3.ARR -> 1000
//Timer 3 Channel 1 Configuration: Tim3_CCR1 -> 0
//Tim3_CCMR1.CC1S -> CC1 configured as input, IC1 mapped on TI1 (val 01)
//Tim3_CCER.CC1P -> non-inverted (val 0)
//Timer 3 Channel 2 Configuration: Tim3_CCR2 -> 0
//Tim3_CCMR1.CC2S -> CC2 configured as input, IC2 mapped on TI2 (val 01)
//Tim3_CCER.CC2P -> non-inverted (val 0)

CEN_TIM3_CR1_bit:=1; // Enable timer
End; // Encoderinit

Function Getcount: word;
var a: integer;
begin
CEN_TIM3_CR1_bit:=0; // Enable timer
TIM3_CNT:=222;
CEN_TIM3_CR1_bit:=1; // Enable timer
GetCount:=TIM3_CNT;
// a:=__System_CLOCK_IN_KHZ;
// Getcount:=a;
end;

Todd Kim
Todd

posted on 2013/07/24 03:56:22 AM CEST

Internal MCU modules

STM32F373 SDADC Library !!

I use STM32F373 with mikroC for ARM.

I need to use SDADC in STM32F373.

but I can not work it.
please help...OTL

Henk Kiela
hkiela

posted on 2013/07/16 10:30:01 AM CEST

Internal MCU modules

MCU clock initialisation and encoder readout STM32F407VG in Pascal would be helpfull

Is there a Pascal example of the proper register setting for a 168 MHz closk of the MCU card with STM32F407VGT6. And how to setup tmer 2 to 5 for quadrature encoder readout for this device?
Thanks

Nguyen Xuan Truong
foundaction

posted on 2013/03/05 04:22:18 AM CET

Internal MCU modules

EEPROM_Write ; EEPROM_Read

hi, evrybody.,
I use program "MikroPascal for 8051" but I do not know how to use the command:
EEPROM_Write
EEPROM_Read

i'd like to write some data to eeprom (24c04)
and read it
pls, help me

first | 1 | 2 | 3 | 4 | 5 | 6 last