

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


EEE20003 Tutorial - 5
You are to write the required program as C code to do the basic port initialisation but to use assembly language to do the actual transmission of the data. Write an assembly language subroutine to send the word “SOS” using an LED connected as shown above. The subroutine should include the end of word delay at the end of the SOS. The subroutine should be callable from a C program using the prototype void sendSOS(void). You may assume the existence of a delay routine delayDot that delays for 1 dot time. Incorporate this subroutine into a complete program that will continuously send the message as long as the button shown above is pressed. NOTE: Other pins of the port may be in use.
EEE20003 Tutorial - 5
.equ GPIOA, 0x400FF .equ PTOR_OFFSET,0x0C .equ PDDR_OFFSET,0x
ldr r1,=GPIOA mov r0,#0x00FF str r0,[r1,#PDDR_OFFSET] mov r0,#0x000F str r0,[r1,#PTOR_OFFSET