Sign In

Problem With UART

Dominik mimickxd@gmail.com Poland

Hardware: ATTiny13a 4,6MHz, ADuC842 Software: C/C++ Eclipse

Hi, I need to connect my aduc842 to attiny using e.g. uart (maybe SPI).
(ADuC master, ATTiny slave)
From what I've found in documentation and internet, ATTiny13a doesn't support neither of them nor has USI.
I don't know how to write software SPI by myself.
Thanks for your time,
Dom

Images

Replies

R Avinash
2016-07-24 05:47:31
Which one is gonna be the master? ATtiny or the ADuC?

Making SPI master is simple, so if ATtiny is the master then you can easily make SPI transmission/reception on it.
R Dominik
2016-07-25 06:41:44
ADuC must be a master and ATTiny a slave (I actually wrote it in the brackets before :p)

Thanks for reply,
DH
R Avinash
2016-07-25 12:39:31
You have to use the PIN change interrupt to detect a falling edge on SS(slave select) pin. As soon as you get a falling edge, you know master is starting a transaction. In SPI, in each transation a byte must go from master to slave and in the same time slave to master. After SS goes low, on each rising edge of SCK line you have to read the value of MOSI pin and shift ihn the bit and at same time shift out a bit on MISO line. After 8 bits transfer master may release the SS line or transfter more bytes.
R Avinash
2016-07-25 13:06:23
Also see this

http://extremeelectronics.co.in/avr-tutorials/interfacing-12-bit-spi-adc-mcp3204-with-avr-micro/

Post a reply to Dominik

Think you can help Dominik ? Then post your thoughts that might help Dominik. You will earn a lot of reputation in the technical community.

If your program is in multiple files, then ZIP the entire folder and attach below

Images and Screenshots

These helps other better understand your suggestion.