What about trying Code::blocks for AVR

Microcontroller, DSP and FPGA Topics

What about trying Code::blocks for AVR

Postby SemiconductorCat » Mon Jun 10, 2013 2:34 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 this at pettah or from Aptinex around 150/-Rs]

2. USBASP programmer. [I purchase this from Aptinex however ebay and also I heard there is a
place in pettah too].

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

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.

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);
  return 0;

Circuit that you need to build.

And this is the working video.

I take the original idea from here:http://www.micahcarrick.com/tutorials/avr-microcontroller-tutorial/getting-started.html
Most of the credits should gone to him.

And also some credits should gone 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
Posts: 462
Joined: Mon Aug 22, 2011 3:12 pm
Cash on hand: 23,861.30
Location: currently in hyperspace

Invitations sent: 0
Registered friends: 0
Reputation point: 9

Re: What about trying Code::blocks for AVR

Postby Neo » Thu Jul 25, 2013 10:47 pm

Nice article. Well done!
User avatar
Site Admin
Site Admin
Posts: 2612
Joined: Tue Jul 14, 2009 8:37 pm
Cash on hand: 221,202.10
Bank: 15,536,454.00
Location: Colombo/London
Medals: 2
EC_Bronze_Star (1) EC_Achievment (1)

Invitations sent: 94
Registered friends: 12
Highscores: 13
Reputation point: 74

Return to Embedded Processors & Programming

Who is online

Users browsing this forum: No registered users and 1 guest