Main Site Documentation

Sync two OutputCompare


#1

Hi,

I want to send data on a custom serial bus. I have a clock on a pin, and data on another. I need the data sent on each clock tick.

I use an OutputCompare to generate the clock.

Is there a way to synchronize the data OutputCompare (or something else) with the clock tick?


#2

You will need to implement an RLP driver for your “custom bus”


#3

OK, Thanks ^^

Where can I find a tuto on RLP?


#4

If your custom Bus does not require high speed, you can build it with software on managed code.

You have an example with software I2C here : http://code.tinyclr.com/project/297/software-i2c-driver/
Or SHT11 software driver here : http://code.tinyclr.com/project/185/sensirion-sht71--humidity-temp-and-dewpoint-rev-10b/


#5

I currently need clock ticks around 10 µs so I think I need RLP right?


#6

Right… Using managed code you would not go under 100 to 200us.


#7

This is a bad idea, generating 10uS clock in software! This is where CPLD and FPGAs excel, micros are not made to do that.


#8

I need timing around 10 µs but it will work with up to 50µs, but slower, obviously.

I wanted to do it with OutputCompare because it is driven by the crystal (I think… I’m not sure…)


#9

OutputCompare isn’t driven by the crystal per se. There is a program in the background that counts crystal clocks and changes the output on que.

The PWM is driven directly from the crystal, but it runs at a “fixed” pulse size, no good for serial.

Is there any reason that you can’t use the SPI bus? It also clocks out one bit on every clock…


#10

I need a data pin, a seperated clock pin and I have to use a custom protocol.

Is it possible to do that with SPI (I’m new to embedded)?

If not, where can I find a tuto on using RLP with Eclipse?
I already done this : http://www.itcrowd.be/getting-started-with-ghi-rlp
and this : http://www.yagarto.de/howto/yagarto2/index.html.

I can compile by running make in my project’s directory from a CMD, but Eclipse does not work.


#11

I finally got it to work. I can compile my C code to an elf using the Makefile and the LinkScript supplied with the samples, but when I put it on the board, I get an InvalidOperationException when I call RLP.LoadELF.

Final EDIT : I finally understood that I needed an unlock code to get RLP work. I got one and it work!

Thanks GHI ^^