i need code for smt32f407 too.
i made it work only with stm32f103 but i need more power, because i have slow fps
if i have code like this which looks very simple
http://www.scienceprog.com/wp-content/uploads/2011/11/STM32F103ZET6GLCD.zipwhat should be changed to make it work with STM32F4 ? ( 480x272 lcd with SSD1963 controller ic)
first problem is how to fix systic delay program?
Code: Select all
static __IO uint32_t TimingDelay = 0;
void Delay(__IO uint32_t nCount)
{
TimingDelay = nCount;
/* Enable the SysTick Counter */
SysTick_Config(720000);
while(TimingDelay != 0);
/* Disable the SysTick Counter */
SysTick->CTRL &= ~SysTick_CTRL_ENABLE;
/* Clear the SysTick Counter */
SysTick->VAL = (uint32_t)0x0;
}
void Decrement_TimingDelay(void)
{
if (TimingDelay != 0x00)
{
TimingDelay--;
}
}
and second problem how to make code work with my pin assignments ?
Code: Select all
GPIO_InitTypeDef GPIO_InitStructure;
// Configures the FSMC GPIOs to interface with the LCD module
// Enable GPIOD, GPIOE, GPIOF, GPIOG and AFIO clocks
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOG |
RCC_AHB1Periph_GPIOE | RCC_AHB1Periph_GPIOF,
ENABLE);
// Enable FSMC, GPIOD, GPIOE and AFIO clocks
RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE);
//-- GPIO Configuration ------------------------------------------------------------
// SRAM Data lines, NOE and NWE configuration
// Connect FSMC pins to AF12
// +-------------------+--------------------+------------------+-------------------+
// + LCD pins assignment +
// +-------------------+--------------------+------------------+-------------------+
// | PD0 <-> FSMC_D2 | PD8 <-> FSMC_D13 | PD15 <-> FSMC_D1 | PE11 <-> FSMC_D8 |
// | PD1 <-> FSMC_D3 | PD9 <-> FSMC_D14 | PE7 <-> FSMC_D4 | PE12 <-> FSMC_D9 |
// | PD4 <-> FSMC_NOE | PD10 <-> FSMC_D15 | PE8 <-> FSMC_D5 | PE13 <-> FSMC_D10 |
// | PD5 <-> FSMC_NWE | PD11 <-> FSMC_A16 | PE9 <-> FSMC_D6 | PE14 <-> FSMC_D11 |
// | PD7 <-> FSMC_NE1 | PD14 <-> FSMC_D0 | PE10 <-> FSMC_D7 | PE15 <-> FSMC_D12 |
// +-------------------+--------------------+------------------+-------------------+
// PORTD
GPIO_PinAFConfig(GPIOD, GPIO_PinSource0, GPIO_AF_FSMC); // D2
GPIO_PinAFConfig(GPIOD, GPIO_PinSource1, GPIO_AF_FSMC); // D3
GPIO_PinAFConfig(GPIOD, GPIO_PinSource4, GPIO_AF_FSMC); // NOE -> RD
GPIO_PinAFConfig(GPIOD, GPIO_PinSource5, GPIO_AF_FSMC); // NWE -> WR
GPIO_PinAFConfig(GPIOD, GPIO_PinSource7, GPIO_AF_FSMC); // NE1 -> CS
GPIO_PinAFConfig(GPIOD, GPIO_PinSource8, GPIO_AF_FSMC); // D13
GPIO_PinAFConfig(GPIOD, GPIO_PinSource9, GPIO_AF_FSMC); // D14
GPIO_PinAFConfig(GPIOD, GPIO_PinSource10, GPIO_AF_FSMC); // D15
GPIO_PinAFConfig(GPIOD, GPIO_PinSource11, GPIO_AF_FSMC); // A16 -> RS
GPIO_PinAFConfig(GPIOD, GPIO_PinSource14, GPIO_AF_FSMC); // D0
GPIO_PinAFConfig(GPIOD, GPIO_PinSource15, GPIO_AF_FSMC); // D1
// PORTE
GPIO_PinAFConfig(GPIOE, GPIO_PinSource7, GPIO_AF_FSMC); // D4
GPIO_PinAFConfig(GPIOE, GPIO_PinSource8, GPIO_AF_FSMC); // D5
GPIO_PinAFConfig(GPIOE, GPIO_PinSource9, GPIO_AF_FSMC); // D6
GPIO_PinAFConfig(GPIOE, GPIO_PinSource10, GPIO_AF_FSMC); // D7
GPIO_PinAFConfig(GPIOE, GPIO_PinSource11, GPIO_AF_FSMC); // D8
GPIO_PinAFConfig(GPIOE, GPIO_PinSource12, GPIO_AF_FSMC); // D9
GPIO_PinAFConfig(GPIOE, GPIO_PinSource13, GPIO_AF_FSMC); // D10
GPIO_PinAFConfig(GPIOE, GPIO_PinSource14, GPIO_AF_FSMC); // D11
GPIO_PinAFConfig(GPIOE, GPIO_PinSource15, GPIO_AF_FSMC); // D12
// FSMC GPIO configuration
// SRAM Data lines, NOE and NWE configuration
// PORTD
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4 | GPIO_Pin_5 |
GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 |
GPIO_Pin_11 | GPIO_Pin_14 | GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOD, &GPIO_InitStructure);
// PORTE
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 |
GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 |
GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOE, &GPIO_InitStructure);
Thank you for any help