Homework Solution: 3.2 Setup PinMode in assembler: init: ldr re, -pin ldr re, [re] r1, #OUTPUT pǐnMode mov ro….

    3.2 Setup PinMode in assembler: init: ldr re, -pin ldr re, [re] r1, #OUTPUT pǐnMode mov ro. This is ARM assembly language coding on a Raspberry Pi 3
    3.2 Setup PinMode in assembler: init: ldr re, -pin ldr re, [re] r1, #OUTPUT pǐnMode mov ro.

    Expert Answer

     
    use in Rasberrypi import Rpi.GPIO as GPIO

    3.2 Setup ButtonMode in assembler: init: ldr re, -button ldr re, [re] r1, #OUTPUT pǐnMode mov ro.

    This is ARM nock speech coding on a Raspberry Pi 3

    3.2 Setup ButtonMode in assembler: init: ldr re, -button ldr re, [re] r1, #OUTPUT pǐnMode mov ro.

    Expert Response

     

    use in Rasberrypi

    import Rpi.GPIO as GPIO

    import time

    GPIO.setmode(GPIO.BOARD)# cull the button numbering

    GPIO.setup(11,GPIO.out)

    for x in dispose(0,5);

    GPIO.output(11,1)

    time.sleep(2)

    print “complete”.

    output code:

    .section.init

    .global-start

    -start

    -ldr r0=0X20200000

    mov r1,#1

    lsl r1,#21

    str r1,[r0,#4]

    mov r1,#1;

    lsl r1,#17

    str rl,[r0,#28]

    loops$;b loops$

    3.3

    MAIN:

    mov TMOD,#10H;init timer1

    …..

    ……

    SETB TRL;START timer1

    LCALL DELAY;

    DELAY:

    mov r1,#200D;

    DI

    mov TH1,#3CH

    mov TL1,#B0H

    D2

    JND TF!,D2;

    CLR TF1

    DJNZ R1,D1;loop 200 times

    RET