Given the rocketing price of AVR Aduinos, I've just been looking at these things...
https://www.aliexpress.com/wholesale?SearchText=LGT8F328PThe extra features are very interesting for a project I have in mind, both for the DAC and for the extra ALU.
I ordered a few (some purple, some green) and so far so good. They work just like Arduinos in the Arduino IDE.
Information on the extra features is
very sparse though. There's the original datasheet that's been machine-translated by google on a couple of github repositories and very little else.
(FWIW: Google translate has improved, you can re-translate the manual today and google does a much better job)
I'm programming mine in assembly language. I'm particularly interested in the 16-bit ALUs. Has anybody else use them or does everybody simply switch them to 32MHz mode and use them as a faster Arduinos?
The way the new ALU works is not by having extra instructions (there's no bits left in the Atmel instruction set) but by monitoring the bus and seeing what you're doing.
eg. The 2kB of RAM is mapped twice in the address space on these chips. If you access the copy of RAM at 0x2000 then you can load/store 16-bit values in a single clock.
Example problem:This instruction loads r0 with an 8-bit value from address 0x0100:
LDS R0,0x100
This instruction loads the DX register in the new ALU with a 16-bit value at 0x0100 and leaves r0 unchanged:
LDS R0,0x2100
(ie. same opcode, different result depending on the RAM address)
Problem: It doesn't seem to work for any register other than DX. I believe I'm supposed to be able to load any register but it fails:
LDS R1,0x2100 ; Supposed to load the DY resister, but the value goes into DX instead!
Conversely, using the STS instruction to
store 16-bit numbers works just fine:
STS 0x2100,R0 ; Store DX resister to location 0x100
STS 0x2102,R1 ; Store DY resister to location 0x102 - works perfectly!
STS 0x2104,R2 ; Store DAH to location 0x104 - works!
STS 0x2106,R3 ; Store DAL to location 0x106 - works!