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.
Best way is first connect the device with PC using Serial PORT and try to give AT commands using Hyperterminal to know, how AT command works for device.
First ensure that microcontroller is working or not. Just set any pin as High or low to get confirmation that CLK and reset are applied correctly to microcontroller. If it is working. Then you have you check whether PORTC by default is IO or not. If not check the register configuration in Datasheet.
Error in code:
In your application,
1 second is on INT_count value upto 15.
as INT_count has initially zero value it will first decrease by 1 and its value become 255.
initial time taken will be 256/15=17.06S.
Solution:
initialize the global variable.
BYTE INT_count =...
Ensure that you informed the processor about the Intterrupt flag is cleared.
For example
void interrupt()
{
VICVectAddrr=0;
}
You will it will generate the interrupt for every time.
Two ways
1) Software method.
void pwm_function(pwn_value)
{ Set_bit_High;
delay(pwm_value);
set_bit_Low;
delay(100-pwm_value)
};
in above program , pwm_value is indicated in 100%.
2) Choose a microcontroller with internal PWM hardware
update the PWM registers.
Internal Reference is not accurate, it will vary from microcontroller to microcontroller,even if you have chosen the same microcontroller number.
Better is go through external Reference.
Better way first learn the AT Commands, Download the AT commands for Nokia Phone.
Second thing,Connect your phone with PC using Serial Cable.
Open the Hyper Terminal and write down the AT commands and check the behavior.
You will see lots of shift operations in AVR microcontroller programming.
for example to set any pin High
#define LED PB0
PORTB|=(1<<PB0).
It makes PB0 pin as High
PORTB&=~(1<<PB0).
it makes PB0 Pin as Low.
Start reading Simple I/O Operations like making Led On and Off.
Just read Datasheets.
Try the following steps for good programming style.
1) create function which send data to lcd with its pos.
void lcd_data_register(unsigned char info_data,unsigned char position);
2) create another function which print string to lcd.
void char_display(char *ptr,unsigned char position)
{...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.