Page 1 of 1

Clk & Data

Posted: Thu Jan 15, 2009 4:17 pm
by spence
Hi,

I have a chip that I need to send data to. The spec says it has 2 connections Clk & data, how can I get these signals from pic ? what component do I use in flowcode ?

The data input is a 5 bit code with bit 0 (lsb) the first received

eg

D4 D3 D2 D1 D0
0 0 0 0 1

Thanks

Re: Clk & Data

Posted: Thu Jan 15, 2009 5:14 pm
by Benj
Hello

Could be I2C or it could be a custom bus that requires custom transfers. Eg transferring 5-bits of data is not a standard communications bus.

If you give me the name of the chip I will have a quick look for you.

Re: Clk & Data

Posted: Thu Jan 15, 2009 5:21 pm
by spence
Thanks Ben

Chip is DTMF generator HT9200A by Holtek

Re: Clk & Data

Posted: Thu Jan 15, 2009 6:07 pm
by Benj
Hi Spence

Looks like you will have to write a custom macro to allow communication with this device. I would create a new macro and then try to follow the timing diagram shown on page 7 of the device datasheet.

http://www.holtek.com.tw/english/tech/a ... a0037e.pdf

You could either create a generic maco that takes a byte parameter and transfers the first 5-bits to the device or you could make seperate macros for each of the different command sets and call each one as needed.

If you get stuck then let me know and I will create a demo generic macro for you.

Re: Clk & Data

Posted: Fri Jan 16, 2009 10:23 am
by spence
Thanks Ben

Would be great if you could write code to get me started

Re: Clk & Data

Posted: Fri Jan 16, 2009 10:40 am
by Benj
Hi

Here is an example program, As far as I can tell it should work straight off but I cannot be sure without the hardware to test on.

Re: Clk & Data

Posted: Fri Jan 16, 2009 11:09 am
by spence
Thanks Ben

Will let you know if it works