Announcement

Collapse
No announcement yet.

recommendations for attiny or arduino newb?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 06:03 PM. Reason: add link
    My OLD 2001 Mitsubishi Eclipse GT:
    "The Project That Never Ended, until it did"


    next project? subaru brz
    carpc undecided

  • #2
    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.

    Comment


    • #3
      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

      Comment


      • #4
        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...

        Comment


        • #5
          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, 09:38 AM.

          Comment


          • #6
            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.)
            Follow Me on Twitter or Facebook
            Live mp3Car Facebook Chat

            Comment


            • #7
              ^ 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.


              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, 08:42 PM.
              My OLD 2001 Mitsubishi Eclipse GT:
              "The Project That Never Ended, until it did"


              next project? subaru brz
              carpc undecided

              Comment


              • #8
                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

                Comment


                • #9
                  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, 10:28 PM.

                  Comment


                  • #10
                    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..
                    My OLD 2001 Mitsubishi Eclipse GT:
                    "The Project That Never Ended, until it did"


                    next project? subaru brz
                    carpc undecided

                    Comment


                    • #11
                      If you have a 555 dev kit (sounds like it) then find the RC values it is using. You should then be able to determine what frequency it is running at. A couple cents worth of capacitors and resistors and you can change the frequency.
                      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

                      Comment


                      • #12
                        I just edited my post. It turn out blank first time round.

                        Comment


                        • #13
                          You should be able to set the frequency much higher than that.

                          Link you might find useful >

                          http://www.arduino.cc/cgi-bin/yabb2/...num=1234764073

                          Comment


                          • #14
                            Originally posted by 2k1Toaster View Post
                            If you have a 555 dev kit (sounds like it) then find the RC values it is using. You should then be able to determine what frequency it is running at. A couple cents worth of capacitors and resistors and you can change the frequency.
                            I think he want to get into MCUs, solving the problem with a 555 isnt going to help him

                            Comment


                            • #15
                              If you want to learn how to use microcontrollers, use a microcontroller.

                              An ardunio is too "high level" to learn anything. The only reason to use one is to get a project done fast. So to get a project done fast the 555 will work faster.
                              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

                              Comment

                              Working...
                              X