What about trying Code::blocks for AVR

Embedded Systems Topics
Post Reply
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

What about trying Code::blocks for AVR

Post by SemiconductorCat » Mon Jun 10, 2013 8:04 am

Hi all, today I'm going to show you how to use Code::blocks to write programs
to your Atmega8 chip.


Software Downalodas:

1. Code::Blocks for Arduio and AVR.
You could download it here: http://sourceforge.net/projects/arduinodev/
2. eXtreme Burner.
You could download here: http://extremeelectronics.co.in/softwar ... beta-test/


What you need:

1. ATMega8 microcontroller. You could buy from TRONIC.LK

2. USBASP programmer

3. Windows installed x86 computer with USB 1.0 port available.

4. Some few components and a 5V power supply.

First you have to download the software.

Please note that you need to download modified version of the code::blocks called code::blocks for ardino and avr. You could download code::blocks and avrgcc and configure code::blocks to use avrgcc too,but it would be lots of configurations but it will give you lots of knowledge. I do really encourage you to do that, but anyway I will continue this tutorial using "Code::blocks for Ardino and AVR".

So let's begin.

So here is a video that guide you through downloading code::blocks and write your first program to blink LED.

https://www.youtube.com/watch?v=ob2ooqvp0Ik


This is the source code of the firmware.

Code: Select all

#include <avr/io.h>
#include <util/delay.h>

int main(void)
{
  DDRB |= _BV(DDB0);
  while (1)
  {
   PORTB ^= _BV(PB0);
   _delay_ms(500);
  }
  return 0;
}

Circuit that you need to build.
Image


And this is the working video.
https://www.youtube.com/watch?v=7tCK6BLIubY


I take the original idea from here:http://www.micahcarrick.com/tutorials/a ... arted.html
Most of the credits should gone to him.


And also some credits should go to 'Chanaka' , where I'm messed up with that crystal issue.
However sorry about the low quality of the video.

Hope you enjoy using codeblocks for AVR [I don't know about ardino].
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: What about trying Code::blocks for AVR

Post by Neo » Fri Jul 26, 2013 4:17 am

Nice article. Well done!
Post Reply

Return to “Embedded Systems”