[SOLVED] STM32 and Program trouble

Status
Not open for further replies.

mekitron

Junior Member level 3
Joined
Dec 6, 2012
Messages
31
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
Mehran Valley
iambozdar.com
Activity points
1,514
Hello All,

I am practicing on STM32 development board these days. I have written a piece of code which prints some lines on LCD connected with board. Board has ARM Cortex M3 Processor. Now, I want that what code I coded should blink on LCD. I know it is possible with timer programming but I can't find any solution. I am posting my code if you have some code like this please share with some explanation or help me that how I can do this.

Code:
#include <stm32f10x_lib.h>
#include "sys.h"
#include "usart.h"		
#include "delay.h"	
#include "led.h" 
#include "key.h"
#include "exti.h"
#include "wdg.h"
#include "timer.h"
#include "lcd.h"

int main(void)
{	
	u8 x=0;			 	  
  	Stm32_Clock_Init(9);
	delay_init(72);		
	uart_init(72,9600); 
	LED_Init();
 	LCD_Init();

	POINT_COLOR=RED; 		   
	while(1) 
	{		 
									 
		POINT_COLOR=RED;	  
		LCD_ShowString(30,50,"Mini STM32 Program ^_^");	
		LCD_ShowString(30,70,"It's Meki");	
		LCD_ShowString(30,90,"Help Me to blink these lines");
		LCD_ShowString(30,110,"Thank you");	    					 
	    x++;
		if(x==12)x=0;
		LED0=!LED0;					 
		delay_ms(5000);	
	}											    
}

I'll be thankful for your help in this concern.
Regards,
Meki
 
Last edited:

Your code looks good. Are you using led0 in your code for clearing the LCD ?
Please upload your circuit.
 

Hi,

STM32 is a higher end micro-controller and must need to initialize every IO pin which is used in project for working as input or output. Please read reference manual of micro-controller for detail IO configuration.
Every module in STM32 need clock frequency this include IO port also.

So please first read datasheet and reference manual carefully. This is not work like 8051.

Regards,
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…