Electronics > Beginners

Attiny85: no serial output?

<< < (5/6) > >>

ataradov:
Separate serial adapter will not help here. Your MCU still can't output UART.  You need to make a thing that is similar to SoftwareSerial, but does not use interrupts. This is pretty easy for TX-only.

phennessey:

--- Quote from: ataradov on January 27, 2020, 05:15:29 am ---You need to make a thing that is similar to SoftwareSerial, but does not use interrupts. This is pretty easy for TX-only.

--- End quote ---

How do I do that?

ataradov:
I don't have any readily available code. The basic idea is to set a GPIO pin high and low according to the UART protocol and your data. Use blocking loops to generate bit-long delays.

Or better yet, figure out how to use USI and use that.

sleemanj:

--- Quote from: ataradov on January 27, 2020, 05:15:29 am ---Separate serial adapter will not help here.

--- End quote ---

Yes it will.  That appears to be the poster's primary problem (ignoring the interrupt conflict) as even without the conflict they are unable to get any serial output when using SoftwareSerial - because they don't have a USB-Uart connected, only an ISP.


--- Quote ---You need to make a thing that is similar to SoftwareSerial, but does not use interrupts.
--- End quote ---

Or, they could as I posted above, use my core.  Which provides "Serial" ready to roll on the pins indicated above and uses the Analog Comparator for it's interrupts, which should work out of the box with their code.

Or, they could rewrite their encoder handling so it does not use pin change interrupts (which SoftwareSerial does), either use the External Interrupt pin (85 only has one) or not use interrupts.

@phennessey

Install my core, as above.

Remove this

    #include <SoftwareSerial.h>
    SoftwareSerial Serial(3, 4);

you don't need it with my core.  Put your RX/TX on the pins indicated in my image above, connected to your USB-Serial (Uart) device, move your encoder to some other pins if you have that connected to those, adjust code to suit.




phennessey:
I'm not sure what kind of cable I actually need. Would a USB to TTL Serial Cable work?

I need to debug the encoder while its plugged into the Attiny85. Is it really impossible to do that while it uses pin interrupts?

The programmer I'm using clearly indicates serial in and out (MOSI, MISO). Why can't these work for me? https://cdn.sparkfun.com/assets/c/c/3/1/8/52715ae8757b7f30048b4567.png

What do you think about the information in this article?

https://www.hackster.io/porrey/easy-serial-on-the-attiny-2676e6

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod