Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

[Circuit][Program][Not tested] Program atMega 164

Status
Not open for further replies.

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
47,991
Helped
14,148
Reputation
28,555
Reaction score
12,835
Trophy points
1,393
Location
Bochum, Germany
Activity points
278,341
If you know hat a DTMF decoder is, you should be able to understand the circuit operation. You are pressing a key on the telephone dial to switch a particular relay on or off...
 

dilip.dmn

Newbie level 6
Joined
May 17, 2011
Messages
14
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Activity points
1,376
If you know hat a DTMF decoder is, you should be able to understand the circuit operation. You are pressing a key on the telephone dial to switch a particular relay on or off...
See the,circuit is understandable.

Some.how the c language used in the coding is not being understood by me.
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
47,991
Helped
14,148
Reputation
28,555
Reaction score
12,835
Trophy points
1,393
Location
Bochum, Germany
Activity points
278,341
If you ignore the LCD display part, which is for informational purposes only, you'll see, that the code is mainly reacting on the level changes of the DTMF outputs. The coding style isn't applying for a brilliancy prize, but understandable though. You need to get familiar with common methods of masking port bits and similar stuff.
 

alexan_e

Administrator
Joined
Mar 16, 2008
Messages
11,895
Helped
2,021
Reputation
4,158
Reaction score
2,031
Trophy points
1,393
Location
Greece
Activity points
64,377
The code seems to be using avrgcc but the included delay routines in <util/delay.h> are _delay_ms() and _delay_us() (avr-libc: <util/delay.h>: Convenience functions for busy-wait delay loops).

I don't see any macro to translate the Delay() to any of the above functions, are you able to compile the code?
Maybe the Delay() function is defined in the LCD library but in that case why is the delay.h included in the main file where it is never used(it will be ignored by the compiler anyway if no function is used but still...)?

For bitwise operations you can read a guide like View topic - [TUT] [C] Bit manipulation (AKA "Programming 101") :: AVR Freaks

Alex
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
47,991
Helped
14,148
Reputation
28,555
Reaction score
12,835
Trophy points
1,393
Location
Bochum, Germany
Activity points
278,341
The timing unit of Delay() is an interesting detail, but not essential to understand the code operation, I think. Assuming either µs or instruction cycles won't change the order of magnitude that much.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top