Question: The microcontroller has to read an external signal, that uses port pins RA 1 and RAO. RAO is used as a clock, and it is

The microcontroller has to read an external signal, that uses port pins RA1 and RAO. RAO is used as a clock, and it is driven by an approximately 50kHz clock signal. The RA1 input is used as serial data input, where the data bits can be sampled on the rising edge (0 to 1 transition) of the clock signal. The serial input data consists of 16 bit unsigned numbers, and the most significant bit comes first. Write a subroutine (INIT_ PORT), that sets the used port pins (RAO,RA1,RBO,RB1) to the appropriate mode (input or output). The subroutine must not change any other port pin. Write the assembly subroutine (READ_DATA), that: First sets port pins RBO and RB1 to 0, then waits for an incoming data on RAO and RA1, and after the 16 bit value arrives, sets RBO and RB1 according to the incoming value: RBO,RB1=0,1- if value >40000,* RBO, RB1=1,1- if value =40000, RBO, RB1=1,0- if value <40000.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!