Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: recommendations for attiny or arduino newb?

  1. #1
    MySQL Error soundman98's Avatar
    Join Date
    Jan 2008
    Location
    on the border of northern IL/IN
    Posts
    5,848

    recommendations for attiny or arduino newb?

    i figured this would be the best place to post this due to the large amount of programmers..

    long story short, i have this led project that requires pwm. i have done a lot of led projects, all of them specifically avoiding pwm because i can not stand flicker. this project cannot avoid it, so i need to approach it head-on. i need a pwm solution that can pwm a led in what i believe to be the 500+hz range to avoid visible flicker.

    at this moment, i have a attiny13a and a arduino mega 2560 on hand(as well as a "getting started with arduino" book).

    while i understand that they are different programming environments, what do i need to learn to use and program either?

    i started at this thread, but by page 2 my head is starting to spin with all the words. i want to order some parts so i can attempt to program while reading so that the words are more then just words, but don't have a clue where to start.


    thanks.
    Last edited by soundman98; 01-02-2012 at 05:03 PM. Reason: add link

  2. #2
    Maximum Bitrate kegobeer's Avatar
    Join Date
    Nov 2010
    Location
    Panama City Beach
    Posts
    629
    I've got a friend that has a lot of experience with arduino. I'll ask him about it tomorrow and hopefully I'll have some info for you.
    1999 Mercury Grand Marquis GS with: ASRock E350M1 w/4GB RAM, 80GB Intel SSD, Opus DCX3.120, Visteon HD Radio + HDR-USB, PL-18N wifi, OBDLink Scan Tool, BTA6210 BT, BU-353, Win 7 Ultimate, CF 4.0, Alpine MRP-F240 + MRP-T220, RF Punch 1572s, Kicker 8" Comp.

  3. #3
    Variable Bitrate mayhembdm666's Avatar
    Join Date
    Mar 2008
    Location
    Adelaide, Australia
    Posts
    234
    What do you need to know directly? I have been playing around the with arduino in my off time from work and well have done various sketches and circuits with it.
    Are you after just how to create a very simple program and execute it on the arduino or ?
    2004 Holden WL Caprice Auto GENIII
    Base System = Raspberry Pi
    Everything else is pending for now as switched from a Mini-ITX setup

  4. #4
    Raw Wave
    Join Date
    Nov 2009
    Posts
    2,119
    I've had a couple of Arduino Duelimovs for well over a year. But let's forget about that...


    Have you considered a PICAXE or PIC. I've started looking at the 8 pin, er, 8 leg PICAXE-08M. It has PWM.


    If it's manual control, there is a simple pot (knob) adjusted 555 circuit for 400Hz which can easily be changed... somewhere...

  5. #5
    ibf
    ibf is offline
    Variable Bitrate
    Join Date
    Oct 2010
    Posts
    245
    Really depends what you want to get out of it. You are better off using the MCU on its own, for what you are trying to do arduino is over kill. I see people buy expensive devboard, flash a few LEDs then stuff the well capable unit under the dashboard and call it a project they are proud off. When they now need to control some relays or flash some more LEDs they buy some more arduinos.

    To PWM an LED is very easy, you dont even need PWM hardware to do that. Writing it in assembly shouldnt cause too much problem even for a beginner, plus it is always beneficial to learn some ASM when playing with MCU, so get that out of the way while you can. Soon you might wanna move on to C once you start dealing with big projects.

    I avoid arduino, picaxe, stamp, etc etc, I find them awkward for real projects. Just get a programmer + MCU of your choice and start coding.

    Anyway my main point in this post is... use the right tools and right parts for the job. A decent programmer, compiler/assembler for your MCU and you should be set. I wouldnt bother with arduino at this point.
    Last edited by ibf; 01-03-2012 at 08:38 AM.

  6. #6
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,146
    Blog Entries
    51
    I'm finding programming for the arduino without the use of the sketches is QUITE the chore. I understand that the device isnt necessarily built to be controlled by a PC, but they should still have a baseline of accessibility without depending on external scripts i think.
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Find my plugins on the MP3Car App Store!
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

  7. #7
    MySQL Error soundman98's Avatar
    Join Date
    Jan 2008
    Location
    on the border of northern IL/IN
    Posts
    5,848
    ^ and that is the exact reason for this thread. i don't know any better, messing with it didn't seem so bad to me..


    mayhembdm666: i am trying to sift through the variety of controllers to locate one that meets my current needs, but can also be used in other lighting-related projects(primarily interested in custom pwm/flashing sequences). at the same time, i have also decided that i need to learn how to do it instead of relying on others to do it for me. while i am sure i could get someone else to do it, my mind is rarely always made up on the perfect solution of doing something, so if the chip has the capability to change things, i would like to leverage that from time to time, without bugging someone to rewite some code that i don't understand..

    oldspark-- i did try some 555-based circuits before i went this route, and the circuits that i've tried have pulses that are too visible.

    after playing with the arduino some last night, i've determined that i cannot go lower then 1000hz for a pwm signal.. i don't know if it will do everything i need it to, but need to try.


    Quote Originally Posted by ibf View Post
    Really depends what you want to get out of it. You are better off using the MCU on its own, for what you are trying to do arduino is over kill. I see people buy expensive devboard, flash a few LEDs then stuff the well capable unit under the dashboard and call it a project they are proud off. When they now need to control some relays or flash some more LEDs they buy some more arduinos.

    To PWM an LED is very easy, you dont even need PWM hardware to do that. Writing it in assembly shouldnt cause too much problem even for a beginner, plus it is always beneficial to learn some ASM when playing with MCU, so get that out of the way while you can. Soon you might wanna move on to C once you start dealing with big projects.

    I avoid arduino, picaxe, stamp, etc etc, I find them awkward for real projects. Just get a programmer + MCU of your choice and start coding.

    Anyway my main point in this post is... use the right tools and right parts for the job. A decent programmer, compiler/assembler for your MCU and you should be set. I wouldnt bother with arduino at this point.
    do you have any recommendations?

    ASM-- is that assembly code?

    isn't the attiny13a a micro controller--that's what MCU is right? the only reason i have this is because it was used in what i thought was a 555-timer based pwm circuit.

    the arduino is only familiar to me in name. up to this point i have really avoided learning any code of any sort, so i really don't have any idea where to start.. but i have seen so many threads here about the 'best' programming language, and if i am going to learn, i would prefer to try to learn the right way the first time instead of jumping from method to method.


    thanks for the reply's guys.
    Last edited by soundman98; 01-03-2012 at 07:42 PM.

  8. #8
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    Maybe we should approach this with what are you trying to do? A 555 timer circuit can be made super fast or super slow. It is all in the RC time constant.

    Also any MCU worth its salt can make a PWM with any speed up to its maximum speed. So slower is always easy.

    I would recommend picking a PWM frequency that is high, and then change the duty cycle to gain various brightness (if that's what you are doing)...

    Also 60Hz is sufficient for human flicker, 240Hz covers every human. Pulsing at 25KHz isn't bad, it is just different.
    Fusion Brain Version 6 Released!
    1.9in x 2.9in -- 47mm x 73mm
    30 Digital Outputs -- Directly drive a relay
    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
    Buy now in the MP3Car.com Store

  9. #9
    ibf
    ibf is offline
    Variable Bitrate
    Join Date
    Oct 2010
    Posts
    245
    Quote Originally Posted by soundman98 View Post
    ^ and that is the exact reason for this thread. i don't know any better, messing with it didn't seem so bad to me..


    mayhembdm666: i am trying to sift through the variety of controllers to locate one that meets my current needs, but can also be used in other lighting-related projects(primarily interested in custom pwm/flashing sequences). at the same time, i have also decided that i need to learn how to do it instead of relying on others to do it for me. while i am sure i could get someone else to do it, my mind is rarely always made up on the perfect solution of doing something, so if the chip has the capability to change things, i would like to leverage that from time to time, without bugging someone to rewite some code that i don't understand..

    oldspark-- i did try some 555-based circuits before i went this route, and the circuits that i've tried have pulses that are too visible.

    after playing with the arduino some last night, i've determined that i cannot go lower then 1000hz for a pwm signal.. i don't know if it will do everything i need it to, but need to try.




    do you have any recommendations?

    ASM-- is that assembly code?

    isn't the attiny13a a micro controller--that's what MCU is right? the only reason i have this is because it was used in what i thought was a 555-timer based pwm circuit.

    the arduino is only familiar to me in name. up to this point i have really avoided learning any code of any sort, so i really don't have any idea where to start.. but i have seen so many threads here about the 'best' programming language, and if i am going to learn, i would prefer to try to learn the right way the first time instead of jumping from method to method.


    thanks for the reply's guys.
    Ok thats cool you sound serious with this and want to learn it the right way... (and yes MCU is the microcontroller and ASM is assembly)

    In that case avoid arduino etc etc just use the MCU on its own.

    The reason why I say learn some asm its because programming the MCU is different from windows apps for example. With MCU its important to know the MCU's hardware, how to manipulate bits, read write to registers directly and of course reading the datasheet. True asm can be very difficult for some and would like to do everything in C. But those who does not understand asm are pretty much stuck to use larger expensive MCU while a cheap smaller MCU with a few lines of asm can do the job much better. I see people use PIC32 to flash LEDs and flick relays when a PIC10F can do the same. Reason is they didnt bother to learn asm, a simple project doesnt need to be done in C, a few line of asm will do it and asm is probably the only option when you have less than half a KB of programming space.

    So...

    A simple project such as flashing LEDs, use the smallest/cheapest MCU and use asm unless of course you can fit all the code using C, up to you. Big project such as web server etc etc, not much choice here but to use C I guess. Maybe a few lines of asm if you have some critical code that need hand optimizing. For majority of the time C compiler are pretty good at optimizing anyway.

    Im not familiar with AVRs I much prefer PICs due to better HW options and are pretty much available anywhere, atleast where I live.

    I use ICD3, MPLAB with C18/C30/C32 to do all my PIC stuff.

    You can start with PICKIT then move on to a more powerful MCU once you get the hang of it.

    http://www.microchip.com/stellent/id...wwPICmicroDemo
    Last edited by ibf; 01-03-2012 at 09:28 PM.

  10. #10
    MySQL Error soundman98's Avatar
    Join Date
    Jan 2008
    Location
    on the border of northern IL/IN
    Posts
    5,848
    Quote Originally Posted by 2k1Toaster View Post
    Maybe we should approach this with what are you trying to do? A 555 timer circuit can be made super fast or super slow. It is all in the RC time constant.

    Also any MCU worth its salt can make a PWM with any speed up to its maximum speed. So slower is always easy.

    I would recommend picking a PWM frequency that is high, and then change the duty cycle to gain various brightness (if that's what you are doing)...

    Also 60Hz is sufficient for human flicker, 240Hz covers every human. Pulsing at 25KHz isn't bad, it is just different.
    i ran some basic arduino code-- just 50% duty cycle at some different frequencies:

    60hz is only ok if i strap my head down and glue my eyeballs in so they can't move... 240 is better, but still easily noticable to me while moving my head..


    note-- this project is going to be used to adjust my speedometer and hvac backlight brightness, so it will always be in my peripheral vision, and i am extremely sensitive to low pwm rates..

    here's the thread:
    http://www.hidplanet.com/forums/show...l=1#post447193

    basically, all of my controls used differently colored led's, and instead of scaling the resistors to permanently dim them to night levels, i want a method that i can keep maximum brightness, but also not destroy my night vision when it matters. the other issue is that i have odd strings, so the current draw is not the same per string, so changing the voltage won't work correctly.


    i originally tried 2 versions of pwm controllers, one based on the attiny13a, i believe it to be a 60hz pwm, though without a scope, no real way to confirm that. the other version i tried was just a cheapo ebay one that appears to be partially based on a 555-timer(there is a 555 chip in the housing), it was much better, but i could still easily pick up the flicker while mock driving my workbench..

Page 1 of 3 123 LastLast

Similar Threads

  1. OBDII Arduino Shield
    By bwallen in forum Hardware Development
    Replies: 6
    Last Post: 02-14-2012, 11:35 AM
  2. Arduino for OM - In progress
    By jmullan99 in forum OpenMobile
    Replies: 22
    Last Post: 03-13-2011, 04:43 PM
  3. Using Arduino to Auto-dim LED EBY701?
    By stevey500 in forum LCD/Display
    Replies: 29
    Last Post: 08-21-2010, 12:04 AM
  4. Arduino BT CarPC power controller
    By d_mc_a in forum Hardware Development
    Replies: 4
    Last Post: 03-18-2009, 09:20 PM
  5. Replies: 4
    Last Post: 06-08-2008, 10:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •