Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Volatile variable uasge in USART receiving /or relation with UDR register in AVR

Status
Not open for further replies.

embRTS

Full Member level 4
Joined
Sep 8, 2013
Messages
201
Helped
36
Reputation
72
Reaction score
33
Trophy points
28
Location
Bangalore
Activity points
1,191
Hi I want to receive data data from Sim908 module which gives GPS Data when a particular AT command is sent to Sim908 via AVR or any other Microcontroller

Now I wish to use a variable
with Volatile
like
volatile unsigned char buffer[]=" ";
and I am also including ISR for USART
u8 i;
ISR(USART1_RXC_vect)
{
buffer = UDR1;
i++;
}
in the main function

I am sending that At command in an infinite loop at at delay of 10seconds

Now My question will the data changes as I had observed that the data is not changing
sample
main
{
while(1)
{
_delay_ms(200);
send_sring_uart("AT+CGPSINF=0\r");
_delay_ms(500);
while(buffer!='\0')
{
buffer = UDR1;
i++
}
_delay_ms(1500);
and after this i am printing data
and again delay of 10seconds just as I wished
}
So my question is what variable type I use or Can you explain me the concept of Volatile variable
as i have thought that volatile variable changes automatically without accessing the register I mean I am confused on this as data which is receiving is in the UNIVERSAL DATA REGISTER ( UDR ) of a microcontroller
please help me out
Thanks in advanc
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top