niekiran / masteringmcu Goto Github PK
View Code? Open in Web Editor NEWUdemy Mastering Microcontroller Course Repository
Udemy Mastering Microcontroller Course Repository
This caught my attention -> line 130 SYSCFG->EXTICR[temp1] = portcode << ( temp2 * 4);
in my opinion it should be SYSCFG->EXTICR[temp1] |= portcode << ( temp2 * 4);
For example, below evaluates to 0x18
#define SPI_REG_CR1_BR_PCLK_DIV_16 ( ( uint32_t) 3 << 3 )
and in hal, we have error check condition which checks 0x18> 7 sets default CR1 with 0.
if(pre_scalar_value > 7 )
SPIx->CR1 |= (0x00 << 3); //if pre_scalar_value > 7,then use default . that is 0
In order to fix, it is just enough to have below change
#define SPI_REG_CR1_BR_PCLK_DIV_16 3
I am at lesson 3 and it said to clone?
I do not know hoe to find your respond to this so pleas explain tis also?
This is my email [email protected] explain how to find your response to this.
Thank you,
ฦg
Shouldn't this actually be:
F_part = ((( F_part * 8)+ 50) / 100)& ((uint8_t)0x0F);
Because BRR register DIV_Fraction[3:0] always has 4 bits.
In my microcontroller the pins are started by default as an analog mode (to save energy), so it would be interesting to ensure that the pin is configured as an input before starting the interrupt configuration process.
Just by adding this line:
//Configure GPIO as input
pGPIOHandle->pGPIOx->MODER &= ~( 0x3 << (2 * pGPIOHandle->GPIO_PinConfig.GPIO_PinNumber));
I don't understand how the SPI handle is passed to the SPI interrupt. Relevant lines in code
file: stm32f407xx_spi_driver.c
void SPI_IRQHandling(SPI_Handle_t *pHandle)
{
uint8_t temp1 , temp2;
//first lets check for TXE
temp1 = pHandle->pSPIx->SR & ( 1 << SPI_SR_TXE);
temp2 = pHandle->pSPIx->CR2 & ( 1 << SPI_CR2_TXEIE);
if( temp1 && temp2)
{
//handle TXE
spi_txe_interrupt_handle(pHandle);
}
// check for RXNE
temp1 = pHandle->pSPIx->SR & ( 1 << SPI_SR_RXNE);
temp2 = pHandle->pSPIx->CR2 & ( 1 << SPI_CR2_RXNEIE);
if( temp1 && temp2)
{
//handle RXNE
spi_rxne_interrupt_handle(pHandle);
}
// check for ovr flag
temp1 = pHandle->pSPIx->SR & ( 1 << SPI_SR_OVR);
temp2 = pHandle->pSPIx->CR2 & ( 1 << SPI_CR2_ERRIE);
if( temp1 && temp2)
{
//handle ovr error
spi_ovr_err_interrupt_handle(pHandle);
}
}
I'm architecting a similar application and need to pass SPI information from various applications. I'm using a different controller (dsPIC33). I do not understand how the different SPI handles declared in my application is passed to the interrupt context.
The tutorial shows it correctly, but the committed code has issues. I was confused by this mismatch while comparing the code. This is as shown in the tutorial:
/*********************************************************
* @fn - GPIO_IRQHandling
* @brief - Interrupt handling
*
* @param[in] -
* @param[in] -
*
* @return -
*
* @notes -
* /
void GPIO_IRQHandling(uint8_t PinNumber)
{
//clear the EXTIPR register
if(EXTI ->PR |= (1 << PinNumber))
{
//clear
EXTI ->PR &= ~(1 << PinNumber);
}
}
I am trying to interface GSM with STM32L151, Can you please suggest me how to send AT commands to GSM Module.
Thank you.
in line 566 else if(IRQNumber >= 6 && IRQNumber < 96 ) should be else if(IRQNumber >= 64 && IRQNumber < 96 )
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.