Quantcast
Channel: Data converters
Viewing all articles
Browse latest Browse all 91130

Forum Post: TLC1518 - AVR Atmega 32 - SPI

$
0
0

Hi,

I got a sample of the TLC1518 last week and since then I tried to get the SPI communication running. But for some reason the SDO Signal of the TLC1518 does not respond as expected.

I setup the internal SPI of the AVR with this code snippet:

//Set MOSI and SCK and SS DDRB = (1 << PB5) | (1 << PB7) | (1 << PB4);  SPCR |=  (1 << CPOL) | (1 << CPHA); //set clock idle on HIGH and sampling on leading edge SPCR |=  (0 << SPR1) | (1 << SPR0); //set frequency f_ck/16 => 1Mhz SPCR |=  (1 << SPE ) | (1 << MSTR);       //Set Enable_SPI, MASTER  uint8_t clr = SPCR; clr = SPDR;

The TLC1518 runs without FS and CSTART

In my first test i just try to write the configuration register with (0x555 ) and read it back. But I always get the wrong data (in the example 0x0000 but it can be different with different input). Here you can see what i have captured with an oscilloscope when trying to read the configuration register:



This is my first project with SPI and I hope it is just an stupid configuration issue. It would be great if someone can help me.



Viewing all articles
Browse latest Browse all 91130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>