Attiny861 ATTinyCore can't use pin13 and pin12 at the same time

Hi. I use attiny861 with SpenceKonde ATTinyCore.(non legacy new pinout) All pins work if tested one by one. But when i set pin13 to output PWM i can't use pin12. Because as soon as i set pin12 to output mode to use as a digital out it gives inverted picture of what pin13 PWM is outputing. Is this a problem of attinycore or my lack of understanding how attiny861 pins can be used? Could someone help here? The sketch below.

//attiny861 with spencekonde attinyCore
void setup() 
  pinMode (12, OUTPUT);
  pinMode (13, OUTPUT);  
  analogWrite(13, 10);

void loop() {

Yes that is correct. This is because the Attinys 261, 461, 861 are specially designed to control 3-phase BLDC motors. There are 2 more pin pairs that also run Gogen-phase, but can be synchronized to PWM. You have to look up which pins are exactly in the data sheet.

Thanks. That's unfortunate for me. But I am reading the datasheet and i think this behaviour can be controled with registers TCCR1X or so.So it should be possible acording to datasheet if i understand correct. But no success yet as it is quite complicated to read all these settings. So in general can i use some sort of hardware PWM on PB5 and digital out on PB4 at the same time on attiny861? assuming i know how to setup registers correctly?

Sorry, I don't know the Attiny 61 series so well that I can answer your specific questions without consulting the data sheet myself. Unfortunately, I don't have the time for that at the moment, because I'm in the middle of a project myself, I could only answer the opening question so directly because I only recently pointed out the characteristics of the 61 series to someone that they are planning to use of a BLDC controller. I myself last used Chip 3 years ago. At the moment I am working particularly intensively with the Attiny167 because of the 16KB Flash

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.