Question

In: Computer Science

I am using MIPS assembly with MARS. My question is about I/O Devices. 1) Research and...

I am using MIPS assembly with MARS. My question is about I/O Devices.

1) Research and read about SFRs. Explain the differences between TRISx, PORTx, LATx and ODCx ports. Specify the special function registers (SFRs) for the I/O device(s)

Solutions

Expert Solution

All port pins have ten registers straightly linked with their function as input-output  The data direction register (TRISx) decide whether the pin is an input or an output. If the bit is a ‘1’ (one), then the pin is an input. After Reset operation, all port pins are defined as inputs by default. (LATx) define whether reads from the latch with the latch or  Writes to the latch write the latch. Reads from the port PORTx read the port pins, while writes operations write the latch. ODCx, associated with each of the port. Setting any of the design of the bit the equivalent pin to act as an open-drain output.

Peripheral pin chooses characteristics are controlled through two sets of SFRs: First one is to map peripheral inputs, and the second one is to map outputs. Because they are independently controlled, a particular peripheral’s input and output (if the peripheral has both) can be placed on any selectable function pin without constraint.

I/O Port Control Registers All I/O ports have three registers straightly connected with the function of the port, where ‘x’ is a letter that denotes the particular I/O port:

1.TRISx: The TRISx register control bits choose whether each pin associated with the I/O port is an input or an output. If the TRIS bit for an I/O pin is a ‘1’, then the pin is an input. If the TRIS bit for an I/O pin is a ‘0’, then the pin is configured for output.

2. PORTx: Data on an input-output (I/O) pin is accessed via a PORTx register. A read of the PORTx register reads the value of the input-output (I/O) pin, while a write to the PORTx register writes the value to the port data latch.

3. LATx: I/O The LATx register connected with an I/O pin removes the difficulties that could arise with read-modify-write instructions. A read of the LATx register returns the values held in the port output latches, on the contrary, the values on the I/O pins.

4. ODCx, associated with each of the port. Setting any of the design of the bit the equivalent pin to act as an open-drain output.


Related Solutions

In MIPS Assembly Language in Mars, define a method 1 to check if a number is...
In MIPS Assembly Language in Mars, define a method 1 to check if a number is divisible by 4. Then, define a method 2 to generate a random number, call method 1, and return result(number, yes/no) to main. Lastly, have the main method call method 2, and display the results.
Assembly Language Coding Using MARS (MIPS) 1)Write a program that prints your name in a Triangle....
Assembly Language Coding Using MARS (MIPS) 1)Write a program that prints your name in a Triangle. (NAME = John Doe) 2)Write a Program that intializes X to 10, Y to 20 and Z to -50, adds X and Y and Z and prints the following the value of each variable, for example value of x is 10 as well as the result of the addition.
Hello I am needing an example of how to write an assembly (MIPS) code that with...
Hello I am needing an example of how to write an assembly (MIPS) code that with will ask the user for two numbers then for addition or multiplication by typing in + or * into the command prompt. For example if I type in the number 2 and 5 then + The code should add the sum between the two numbers like 2 + 3 + 4 + 5 = 14. If multiplication is implemented then it will do the...
Using MIPS (MARS) - Assembly Language Assignment ( PLEASE USE COMMENTS TO DESCRIBE EACH STEP )...
Using MIPS (MARS) - Assembly Language Assignment ( PLEASE USE COMMENTS TO DESCRIBE EACH STEP ) Take input of name, the input of hours worked, and input of hourly wage, and use input of hourly wage and hours worked to calculate total paycheck and print Name, and paycheck.
MIPS ASSEMBLY LANGUAGE (I'm using MARS) Can you provide me with the code of this, without...
MIPS ASSEMBLY LANGUAGE (I'm using MARS) Can you provide me with the code of this, without using DIV (4a-b)%[(2+c)/d] (a,b,c,d are user inputs)
Using MARS write a MIPS assembly language program to prompt the user to input two 32-bit...
Using MARS write a MIPS assembly language program to prompt the user to input two 32-bit integers X and Y (X and Y can be prompted separately or at the same time), get them from the user then store them in memory locations labeled X and Y respectively. The program then loads X and Y from the main memory to registers, calculates the sum of them (i.e. X + Y) and store the sum into a memory location labeled S....
I am in a spaceship traveling to Mars at 500000m/s. My ship has a red light...
I am in a spaceship traveling to Mars at 500000m/s. My ship has a red light on the front of it with a wavelength of 750nm. What frequency does an observer on Mars think my light appears to be? Towards what color range/light range is that shift? Does it get shifted towards higher frequency or lower frequency?
Use MARS to write and simulate a MIPS assembly language program to implement the strlen function....
Use MARS to write and simulate a MIPS assembly language program to implement the strlen function. The program should ask for a user's input and print the length of the user's input. Write the main function to call strlen. The main function should: - Prompt the user for input - Pass that input to strlen using registers $a0. - Preserve (i.e. push onto the stack) any T registers that the main function uses. The strlen function should: - Preserve any...
I worked on this my self but I am not sure about it and I feel...
I worked on this my self but I am not sure about it and I feel like I get confuse in explaining some of them, I want to capare and contrast the different types of membrane transport processes.( including differences and similarities) simple diffusion facilitated difusion osmosis primaryactive transport secendary active transport vesicular transport The comparison and similarities should be about each of these topics. 1.direction of transport 2.energy requirement 3.protein requirement 4.types of protein if applicable 5. example of...
Hi I am not sure how to go about answering this question on my homework. ABC...
Hi I am not sure how to go about answering this question on my homework. ABC corporation adopts a compensatory stock option plan. the plan covers 25 executives and provides each executive 300 otions to purchase stock for $100/share. the options vest in 3 years. the plan starts on 1/1/18 and matures 12/31/20. we assume a 95% retention rate. at 12/31/20 22 executives earn the options. each option is valued at $17/share. record the journal entries for 12/31/18, 12/31/19, and...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT