[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself

Search:


View post   

>> No.2505502 [View]
File: 103 KB, 704x642, gunge.png [View same] [iqdb] [saucenao] [google]
2505502

Trying to program an ATtiny1614 (the newer series with UPDI) and I just can't get direct port manipulation to work. Pic related, the digitalWrite code works, but the PORTA.OUT does not. The LED tied to PA4 just doesn't turn on. And when I swap it around then it's PA5 that doesn't work, and when I remove the second digitalWrite then the LED stays on, so not even the PORTA.OUT = 0x00 works.

Any clue what's going on here? The PINnCTRL seems to be working just fine, since the pullup resistors are working, the data direction registers too. Using VPORTA.OUT or PORTA.OUTTGL or .OUTSET/.OUTCLR also doesn't work. There is no syntax error, at least not one that's being detected (writing PORTA = 0x00 does present an error so the syntax is correct for this MCU).

>inb4 it's a fault of the arduino IDE and I should be using raw text editor + AVR-GCC instead
I would if the damn thing was actually updated to work with these newer AVRs. I tried to use it with files scraped from MPLABX a while ago but it was bugging out with the differences in memory address space as I couldn't store a lookup table in progmem. This project needs EEPROM use so I don't want to try my luck.

Navigation
View posts[+24][+48][+96]