Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions

Question

List the five steps in the decision-making model.

Answered: 1 week ago