Need some help and advice in microcontroller

Discussion in 'Embedded Systems and Microcontrollers' started by Sonoma_Dog, Sep 9, 2008.

  1. Sonoma_Dog

    Thread Starter Active Member

    Jul 24, 2008
    99
    0
    Hi all. I am trying to build a LED flash sign for advertising. I am looking for a microcontroller that have 16+ I/O port and able to program it in C. I am not too much concern about the memory size, and the clock speed just needs to be fast enough to PWM control the LEDs, which is above 24 blinks per second :)

    So anyone have any advice which microcontroller I should get? money is a huge concern, because i am trying to build this thing as cheap as possible.


    Thanks in advance.
     
  2. Sonoma_Dog

    Thread Starter Active Member

    Jul 24, 2008
    99
    0
    I have done some research on some microcontroller, the cheapest one i can found is about 30$ usd.

    does anyone know any microcontroller that is cheaper?

    thanks
     
  3. kammenos

    Active Member

    Aug 3, 2008
    127
    0
    You may use some microchip PIC micros. They cost from 1 to 6 dollars. 30$ is extraordinary!!! Maybe you are looking wrong
     
  4. SIcam

    Active Member

    Aug 9, 2008
    61
    0
    Have you thought about the Arduino board? $20 bucks and free loading software with onboard bootloader. Super simple to program.
     
  5. Sonoma_Dog

    Thread Starter Active Member

    Jul 24, 2008
    99
    0
    I must have looked at it wrong, let me do some more research on it. Can the cheap microcontrollers program in C? because i hated assembly language. and what software should i use to program it. I have used winAVR before , and i think it is a freeware.

    I have only worked with AVR before, i believe it was a Atmel mage128 that i was working on and i have never used a PIC before, so I also wanted to know what is the different between the two?

    Thanks for your help
     
  6. Sonoma_Dog

    Thread Starter Active Member

    Jul 24, 2008
    99
    0
    Hey SIcam, I just took a quick look at the Arduino board. looks like they have their own programming language (Arduino programming language) . What i am looking for is something i can program in C, because that is the only language i am kidda familiar with.

    But anyhow, Can the Atmega168 chip (link 1) operate alone without the assembled Arduino (link 2) once the chip have been programmed? in other words, after programed the Atmega168, can i put the chip out and use it? or does it have to stay on the assembled Arduino for it to operate?

    link1 : http://www.adafruit.com/index.php?main_page=product_info&cPath=17&products_id=56

    link2 : http://www.adafruit.com/index.php?main_page=product_info&cPath=17&products_id=50

    Thanks !
     
  7. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    WINAVR is definitely freeware. You will also need to download the freeware AVRSTUDIO4 which provides the Integrated Development Environment (IDE).

    hgmjr
     
  8. SIcam

    Active Member

    Aug 9, 2008
    61
    0
    Sonoma Dog, Programming the Atmel Atmega in the Arduino is so simple even I can to it. It is a breeze. Go through the following Tutorial and you can see yourself how easy it is.

    http://www.ladyada.net/learn/arduino/index.html

    If you dont want to fork out $34 bucks for the Arduino Decimila then you could go for the MaxSerial Freeduino for $19 bucks the difference is it is RS232 Serial port instead of USD port.
    http://spiffie.org/electronics/archives/microcontrollers/Build%20a%20MaxSerial%20Freeduino.html

    The Atmel Atmega168 can be separated out just like a PIC chip however just like any pic chip you will need to regulate a supply voltage to it and have an external oscillator ( Crystal Oscillator) and then make sure that your input/output voltage and current levels are controlled and meet the requirements of the chip.

    All I can say if if you have $20 bucks to spare ya gotta get one of these things.

    Wanna make an LED Blink on an output then this is the program:

    int ledPin = 13; // LED connected to digital pin 13

    void setup()
    {
    pinMode(ledPin, OUTPUT); // sets the digital pin as output
    }

    void loop()
    {
    digitalWrite(ledPin, HIGH); // sets the LED on
    delay(1000); // waits for a second
    digitalWrite(ledPin, LOW); // sets the LED off
    delay(1000); // waits for a second
    }

    Wow, How simple.
     
  9. Sonoma_Dog

    Thread Starter Active Member

    Jul 24, 2008
    99
    0
    SIcam

    I understand that when using the Atmel Atmega168 separately will requires a supply supply, but what is the external oscillator for, I thought the chip itself have a internal clock already? and how much are the crystal oscillator(I never used one and have no idea what it looks like), and can it be done with a 555 counter?

    and you said that make sure that the I/O ports meet the requirement, it means not to have any ports flooding and not exceeding the current rating, right?

    The program looks pretty easy to understand, it looks just like C language. I think I will definitely go for this microcontroller.

    Thanks for all the replies
     
  10. SIcam

    Active Member

    Aug 9, 2008
    61
    0
    Controllers have timing to them. In order to have time control you will need a circuit that oscillates. You could use a tank circuit to create an oscillator but as the voltage varies your circuit timing can change. It is best to use a Crystal Oscillator an they are very cheap. Like a buck fifty.

    http://www.sparkfun.com/commerce/product_info.php?products_id=536

    It sounds like you need to just start with the Arduino Decimila through your computer USB port with a USB A to B cable and one LED ( pin 13 to GND on Decimila) I recommend you getting the UV LED as it is cool to see the counterfit protection on currency and credit cards that you can not see in normal lighting. Its only 99 cents for the fun anyway.

    The Arduino is reusable (reprogrammable) so you can build structure to interface with it then move it and reprogram it. ( about 2 seconds to change programs.)

    good luck - Arduino and you'll never regret it.
     
  11. Sonoma_Dog

    Thread Starter Active Member

    Jul 24, 2008
    99
    0
    Cool, I am going to order one of these bad ass tomorrow, one more question tho. how would you connect the crystal to ATmega168? I was looking at the PDIP package (see picture), it doesn't mention anything about the external clock. and how does the crystal oscillator works? there is only 2 pins .

    Thanks
     
    • 1.JPG
      1.JPG
      File size:
      31.2 KB
      Views:
      15
  12. SIcam

    Active Member

    Aug 9, 2008
    61
    0
  13. Sonoma_Dog

    Thread Starter Active Member

    Jul 24, 2008
    99
    0
    Great!, sounds like i have some reading to do tomorrow, thank you for your help SIcam.
     
  14. abhi_nav

    New Member

    Nov 4, 2008
    1
    0
    i m working on a project which requires interfacing of mobile with microcontroller..i am really facing problems in writing commands for this interfacing circuit...nybody plzzz help me asap.
    abhinav
     
Loading...