1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

Atmel C one cycle

Discussion in 'Embedded' started by gregadelliot, Apr 4, 2006.

  1. gregadelliot

    gregadelliot Guest

    Hi,

    I'm a bit struck at present as I am trying to make my data transfer
    over a clock cycle. I'm new to C in terms of using it on
    microcontrollers. my task is like -

    __ __ __ __ __
    __| |__| |__| |__| |__| |____ - clock
    ____ ____ ____
    __| |___| |___| |_______- data

    I am using a AT89C51ED2, I don't understand how to use the timers, and
    to achieve my goal I dont get whether I need to watch the overflow of
    both TH0 and TH1.

    Can anyone show me an example because im very confused by this...

    I don't really understand the setup of them and the values that are
    placed into the things like TMOD, SCON, TH1, TL1...

    Thank you for your response

    David
     
    gregadelliot, Apr 4, 2006
    #1
    1. Advertisements

  2. gregadelliot

    Rich Webb Guest

    I feel your pain but you're looking for an explanation of 'way too much,
    all at once, as well as not really specifying the exact design
    requirements with respect to the data transfer.

    Atmel has some good app notes on their web site. There is also a great
    deal of family-general information at http://www.8052.com/

    Recommend before jumping right into pacing a data transfer that you
    start out with just using the timers to toggle an I/O pin until you get
    comfortable with manipulating the controlling registers.
     
    Rich Webb, Apr 5, 2006
    #2
    1. Advertisements

  3. Hi,
    Just realised that my ascii image might be muddled up, so i've placed
    the image on a webpage -

    http://tinyurl.com/rry9c

    I want to use the atmel for the clock, and its not really fussy
    regarding time as the device only requires that the data be transfered
    in this means with a clock cycle of greater than 25ns.

    thanks

    David
     
    googlinggoogler, Apr 5, 2006
    #3
  4. gregadelliot

    Bob Guest

    Try using the SPI (page 64 of the datasheet). Much easier than bit
    twiddling.

    Bob
     
    Bob, Apr 5, 2006
    #4
  5. gregadelliot

    CBFalconer Guest

    What image? Without context your post is meaningless. Google is
    not usenet, it only provides a foul interface to usenet. See my
    sig and the URLs therein for who to use google intelligently.

    As far as ascii images are concerned, just be sure you always used
    fixed spacing fonts.

    --
    "If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers." - Keith Thompson
    More details at: <http://cfaj.freeshell.org/google/>
    Also see <http://www.safalra.com/special/googlegroupsreply/>
     
    CBFalconer, Apr 6, 2006
    #5
  6. gregadelliot

    Peter Guest

    Your processor at 40MHz is going to have a timer interval of at least 300nS
    so no worries on excessive speed there. If you are new to timers then I'd
    start off by making a couple of LEDs flash at a rate that you can see, then
    ramp it up.

    Peter
     
    Peter, Apr 6, 2006
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.