Hi all.
=====================================================
Ich habe es schon einmal klargestellt und werde es noch einmal klarstellen. Ich bin Softwareentwickler, kein Hardwareentwickler. Daher kann ich zwar den Sprachteil des Compilers warten und verbessern, aber keine Hardwaretreiber entwickeln. Das ist Sache des Restes von euch.
Der Compiler funktioniert potenziell für jedes Gerät in der Reihe, und wenn jemand von euch Korrekturen für die Treiber vorschlägt, werde ich sie gerne einbauen.
=====================================================
I have made it clear before and I will make it clear again. I am a software engineer, not a hardware engineer. Therefore although I can maintain and improve the language part of the compiler, I cannot develop hardware drivers. That is for the rest of you.
The compiler potentially works for any device in the range, and if any of you come up with fixes to the drivers I will happily incorporate them.
Actually I was about to post on a new feature that is in the latest compiler called code injection. As an example, for the Tiny212 and Tiny412 EEPROM works for bytes but not for larger structures like word. Using code injection the faulty routines can be replaced.
The key word for code injection is
SysOverride. The routine must have the same name as the original AVRco on, and must be written in assembler. Here is an example
Code
Unit TINY_EEPROM;
interface
uses;
const
type
var
implementation
type
const
{$IDATA}
var
procedure _CompleteEEWrite;
begin
asm;
;LDS _ACCBLO, 1000h ; NVMCTRLA
;CPI _ACCBLO, 013h ; are we already in Erase and write mode?
;BREQ _PrepEEWriteExit ; yes - just write
CALL SYSTEM._EEpWaitReady
LDI _ACCBHI, 000h ; CCP allow NVMCTRA to be changed
LDI _ACCBLO, 09Dh
OUT 034h, _ACCBLO
STS 1000h, _ACCBHI ; NVMCTRLA
CALL SYSTEM._EEpWaitReady
LDI _ACCBHI, 03h ;EEBRWR EEPROM Erase and Write Enable
OUT 034h, _ACCBLO
STS 1000h, _ACCBHI ; NVMCTRLA
_PrepEEWriteExit:
endasm;
end;
SysOverride WriteEEp8;
begin
// pointer in Z
// value in _ACCA
asm;
CALL SYSTEM._EEpWaitReady
ST Z, _ACCA
CALL TINY_EEPROM._CompleteEEWrite
RET
endasm;
end;
SysOverride _WriteEEp16;
begin
// pointer in Z
// value in _ACCB, _ACCA and also in _ACCCALO and _ACCCAHI, for some reason
asm;
CALL SYSTEM._EEpWaitReady
ST Z+, _ACCALO
CALL TINY_EEPROM._CompleteEEWrite
ST Z+, _ACCAHI
CALL TINY_EEPROM._CompleteEEWrite
RET
endasm;
end;
SysOverride _WriteEEp24;
begin
// pointer in Z
// value in _ACCB, _ACCA, _ACCCALO
asm;
CALL SYSTEM._EEpWaitReady
ST Z+, _ACCB
CALL TINY_EEPROM._CompleteEEWrite
ST Z+, _ACCA
CALL TINY_EEPROM._CompleteEEWrite
ST Z+, _ACCALO
CALL TINY_EEPROM._CompleteEEWrite
RET
endasm;
end;
SysOverride _WriteEEp32;
begin
// pointer in Z
// value in _ACCB, _ACCA, _ACCCALO, _ACCCAHI _ACCA and _ACCB are copies to _ACCBHI and _ACCBLO
asm;
CALL SYSTEM._EEpWaitReady
ST Z+, _ACCB
CALL TINY_EEPROM._CompleteEEWrite
ST Z+, _ACCA
CALL TINY_EEPROM._CompleteEEWrite
ST Z+, _ACCALO
CALL TINY_EEPROM._CompleteEEWrite
ST Z+, _ACCAHI
CALL TINY_EEPROM._CompleteEEWrite
RET
endasm;
end;
SysOverride _WriteEEp64;
begin
// pointer in Z
// value in _ACCB, _ACCA, _ACCCALO, _ACCCAHI, _ACCCDLO, _ACCDHI, _ACCCELO, _ACCCEHI _ACCA and _ACCB are copies to _ACCBHI and _ACCBLO
asm;
CALL SYSTEM._EEpWaitReady
ST Z+, _ACCB
CALL TINY_EEPROM._CompleteEEWrite
ST Z+, _ACCA
CALL TINY_EEPROM._CompleteEEWrite
ST Z+, _ACCALO
CALL TINY_EEPROM._CompleteEEWrite
ST Z+, _ACCAHI
CALL TINY_EEPROM._CompleteEEWrite
ST Z+, _ACCDLO
CALL TINY_EEPROM._CompleteEEWrite
ST Z+, _ACCDHI
CALL TINY_EEPROM._CompleteEEWrite
ST Z+, _ACCELO
CALL TINY_EEPROM._CompleteEEWrite
ST Z+, _ACCEHI
CALL TINY_EEPROM._CompleteEEWrite
RET
endasm;
end;
initialization
end TINY_EEPROM.
just 'USE TINY_EEPROM' the unit to fix, certainly the word issue. I don't claim that it is the complete answer.
Remember, this is a community project now. I will do what I can but you must do your part too.
Denken Sie daran, dass es sich hier um ein Gemeinschaftsprojekt handelt. Ich werde tun, was ich kann, aber Sie müssen auch Ihren Teil dazu beitragen.
Regards