View Index by Level
RANDOM PAGE

SITE SEARCH

LOG
IN

SIGN UP

HELP

AQA Microcontroller

To gain access to revision questions, please sign up and log in.

A2

The AQA chip is a ...

The AQA Microcontroller Arcitecture

The processor contains ..

Instruction and Operand Fetch

Power-On and Reset

When the power is switched on, or after a reset, code execution starts from address 0x00.

The Registers, Buses, Memory and Input/Output

AQA Microcontroller - More detail

The Registers

Status Register and Flags

Timer and Prescaler Registers

Configuring Input and Output Pins

Memory

Named Memory Locations

Clock

The simulator clock can be set between 0Hz and 120Hz. The upper limit is determined by the maximum Flash player frame rate. With older hardware, the higher clock rates might not be achieved. These slow clock speeds make visible strange effects that are never seen with real-life microcontrollers. For example, seven segment displays switching from 09 to 10 might show 19 for a brief moment because it is impossible to change both digits at the same instant. Real life processors have the same problem but they are so fast that it is rarely noticed.

The Instruction Set - This is an extract from the AQA exam data sheet.

The AQA Instruction Set

Understanding This Chart

A beginner's Example

CTRL+Click here to run the simulator.

   ADDW 0x1
   ADDW 0x2
   ADDW 0x3

All that Jargon and effort to work out that 0 + 1 + 2 + 3 = 6

Mnemonics

Operands

Description

This is a brief explanation of what the command does.

Operation

Flags

The processor has a Status Register (SR) containing three flags. The table above shows which flags might be set by each command.

Clock Cycles

K and (R)

The microcontroller has 256 memory locations called the File Registers.

So the command        MOVWR 0x12        (R) <= W        means copy W into the contents of file register 0x12.

The simulator instruction set matches the AQA specification very closely. AQA did not specify the binary level details of the processor so this simulator uses binary codes which are very like those used in the Microchip family of microcontrollers.

The code is NOT case sensitive so movw is the same as MOVW and 0XFF is the same as 0xff.
Most features in the AQA specification are now available in the simulator.
Some design assumptions have been made so the exam microcontroller might differ from this one.

Literals

K is used to represent a literal, which can be

File Registers

R represents a register or memory location.

Differences between this simulator and the AQA version.

INC potentially sets both the Z and C flags. AQA only sets the Z flag.
DEC potentially sets both the Z and C flags. AQA only sets the Z flag.

Non AQA Extras

Define Byte - DB - Variables

The AQA "Changes to Content" document describes the use of literals as both labels and values. But it does not have a way to define them in a program. Many assembler languages use DB for this purpose so it has been added as an extra to the AQA instruction set. In high level languages, these named memory locations are called variables.

Using DB, it is possible to name a memory location and refer to the contents of the location by name. In addition, data can be stored using DB, even if the memory location is not labelled but this is poor programming style as the program is less easy to understand.

Run this example and watch how the named memory locations get initialised when the program is assembled and how they change when it's run.

        JMP     START

; ===== NAMED DATA LOCATIONS =====
DELAY:  DB      0x55    ; Address 1
COUNT:  DB      0x10    ; Address 2
        DB      0xAA    ; Address 3

; ===== THE MAIN PROGRAM =====
START:
        INC     DELAY   ; Add 1
        DEC     COUNT   ; Subtract 1
        INC     0x03    ; Poor style
        JMP     START
; ============================

 

 

 

reviseOmatic V3     Contacts, ©, Cookies, Data Protection and Disclaimers Hosted at linode.com, London