Forums

Atmel C one cycle

Started by Unknown April 4, 2006
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

On 4 Apr 2006 13:08:33 -0700, gregadelliot@gmail.com wrote:

>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...
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 Norfolk, VA
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

<gregadelliot@gmail.com> wrote in message
news:1144181313.709489.234440@i39g2000cwa.googlegroups.com...
> 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
Try using the SPI (page 64 of the datasheet). Much easier than bit twiddling. Bob
googlinggoogler@hotmail.com wrote:
> > Just realised that my ascii image might be muddled up, so i've placed > the image on a webpage -
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/>
<googlinggoogler@hotmail.com> wrote in message 
news:1144257191.076905.202760@i39g2000cwa.googlegroups.com...
> 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 >
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