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 / 1. how do u kno data

1. how do u kno data

|

Microcontroller › PIC › problem in receving message with pic16f877a › 1. how do u kno data

January 7, 2014 at 4:22 am #10832
kittythakur
Participant

1. how do u kno data fm UART1_Read() is gud?

hello dear,   actaully m running my code in proteous bcoz my hyperterminal and com port is not wroking well.i m using virtual terminal with receiving and transmiting pin.,so when i give input on rx pin through virtual terminal ,it stores in  UART1_Read().after that i use UART1_Write(UART1_Read()); i get the same string on tx virtual terminal which i sent on rx pin.thats why i m saying UART1_Read is gud . but i want to store the string from UART1_Read() to  in a array,so that i can print data on lcd with the help of ” for loop. “

2. what exact prblem u get – compile err? run err? what?  same problem every time (with same SMS txt) or no?

i think, you got my problem now, . i m unable to store received data into a array

here  inchar=UART1_Read();

 

 

 

#define led1 PORTC.F1
#define led PORTC.F0
#define RS PORTC.F2
#define RW PORTC.F3
#define EN PORTC.F4
unsigned char inchar;
unsigned int i=0,j,k;
char buffer[80] ;
void Tx();
void cmd( unsigned char x)
{
PORTD=x;
RS=0;
RW=0;
EN=1;
delay_ms(100);
EN=0;
}
void dat ( unsigned char x )
{
PORTD=x;
RS=1;
RW=0;
EN=1;
delay_ms(100);
EN=0;
}
void int_lcd()
{
cmd(0x38);
cmd(0x0e);
 
cmd(0x06);
cmd(0x80);
}
  void rcv ()
 {
inchar=UART1_Read();   // i want to store received string in a buffer .and after that i want to print on lcd .i m having problem
delay_ms(100);
while(inchar!=’’)
{ 
 buffer=inchar;
i++;
}
 
}
 
void main()
{
TRISD=0x00;
TRISC=0x80;
led=0;
led1=0;
UART1_Init(9600);
delay_ms(300);
UART1_Write(0x0D);
delay_ms(300);
UART1_Write_Text(“AT+CMGF=1”);
UART1_Write(0x0D);
delay_ms(300);
UART1_Write_Text(“AT+CNMI=2,2,0,0” );
UART1_Write(0x0D);
delay_ms(300) ;
    int_lcd();
while(1)
{
led1=1 ;
if(UART1_Data_Ready()>0)
  {
  rcv();
for (j=0;j<=8;j++)
  {
  dat(buffer[j]);
  delay_ms(10);
 
  }
     cmd(0x01);
 
}
       // UART1_Write_Text(“AT+CMGD=1,4”);
 
}
}

firstly i want to controll led but now i want to  print data on lcd .

 

RSS Recent Posts

  • volkswagen car stereo model rcd310 December 11, 2025
  • Dog fence help December 11, 2025
  • anyone recognizes this laser diode? December 10, 2025
  • How to power motors for lumbar support? December 10, 2025
  • EEPROM not being written or read on dsPIC30F2010 December 10, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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