Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

about SPI!

Status
Not open for further replies.

gas

New Member
hi,
i want to make two atmega8 communicate by SPI, and one is master. i'll send four bytes in main(), and receive four bytes in the interrupt, is that ok?

thank you!
 
Yeh that sounds fine. What kind of speeds are we talking about?? You could just send the bits 1 at a time, instead of 4 at a time.

What do you want to send through this interface. There might be an easier way.
 
pike said:
Yeh that sounds fine. What kind of speeds are we talking about?? You could just send the bits 1 at a time, instead of 4 at a time.

What do you want to send through this interface. There might be an easier way.

thank you, Pike!
you mean i could define a variable to count the bytes, but transmit one byte at a time,of course i should divide the byte into 8 bits,right?
 
gas said:
[ you mean i could define a variable to count the bytes, but transmit one byte at a time,of course i should divide the byte into 8 bits,right?

Yes, you have to break the byte up into 'bits'. But your initial proposal was to break the file up into 2 smaller chunks (of 4 bits) and send and send each chunk one at a time.

You could just break it up into 8 smaller bits and send it. It's just slower but requires less output pins.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top