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.

[AVR] microcontroller and sim800c interfaing with Uart interrupt

Status
Not open for further replies.

vtm

Newbie level 2
Joined
Jan 11, 2018
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
15
Hi every one,
i have problem with data receiving form GSM(sim800c) using uart interrupt in atmega328,so please give me the code of uart interrupt of atmega328
thank you
 

Hi,

Don't expect others do your work. This is not how a forum works.

*****
There are many thousands of code examples in the internet.

i want only atmega328 interrupt code for receiving msg from Gsm
UART interrupt is just a flag that shows that data (usually one byte only) is available in the UART input buffer.
It can start an ISR automatically.

Init:
Before you can use the UART periferal and the ISR you need to configure it. This needs to be done in initalize_section at the beginning of main().

ISR:
So the task of the ISR is to read the byte from the UART interface and store it into an software UART buffer.
(This is independent of UART parameters - like baudrate - and it's independent where the data come from - like GSM)
That's usually all that should be done within the ISR.
The ISR should be as small (in time) as possible.
All the data parsing should be done in main loop.

Other small task that can be done in ISR:
* set a received_flag to show the main loop that data is available
* check for a - one byte - data delimiter .... and conditionally set a delimiter_flag to show the main loop that the delimiter was recognized. This can be used to safe processing tim in the main loop, because you don't start the parser on every received byte, but after the delimiter is received

In main loop:
- here is where the GSM comes into play, because you need to parse the incoming data according the GSM protocol.
* use one of the above mentioned flags to start the parser.

*****
Usually all you need to know how to initialize and operate the ISR is written in the microcontroller datasheet (except UART parameters)
Usually all you need to know for parsing the data is written in the GSM datasheet.

Klaus
 

Just test your code using hypertermanal & Get it working for SIM00
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top