EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / Thanks a lot about your

Thanks a lot about your

|

Microcontroller › 8051 › Cannot Receive 4digit Integer value from serial port › Thanks a lot about your

December 10, 2014 at 9:17 am #12408
Bakhtiar
Participant

Thanks a lot about your reply.

 

 

Ok if i use array then my program is receive using serial first time data here is my code.

 

void compare()
{

if(strcmp(msg,”1234″)==0)
{
 
     lcdcmd(0x01);
     lcddata(‘B’);
    
   }
if (strcmp(msg,”4321″)==0)
{

 
     lcdcmd(0x01);
     lcddata(‘C’);
        

   }
}

 

 

void recieve() interrupt 4
{

int i;
while (RI != 1) {;}

msg[i++] = SBUF;
RI = 0;    

        compare();
    
 
 }

 

 

for example: after running the code it take any one of the input

 

if input “1234”

 

then it worked.

 

but at the same time when i input

 

“4321”

 

it will not take.

 

please help me

 

RSS Recent Posts

  • Buffer design? February 9, 2026
  • BPF February 9, 2026
  • To couple or decouple February 9, 2026
  • ANOTHER OLD PROJECT REDO February 9, 2026
  • Op amp shock February 9, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise