CREATE A 8 BIT SERIAL STREAM FROM REGISTER

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm working with the ATTiny85 and need to generate a 8 bit serial string into a serial to parallel IC.

 

I have done this on the 8031 platform in the past but cannot figure out what commands will do the same thing in the AVR language.

 

So I put a binary number into a register, then check bit-0 to see if it is a one or a zero. I set the data in pin on the serial to parallel IC and generate a clock pulse to enter that bit.

 

And so on for all eight bits. at the end I generate a strobe pulse to output the 8 parallel bits.

 

The closest command I can find that I think would be useful would be the BLD command, if so I could use some help on how to implement it properly.

BADBAUD

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, that is what I needed.

BADBAUD

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You should look into how the USI on the tiny85 works, it can do the job for you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using PB0 thru PB2 as control lines to the SPI chip. Is USI port specific?
 

BADBAUD

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

RTFM

 

but yes they use the same IO's as the SPI

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

why not use SPI for both and then use SS (CE or what ever the names are), to control which chip you talk to.