D
D
Dmitry Shalimov2018-07-18 01:24:34
Electronics
Dmitry Shalimov, 2018-07-18 01:24:34

How to drive sw2812 diodes based on at90usb162?

Guys, keep not shoveled fun!
There is at90usb162, 60 sw2812 diodes and an unplowed control field for this stray!
In an attempt to file all this on arduino, I broke my brain, since I met microcontrollers for the first time and spent as much as 5 hours cutting my own crutch, but quite a working sketch. By evening, I was told the good news that the whole thing now needs to be slightly rewritten, since now it will not be written under the incredibly complexarduino, but under at90usb162, as it was suddenly necessary to insert a USB Tudua. We were glad in advance that there would be no problems, since all this is good old C and therefore rewrite a couple of functions and everything is ok. Then the fun begins!

The sketch should do something like this:
1)Подгрузить файл с SDcard
2)Разбить его построчно
3)Отправить на ленту
Or:
1)Построчно отправлять файл с SDcard на ленту

This is how I've been having fun for the last 3 days =)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Shalimov, 2018-07-24
@Akui_Aru

As a result, the optimal solution is to write your own library ... We
drive the program for diodes into an array with numbers, where the number is a binary code in the BRG system (such a datasheet ...), then we run the number bit by bit through the number mask and if it is one, then we issue one to leg with a long signal, then turn it off, if zero, then one but for a short period ... The diodes, of course, race for a long time, because the timing was selected using an oscilloscope, dancing with a tambourine and, in fact, poking a finger into the sky ... The problem is that when transferring to other chips, you will have to select your gaps due to the difference in crystals, processor frequencies, etc. etc... Now the thing is working, if anyone has a question about the implementation, then write!

A
Alexey Makarenya, 2018-07-19
@makarenya

If you already have a working arduino sketch, then you can make your life easier in the following ways:
- Use arduino support for your MK: https://github.com/mattairtech/ArduinoCore-avr, in the section "AVR Core Installation" a list of steps is described so that the Arduino supports it.
- Take the Arduino Leonardo - it has USB and is supported by the Arduino out of the box. You can take pro micro arduino leonardo from the Chinese - it will also be very small.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question