Adsense

Write Embedded C code for FRDMKL25Z to interface four switches to perform the operation mentioned in below table and store the results to the locations.

 Table

SW1

SW2

SW3

SW4

Operation

Result stored on location

OFF

OFF

OFF

OFF

No operation

-

ON

OFF

OFF

OFF

Addition

0x1FFFF100 – 0x1FFFF103

OFF

ON

OFF

OFF

Subtraction

0x1FFFF104 – 0x1FFFF107

OFF

OFF

ON

OFF

Multiplication

0x1FFFF108 – 0x1FFFF10F

OFF

OFF

OFF

ON

Division

0x1FFFF110 – 0x1FFFF113

 

Steps to implement the experiment:

1) Configure the SW1, SW2, SW3 and SW4 as an input.

2) Take the two numbers i.e.  unsigned int X= 0x32, Y= 0x04.

3) Implement the switch pressed detected inclined to the operations.

4) Implement the above mentioned table and store the results to the mentioned locations.

5) Continuously check for the switch pressed. Repeat the steps 3 and 4. 


Write embedded C code for FRDMKL25Z to perform linear search of the number 25 from list of 10 elements size 32-bit. If search result true then lit green LED else red LED for 100ms.

 Steps to implement the code:

1) Take the number into any integer.

2) Configure registers for RED and GREEN LEDs.

3) Compare the number with all the elements one by one.

4) If element match with the number given turned on the Green LED for 100ms else turned on RED LED for 100ms. 

Write a ARM cortex M0+ assembly language code based on arithmatc and logical instructions.

 Problem 1: Implement following code conversions to convert binary no 0x89ABCDEF(32-bits) into a) BCD (64-bits)   b) Gray (32-bits) Problem...