mostafa328
Newbie level 1
- Joined
- Oct 14, 2012
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,290
Hi
Im having a problem when i display the speed of the motor on LCD (16X2) causes the motor to stop. Im using PICDEM MCLV board (Brushless DC Motor) and is connected to EasyPic 7 development board (LCD is on) via RS232 cable (UART). The LCD does display the speed (RPM) of the motor but after 5 seconds or so the motor stops running. I start the motor again the LCD displays the speed and then again after 5 second or so it stops.
When i try connecting the RS232 to my laptop to display the speed using MikroC UART terminal the motor run normaly and displays the speed, its only when use the LCD to display the speed that the motor stops running after 5 seconds or so.
The code below is the LCD to receive the speed:
Could anyone please assist me what causes the motor to stop running when displaying on LCD?
Thank you.
Im having a problem when i display the speed of the motor on LCD (16X2) causes the motor to stop. Im using PICDEM MCLV board (Brushless DC Motor) and is connected to EasyPic 7 development board (LCD is on) via RS232 cable (UART). The LCD does display the speed (RPM) of the motor but after 5 seconds or so the motor stops running. I start the motor again the LCD displays the speed and then again after 5 second or so it stops.
When i try connecting the RS232 to my laptop to display the speed using MikroC UART terminal the motor run normaly and displays the speed, its only when use the LCD to display the speed that the motor stops running after 5 seconds or so.
The code below is the LCD to receive the speed:
Code:
// LCD module connections
sbit LCD_RS at LATD0_bit;
sbit LCD_EN at LATD1_bit;
sbit LCD_D4 at LATB0_bit;
sbit LCD_D5 at LATB1_bit;
sbit LCD_D6 at LATB2_bit;
sbit LCD_D7 at LATB3_bit;
sbit LCD_RS_Direction at TRISD0_bit;
sbit LCD_EN_Direction at TRISD1_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
char text[60];
void main() {
ADPCFG = 0xFFFF; // Configure AN pins as digital
UART1_Init(19200); //Initialise UART and 19200 baud rate
delay_ms(100);
Lcd_Init(); //LCD Initialise
LCD_Cmd(_LCD_CURSOR_OFF); // send command to LCD (cursor off)
LCD_Cmd(_LCD_CLEAR); // send command to LCD (clear LCD)
do
{
if (UART1_Data_Ready()) { // if data is received
UART1_Read_Text(text, "s", 30); // reads text until 's' is found
Lcd_Out(1,1, text); //display on LCD
}
}while(1);
}
Could anyone please assist me what causes the motor to stop running when displaying on LCD?
Thank you.