Yeah sure tell me, I know; Full time job, family and a car to build.Jack Bauer wrote: ↑Sun Dec 19, 2021 8:49 am Regards answering question I do my best but my time and energy is super limited right now.
Thank u for your effort.
Yeah sure tell me, I know; Full time job, family and a car to build.Jack Bauer wrote: ↑Sun Dec 19, 2021 8:49 am Regards answering question I do my best but my time and energy is super limited right now.
Code: Select all
static digpot* objpot1;
static digpot* objpot2;
Code: Select all
//instantiate the potmeter objects
digpot pot1(SPI3, DigIo::pot1cs);
digpot pot2(SPI3, DigIo::pot2cs);
objpot1 = &pot1;
objpot2 = &pot2;
Code: Select all
static uint8_t pot1val=0;
static uint8_t pot2val=0;
objpot1->SetPotStep(pot1val);
objpot2->SetPotStep(pot2val);
pot1val+=1;
pot2val+=1;
Code: Select all
#include "digpot.h"
Code: Select all
void spi3_setup() //spi3 used for digi pots (fuel gauge etc)
{
gpio_primary_remap(AFIO_MAPR_SWJ_CFG_JTAG_OFF_SW_ON, AFIO_MAPR_SPI3_REMAP);
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO12 | GPIO10);//MOSI , CLK
gpio_set_mode(GPIOC, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, GPIO11);//MISO
/* Reset SPI, SPI_CR1 register cleared, SPI is disabled */
spi_reset(SPI3);
SPI3_I2SCFGR = 0;
spi_init_master(SPI3, SPI_CR1_BAUDRATE_FPCLK_DIV_32, SPI_CR1_CPOL_CLK_TO_0_WHEN_IDLE,
SPI_CR1_CPHA_CLK_TRANSITION_1, SPI_CR1_DFF_8BIT, SPI_CR1_MSBFIRST);
spi_set_bidirectional_transmit_only_mode(SPI3);
spi_enable_software_slave_management(SPI3);
spi_set_nss_high(SPI3);
spi_enable(SPI3);
}
Code: Select all
OBJSL = $(BINARY).o hwinit.o stm32scheduler.o params.o terminal.o terminal_prj.o[b] digpot.o[/b]
Go to your repo that linked to above. While there, go to the pull requests tab. Then click the "New Pull Request" button. This will automatically try to figure out what you changed after forking the project. If fact, you will see that you have been magically transported to Damien's repo that you had forked. If it all looks good you click "Create Pull Request" This lets you then create a comment explaining in more depth what you did and why you think the original author should merge your changes. Thereafter, once you have clicked "Create pullrequest" you will be done. Then it's in Damien's court to see if he wants to merge it or not.EV_Builder wrote: ↑Tue Dec 28, 2021 10:40 pm
I commited this libary to my github fork.
(no clue how i can make pullrequest for damien yet)
https://github.com/EV-Builder/Stm32-vcu
Did you figure this out?et0 wrote: ↑Tue Dec 14, 2021 11:22 am Just a quick one - has anyone seen the OIL PUMP output working for the GS450 yet?
I get no PWM at pin 30 of the VCU or pin 40 of the STM32, when it's on and running. (Oil Pump is set to 50% in the menu)
Trying to narrow down if it's another bad STM chip problem or something else.
Thanks!
Figured it out. It also needed to remap the TIM1 pins. I'll send a pull request to get it fixed on the main branch.streber wrote: ↑Thu Jan 06, 2022 3:11 amDid you figure this out?et0 wrote: ↑Tue Dec 14, 2021 11:22 am Just a quick one - has anyone seen the OIL PUMP output working for the GS450 yet?
I get no PWM at pin 30 of the VCU or pin 40 of the STM32, when it's on and running. (Oil Pump is set to 50% in the menu)
Trying to narrow down if it's another bad STM chip problem or something else.
Thanks!
I'm having the same issue. I think it is a software bug in hwinit.cpp: where it is using the wrong pin to setup the timer for the Oil PWM signal and putting it on the INV_POWER pin. I tried the obvious thing of fixing the pin in the code, but that didn't help.
Code: Select all
//////////////////////////////////////////////////
// MODE CONTROL SECTION //
//////////////////////////////////////////////////
s32fp udc = utils::ProcessUdc(oldTime, GetInt(Param::speed));
stt |= Param::GetInt(Param::potnom) <= 0 ? STAT_NONE : STAT_POTPRESSED;
stt |= udc >= Param::Get(Param::udcsw) ? STAT_NONE : STAT_UDCBELOWUDCSW;
stt |= udc < Param::Get(Param::udclim) ? STAT_NONE : STAT_UDCLIM;
Damien and Streber;streber wrote: ↑Thu Jan 06, 2022 4:25 am Figured it out. It also needed to remap the TIM1 pins. I'll send a pull request to get it fixed on the main branch.
https://github.com/damienmaguire/Stm32-vcu/pull/23
Code: Select all
stt |= deltaV >= Param::Get(Param::udcsw) ? STAT_NONE : STAT_UDCBELOWUDCSW;
Code: Select all
stt |= deltaV >= Param::Get(Param::udcsw) ? STAT_NONE : STAT_UDCBELOWUDCSW;
Yeah we try to contribute but its not easy missing information.Jack Bauer wrote: ↑Fri Jan 07, 2022 5:38 pm Thanks for the contributions folks. Now merged on Github. Will look more closely soon. Up to my ears in woodworm this week!
Code: Select all
s32fp udcsw = MAX(Param::Get(Param::udcsw), (udc2-10));
Param::SetFlt(Param::udcsw, udcsw);