#avr Logs

Aug 03 2019

#avr Calendar

02:11 AM polprog: FozzWorth: what do they say about why not use? If you debounce in hardware it should be easy
02:16 AM polprog: oh nvm, tpw hepled ya already :p
04:27 AM davor_ is now known as davor
01:39 PM [1]MrMobius is now known as MrMobius
02:06 PM Smidge204: Ahoy
02:07 PM Smidge204: I'm trying to figure out how to write to the control registers in Assembly, but the register names in the datasheet (Attiny814) don't match the definitions in tn814def.inc in any way that makes sense to me. Any idea what I might be missing?
02:16 PM rue_mohr: hmm
02:16 PM rue_mohr: isn't it one of the first 7 registers?
02:23 PM Smidge204: Well specifically I'm trying to modify the clock select bits (MCLKCTRLA). It's offset 0x00 from the CLKCTRL register, but that register isn't defined in the def file
02:23 PM rue_mohr: er, is that even accessible in runtime?
02:23 PM Smidge204: There's a CLKCTRL_MCLKCTRLA but trying to use that I get an Operand Out Of Range error on compile
02:23 PM rue_mohr: like, its not a fuse, right?
02:24 PM Smidge204: And yes, it's supposed to be. You have to set a value in a control change protection register first and update it within 4 CPU cycles
02:24 PM Smidge204: (Accessing the CCP register is also the same problem; it doesn't seem to be defined)
02:26 PM cehteh: what libc version? from the avr-libc maintainers or from microchips support pack?
02:28 PM vmt: beware of the CCCP register
02:28 PM Smidge204: I'm programming in assembly through Atmel Studio 7, I don't think I'm using libc?
02:31 PM cehteh: no idea about atmel studio, but iirc the definitions all come with the libc headers somehow even when you dont use the libc
02:32 PM Smidge204: "tn814def.inc" is version 1.00 dated 2017-10-02 . I've not been able to find a newer one
02:35 PM cehteh: i once noticed that for uncommon parts/registers esp for newer ones the definitions are sometimes a bit sloppy
02:36 PM cehteh: just make your own definitions when you verify thats the case
02:40 PM Smidge204: Haha figured it out... I need to use the STS instruction instead of OUT
02:40 PM Smidge204: Even though the register(s) are in the IO register region of the memory map :/
02:41 PM cehteh: why do you use asm?
02:41 PM Smidge204: It's my preferred uC coding environment
02:42 PM cehteh: sounds like masochism :D
02:42 PM Smidge204: Yeah maybe
02:43 PM vmt: for things where the compiler goes derp and/or things where you really want fine-grain control over the state, sure
02:44 PM cehteh: yeah, but not to start with .. but whatever you want glhf
02:45 PM vmt: yeah, i'd agree
02:45 PM vmt: why bother with those pesky mnemonics why not just write machine code directly
02:45 PM Smidge204: Eh I'd not consider myself a "starter" - just for the 814 and it's quite different
02:48 PM vmt: you just need a niche editor, which you can program yourself, in asm no doubt
02:51 PM nohit: atmel studio uses avr libc
11:53 PM day__ is now known as day