ATtiny841 Pin mapping issue #837
Replies: 3 comments 1 reply
-
Aaaha! That sheds some light on this issue.... |
Beta Was this translation helpful? Give feedback.
-
Could you simplify the code? If you can simplify, others can recreate the scenario and offer advice. Pin addressing problems could probably be expressed in ~20 lines of code, and this simplicity makes it easier to dive in to the different dimensions of pin issues. (i.e pin mapping selected, the method of addressing pins). |
Beta Was this translation helpful? Give feedback.
-
Sorry it's taken me ages to get back to this. Here is another simplified code that does a similar thing. For some reason, regardless of the pin mapping option I choose, it seems to use the counterclockwise pin mapping on the dev board.
|
Beta Was this translation helpful? Give feedback.
-
Hi there! First time poster and also very basic coder and designer here.
Possibly someone could point out how I'm going wrong here. Maybe it's something obvious I've missed.
I've been working on a USB programmable ATtiny841 based dev board as a hobby/learning project to see if my self-teaching could actually make something like this work. And to some extent I've actually prototyped and got it working perfectly!....almost.
I'm just having an odd issue with the pin mapping when writing a fairly simple Arduino IDE code controlling an WS2812B led matrix.
My dev board schematic is shown below:
ATtiny841 Dev Board with UART.pdf
Using the ATtinyCore and Arduino as ISP, I flashed the ATtiny441/841 (Optibootloader) with the following settings clearly using the Clockwise pin mapping:
Now everything works find and dandy with being able to upload code to the Attiny841, no issue there...however, when uploading my code I am experiencing a weird issue.
I have two switches controlling the light functions of my leds: they are connected to the arduino pins 2 and 3 (as per the ATtinyCore pinout graphics) and are written in the code as such. They work perfectly. Great!
My issue comes with the controlling of the LED matrix. I have it connected to Pin13 of the Attiny (arduino pin 0 in clockwise mapping), but when writing it as Arduino pin 0 in the code it then displays the output on pin2 of the Attiny (arduino pin 10 in the mapping). And the reverse is true if I program it to Arduino pin 10, the output displays on Arduino pin0 (currently how I have it in the code provided below). Basically, it seems that the LED matrix output gets programmed to the CCW pin mapping while the switches use the regular CW pin mapping.
Have I got a hardware issue or is there something I'm missing here?? I know I can get the code to work and all, but it would be nice if the pin that I code for was the actual pin that gets used.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions