need help to start with chips again

Discussion in 'The Projects Forum' started by nomaddamon, May 2, 2012.

  1. nomaddamon

    Thread Starter New Member

    May 2, 2012
    7
    0
    I need help with a aTiny processor hardware question.

    the project is to control a servo using 2 hall affect sensors ( different positions on a path). the first will move the servo 180 degrees, the next sensor will make it rotate to the 360 position. The the first sensor will move it to the 540 / 180 position etc...

    I can make a LED blink and even make a red and green flash as alternating using a aTiny chip and B.A.S.I.C. programming

    however, it has been 10 years since I used micro controllers and my progression with aTiny is really slow (due to me). I have researched the aTiny range and believe that the PWM ability will be great for the servo and having multiple I or O ports as well should be great even from a small chip.

    I also hope that servos can do what I require above. If they can NOT then the project would be

    hall affect sensor (driven by a magnet) will trigger a small electric motor (using a worm gear) to start rotating clockwise, a IR sensor will tell it to stop, once it rotates 180 degrees using a simple rotating disk with 2 holes in it the IR transmitter on one side and the receiver on the other.
    Once the IR sensor fires the motor will stop
    It will now wait for the next Hall affect sensor to fire where the same process as above will occur (motor starts until the IR sensor fires after 180 degrees).

    Could some kind sole point me in the right direction. I have tries Hall effect sensors with no success. I did get the servo to move however controlling it is another thing.
    I am (reasonably) sure that everything I have tried is wrong.

    all feedback appreciated, all links will be read. If someone could just say do this and you should be half way there it would be really great as well.

    thanks nomad.
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,420
    3,355
    Which MCU chip are you using?
    Which BASIC are you using?
    What is the fastest you can make the LED flash?
     
  3. nomaddamon

    Thread Starter New Member

    May 2, 2012
    7
    0
    ATtiny2313 and ATtiny85 - tried both

    Atmel ISP programmer with the basic from the Amtel web site

    the leds can flash red On Green Off / red Off Green On at any speed within the limits of the the cycle of the processor.
    IE. the 20MHZ will allow me to use a few cycles to do what I need and the a few cycles to reverse the process. However I currently have then flashing at 1 second (approximately) intervals.

    thanks

    nomad.
     
  4. MrChips

    Moderator

    Oct 2, 2009
    12,420
    3,355
    Do you have an oscilloscope?
    The fastest a program can toggle a port is 3 instruction cycles.
    If you can do that with your BASIC then it must be a complier and not an interpreter.

    Can you post the link to the Atmel BASIC?
     
  5. nomaddamon

    Thread Starter New Member

    May 2, 2012
    7
    0
Loading...