Opened 15 months ago

Last modified 6 months ago

#18 assigned task

ATMEGA8A: Configure by setting fuse bytes and lock bits

Reported by: dsl Owned by: Alexandr
Priority: major Milestone: MCUSim-0.2
Component: avr Keywords: planned-in-0.2.0
Cc:

Description (last modified by dsl)

It's necessary to take into account any simulation-significant changes which can be made by setting these fuse bytes and lock bits, i.e. size of the bootloader section, top border of the frequency value, restrictions for the LPM and SPM instructions.

This configuration mechanism is already partially implemented in the simulator for ATmega8/8A only. You may take a look at declaration of the functions to set fuse and lock bytes. They usually look like:

int MSIM_M8ASetFuse(void *mcu, unsigned int fuse_n, unsigned char fuse_v);
int MSIM_M8ASetLock(void *mcu, unsigned char lock_v);

and placed inside an MCU-specific header file (simm8a.h for ATmega8/8A). Exact declarations of the functions are important!

It is important to let initialization mechanism know that these functions are available. You may achieve it by defining macros with functions names:

#define SET_FUSE_F	MSIM_M8ASetFuse
#define SET_LOCK_F	MSIM_M8ASetLock

in the header file.

You may read datasheet (its Memory Programming section) to understand what modifications should be done in struct MSIM_AVR instance according to the fuse and lock bytes values provided.

Change History (12)

comment:1 Changed 15 months ago by dsl

Description: modified (diff)

comment:2 Changed 15 months ago by dsl

Owner: changed from dsl to salex61
Status: newassigned

comment:3 Changed 10 months ago by dsl

Milestone: 0.2.0Work in Progress

comment:4 Changed 10 months ago by dsl

Milestone: Work in Progress0.2

comment:5 Changed 10 months ago by dsl

Milestone: 0.2Work in Progress

comment:6 Changed 10 months ago by dsl

Milestone: Work in Progress0.2

comment:7 Changed 10 months ago by dsl

Owner: changed from salex61 to ppsalex@…

comment:8 Changed 10 months ago by dsl

Owner: changed from ppsalex@… to Alexandr

comment:9 Changed 10 months ago by dsl

Milestone: 0.2MCUSim-0.2

Milestone renamed

comment:10 Changed 8 months ago by dsl

Milestone: MCUSim-0.2MCUSim 0.2

Milestone renamed

comment:11 Changed 8 months ago by dsl

Milestone: MCUSim 0.2mcusim 0.2

Milestone renamed

comment:12 Changed 6 months ago by dsl

Milestone: mcusim 0.2MCUSim-0.2

Milestone renamed

Note: See TracTickets for help on using tickets.