spi interface by software

Started by phspune May 2, 2011
I am very good at programming with x51 type micro controllers.
I have recently shifted to avr.
I would like to shift out 4 bytes of data through 4 port pins using 1 common clock pin (5th port pin). Can you please suggest me the fastest way of doing this? I have to actually shift out almost 1000 bytes in this manner within a shortest time (1msec?).

hi,
 how you want to output bits, 4 bit of the same byte or 1 bit of each byte ?
the fastest way is to use ASM. if u tel me how you want to output data, I can help u by writing the procedure 
regards

________________________________
From: phspune
To: a...
Sent: Saturday, April 30, 2011 11:01 AM
Subject: Re: [AVR club] spi interface by software
 
I am very good at programming with x51 type micro controllers.
I have recently shifted to avr.
I would like to shift out 4 bytes of data through 4 port pins using 1 common clock pin (5th port pin). Can you please suggest me the fastest way of doing this? I have to actually shift out almost 1000 bytes in this manner within a shortest time (1msec?).




Dear Imad,

I will definitely be using assembly language.

I want to output 1 bit from each of the bytes - making 4 bits on the 4 port lines, latched externally by the common clock signal on the 5th port line. In 8051, we have instruction like move to port pin from carry bit, which is not there in the avr. Branching on the carry bit and then setting the io pin willtake up much more time. (to be done 4 times for 4 bits).

Thanks for the reply.

Pankaj

----- Original Message -----
From: Imad Ir
To: a...
Sent: Monday, May 02, 2011 9:45 PM
Subject: Re: [AVR club] spi interface by software

hi,
how you want to output bits, 4 bit of the same byte or 1 bit of each byte ?
the fastest way is to use ASM. if u tel me how you want to output data, I can help u by writing the procedure
regards

________________________________
From: phspune
To: a...
Sent: Saturday, April 30, 2011 11:01 AM
Subject: Re: [AVR club] spi interface by software

I am very good at programming with x51 type micro controllers.
I have recently shifted to avr.
I would like to shift out 4 bytes of data through 4 port pins using 1 common clock pin (5th port pin). Can you please suggest me the fastest way of doing this? I have to actually shift out almost 1000 bytes in this manner within a shortest time (1msec?).





Hi,
I upload a file to the club "ForBitSyncTransmit.rar", which do what you need
god luck 
________________________________
From: Pankaj
To: a...
Sent: Thursday, May 5, 2011 10:29 AM
Subject: Re: [AVR club] spi interface by software
 
Dear Imad,

I will definitely be using assembly language.

I want to output 1 bit from each of the bytes - making 4 bits on the 4 port lines, latched externally by the common clock signal on the 5th port line. In 8051, we have instruction like move to port pin from carry bit, which is not there in the avr. Branching on the carry bit and then setting the io pin willtake up much more time. (to be done 4 times for 4 bits).

Thanks for the reply.

Pankaj

----- Original Message -----
From: Imad Ir
To: a...
Sent: Monday, May 02, 2011 9:45 PM
Subject: Re: [AVR club] spi interface by software

hi,
how you want to output bits, 4 bit of the same byte or 1 bit of each byte ?
the fastest way is to use ASM. if u tel me how you want to output data, I can help u by writing the procedure
regards

________________________________
From: phspune
To: a...
Sent: Saturday, April 30, 2011 11:01 AM
Subject: Re: [AVR club] spi interface by software

I am very good at programming with x51 type micro controllers.
I have recently shifted to avr.
I would like to shift out 4 bytes of data through 4 port pins using 1 common clock pin (5th port pin). Can you please suggest me the fastest way of doing this? I have to actually shift out almost 1000 bytes in this manner within a shortest time (1msec?).