Search found 10 matches

by paddywac
09 Jan 2020 16:14
Forum: ARM PRO Compilers
Topic: Suspicious pointer conversion
Replies: 2
Views: 2579

Re: Suspicious pointer conversion

Hi, yes that makes sense. I was using uint8_t for addr because I wanted to access the memory as a byte, but yes, it makes sense that the compiler would question it. I'll change it and see. I was going to use a Union instead, which seems neater but maybe not as efficient. Thanks for the support. Pete
by paddywac
08 Jan 2020 19:50
Forum: ARM PRO Compilers
Topic: Suspicious pointer conversion
Replies: 2
Views: 2579

Suspicious pointer conversion

I'm getting a 'suspicious pointer conversion warning' for the following code; it works OK and does what I want, but why the warning? /* Convert int16 to bytes ---------------------- */ void int2Bytes(int16_t parameter, uint8_t *pMSB, uint8_t *pLSB) { uint8_t * addr; addr = ¶meter; *pLSB = * addr...
by paddywac
27 Nov 2019 21:19
Forum: ARM PRO Compilers
Topic: External interrupts
Replies: 6
Views: 3349

Re: External interrupts

That works, fantastic. Basically I had the interrupt vector wrong.

Thanks again for the great support :-)

Pete
by paddywac
26 Nov 2019 21:51
Forum: ARM PRO Compilers
Topic: External interrupts
Replies: 6
Views: 3349

Re: External interrupts

I tried slowing down the clock to the IO pins (APB2), but this didn't help.

Thanks
Pete N.
by paddywac
25 Nov 2019 16:23
Forum: ARM PRO Compilers
Topic: External interrupts
Replies: 6
Views: 3349

Re: External interrupts

Hi Jovana, thanks for replying to my post. Please find attached the project zipped up. I am doing the development on my own hardware, but this bit is a LIS3DSH accelerometer connected to PB5, with a 82K pull up. I can see the INT pin activity on a scope. Also, if I put some code into the micro to de...
by paddywac
24 Nov 2019 22:38
Forum: ARM PRO Compilers
Topic: External interrupts
Replies: 6
Views: 3349

External interrupts

Hi, I'm trying to get an external interrupt to work on port PB5. Interrupt on the rising edge. I can see the IO pin going high on a scope, and if I put some code in to detect PB5 going high it works. I just can't get the interrupt routine to work. Here's the code: I can see the EXTI_PR bit go high i...
by paddywac
06 Nov 2019 00:36
Forum: mikroC PRO for ARM General
Topic: Configure MCO output on STM32F105
Replies: 1
Views: 703

Re: Configure MCO output on STM32F105

I sorted it, being daft!

GPIO_Config(&GPIOA_BASE,_GPIO_PINMASK_8,
_GPIO_CFG_MODE_ALT_FUNCTION | _GPIO_CFG_SPEED_50MHZ | _GPIO_CFG_OTYPE_PP);

GPIO_Clk_Enable(&GPIOA_BASE);

Cheers
Pete
by paddywac
06 Nov 2019 00:14
Forum: mikroC PRO for ARM General
Topic: Configure MCO output on STM32F105
Replies: 1
Views: 703

Configure MCO output on STM32F105

Hi, How do I configure pin PA8 on an STM32F105 to output the system clock? On another project that used a STM32L053C8 i used: GPIO_Alternate_Function_Enable(&_GPIO_MODULE_MCO_PA8); GPIO_Clk_Enable(&GPIOA_BASE); and set the MCO to output the system clock in the project and it worked no worries. Howev...
by paddywac
01 Aug 2018 12:42
Forum: mikroC PRO for ARM General
Topic: Can't get PWM timer to work!
Replies: 1
Views: 4668

Can't get PWM timer to work!

Hi, I'm trying to get the PWM working on a STM32L053C8 and have the following code: uint16_t ratio = PWM_TIM2_Init(10000); GPIO_Alternate_Function_Enable(&_GPIO_MODULE_TIM2_CH1_PA0); PWM_TIM2_Set_Duty(2500, _PWM_NON_INVERTED, _PWM_CHANNEL1); PWM_TIM2_Start(_PWM_CHANNEL1, _GPIO_MODULE_TIM2_CH1_PA0); ...
by paddywac
01 Aug 2018 12:28
Forum: mikroC PRO for ARM General
Topic: Can't get PWM timer to work!
Replies: 1
Views: 1057

Can't get PWM timer to work!

I have this bit of code on a STM32L053C8: uint16_t ratio = PWM_TIM2_Init(10000); // Set the output frequency GPIO_Alternate_Function_Enable(&_GPIO_MODULE_TIM2_CH1_PA0); PWM_TIM2_Set_Duty(2500, _PWM_NON_INVERTED, _PWM_CHANNEL1); PWM_TIM2_Start(_PWM_CHANNEL1, _GPIO_MODULE_TIM2_CH1_PA0); It's to try ou...

Go to advanced search