Continue to Site

# AVR ATmega8,16,32 Programming

Status
Not open for further replies.

#### imranahmed

Please let me know that I want to learn AVR microcontroller ,its timer,interrupt,ADC,PWM and etc.
Can anyone interested to tell me about AVR Programming ,I have ATmega8.

imranahmed

### imranahmed

Points: 2
Please let me know that how to convert kHz to Kbps?

In what context, what does this refers to?

In the datasheet of ATmega8,ths data transfer rate given is (Up to 400kHz Data Transfer Speed).
It is given in kHz but usually data rate are in Kbps.How we know the value of Kbps if data rate given in
kHz?.

ths data transfer rate given is (Up to 400kHz Data Transfer Speed)

The datasheet of AVR is 400 pages , in which specif peripheral do you refer?

It is the I2C serial protocol so the transition speed equals the clock speed, 400KHz is basically 400Kbps since for each clock one bit it send/received through the data line

imranahmed

### imranahmed

Points: 2
There is any conversion formula for kHz to Kbps or Kbps to kHz.

But there is no need for that, when you have a data line that sends one bit in each clock then you can talk about KHz or Kbps and it is the same thing.

imranahmed

### imranahmed

Points: 2
when you have a data line that sends one bit in each clock then you can talk about KHz or Kbps and it is the same thing.

thats right, i agree with you ...
in I2C (100 KHZ = 100 Kbps) and (400 KHZ = 400 Kbps) and so on ...

Note that, the most data rate used in I2C is 100 Kbps

Note that, the most data rate used in I2C is 100 Kbps

Apparently wikipedia disagrees https://en.wikipedia.org/wiki/I²C#Design

The I²C reference design has a 7-bit or a 10-bit (depending on the device used) address space.[5] Common I²C bus speeds are the 100 kbit/s standard mode and the 10 kbit/s low-speed mode, but arbitrarily low clock frequencies are also allowed. Recent revisions of I²C can host more nodes and run at faster speeds (400 kbit/s Fast mode, 1 Mbit/s Fast mode plus or Fm+, and 3.4 Mbit/s High Speed mode). These speeds are more widely used on embedded systems than on PCs. There are also other features, such as 16-bit addressing.

The AVR actually supports the 400Kbps speed.

imranahmed

### imranahmed

Points: 2
Please let me know that i installed AS6 but an error occurred during compiling program is "board.h: No such file or directory" how to solve and make hex file successfully.And what is Atmel USB?

Code:
/*
* First_projectATm8.c
*
* Created: 1/4/2013 2:48:53 PM
*  Author: Imran Ahmed
*/
#define F_CPU 4000000    // AVR clock frequency in Hz, used by util/delay.h
#include <avr/io.h>
#include <util/delay.h>
void main(void)
{
PORTC=0;
_delay_ms(1);
PORTC=1;
}

Last edited by a moderator:

You are probably trying to compile a code that you have downloaded from somewhere but you are missing board.h , you should get it from the same source, it is not part of the atmel studio.
The code you have presented doesn't have a reference to such a header so I think you refer to some other code.

Please let me know that in the attached file the 4 circle portions shows what?

#### Attachments

• as6.bmp
769.1 KB · Views: 46

If you intent to make a program for AVR using C just use the first option.

For further info refer to the manual

imranahmed

Points: 2