Atmel C one clock cycle

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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
snipped-for-privacy@hotmail.com wrote:

I would use an already implemented, tested and wide ranging bus such as I2C. Phillips has an extensive bank of information and a number of ready built modules, LCD panels etc have it built in. See: www.i2c.philips.com
Goto http://www.keil.com/dd/chipinfo.asp?did599&bhcp=1 Apart from the wealth of knowledge about your chip there is a link about half way down there is a link on the right hand side for I2C drivers for uVision which I'm guessing is a compiler/debugging platform.
I hope this helps.
--
/-----------( Brendan Gillatt )----------\
<---( http://www.brendangillatt.co.uk )---->
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Sorry Brendan but you dont understand, a device called a PLL300 requires that data be fed into it via this means, im not great at C hence my reason for asking and i've never used an Atmel before so im kinda, ermmm, drowning at the moment.
It should be be a simple problem and being well versed in VHDL have no problems in that (if(clk'event and clk = '1')), but there is no simple means to monitor an event that i know in C, although.
My first thoughts is to cascade 3 "if" statements -
if(x=1) if(x=0) if(x=0)
But this seems very clumsey to me. And would like to try and use the timers although dont really know how :-)
David
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Whoooppps, should be-
if(x=1) if(x=0) if(x=1)
David
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
snipped-for-privacy@hotmail.com wrote:

Please use a non-proportional font when drawing timing diagrams. I can not see how the signals relate to each other. Also, I would need to know at what speeds you are planning to send the signal (bit banging), and if you are planning to do other tasks at the same time (interrupt controlled w/timer). Lastly, it would be useful to know if you are generating the clock with the Atmel, or if is generated elsewhere.
Buuuuut....
better would be to check example code on the many Atmel fan sites out there
best would be to post this in 'comp.arch.embedded' :-)
Matthias
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Hi, I couldnt figure out the font thing after testing, 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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
This is much like SPI. Search for code which bit-bangs SPI, or if you have SPI support, use it. You're right it's an easy problem and there must be a ton of code out there.
We bit bang SPI on our TStik, using 8051 assy code, you are welcome to consider it: http://www.tstik.com/appnotes/spi.html#api
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.