Attiny13 Software Uart Bascom

64 bytes of SRAM is plenty for this. BASCOM on the other hand sounds like NOT fun for implementing this one - especially when You have a very limited program space. The chip has a timer. Start with that one. Use interrupts and C.

The USI is a multi-purpose hardware communication module. With appropriate software support, it can be used to implement an SPI, I²C or UART interface. It should be noted that USART peripherals have more features than USI peripherals. Software UART The AT90S2313 and most other AVR controllers has a hardware UART on pins 2 and 3. Sometimes you have to use these pins for another purpose. Bascom has a software UART function that uses extra program space, but you may specify which pins to use for RxD and TxD. The pins to use are specified in the Open command.

Maybe ASM if You dare. Actually this is a very simple thing to do if You need to send data from the chip. Maybe the A/D conversion result?

If You need to receive something as well then the thing becomes more elaborate involving use of the external interrupt in the RX wire. But this is still quite easy task. I just need the TXD line. I only have the attiny13 rightnow. I need a little package micrcontroller. It must be in SMD package, because i don't have much space to place the attiny13. It will be used in an electronic key, so it must be small.

Czerwone gitary concerts. Probably, i will have to write my own transmission protocole. Now I have, an another problem. I was trying to set this AVR from 9.6MHz Clock with 64ms start time, to 4,8MHz with 64ms start time and it has blocked:/ Now I don't have an idea how to unlock it. If I could connect an extrenal clock, it not would be a problem to unblock but like you know, it's hard to connect an extrenal clock to attiny13:).

Hello, I have written a softUART transmitter for the Tiny13 in assembler. It sets the timer interrupt to the baud rate. At every overflow, it reloads the value to create the baud rate and checks if the main code has set up a byte for transmission. If a byte is to be sent out, it initializes a counter to ten and pulls an output pin low to create the start bit. Each subsequent interrupt shifts the LSB into the carry. If carry set, out pin is made high, otherwise, it is made low. On each interrupt the counter is decremented.

On count one, it creates the stop bit and sets a flag for the main program that indicates that it is ready for a new byte to be transmitted. The timer interrupt routine is short; about thirty instructions. I can attach it if you would like to use it, but it is in assembler. Please feel free to translate it into C and repost it back to me, as I am trying to learn C. I'm looking for a transmission protocole between two AVR processors: attiny13 atmega32, so there is no problem with voltage levels in RS-232 protocole. There is already a first version of my key. It's featured on my homepage: [url] There I wrote a transmission protocole by myself and it worked.

The transmission protocole was based on CLOCK line and DATA line (like in I2C) The programm of this key fits my transmission protocole and data to send to atmega32. The Data is: start bits, userID, 256-bit password, stop bits. Now I want to fit bigger password, so the transmission protocole has to be smaller. Now i think the software RS-232 is not the best idea for my key. Simonetta - If you can I would be thankful for writing the code in assembler here.