Programming 32bit microcontrollers in C a What pin on our mi

(Programming 32-bit microcontrollers in C) (a) What pin on our microcontroller is used to access bit 2 of Port A? (b) Jim is thinking of connecting an extra LED to pin 99 of our microcontroller. What port resource(s) will he need to light it?

Solution

a Ans)

1.The pins are what stand out of an IC, and associate electrically to the outside world. Ports are spoken to by registers inside the microcontroller, and permit the program (firmware) to control the condition of the pins, or alternately, read the condition of the pins on the off chance that they are designed as sources of info. There is a balanced correspondence between the pins on the microcontroller and the bits in its registers.

2.This processor has a 16-bit engineering, so the ports and registers are each of the 16-bits wide. Other basic information widths (and in this way port widths) in microcontrollers are 8 and 32. As appeared in the above graph, the port pins don\'t really need to be gathered together.

3.Since this specific chip has just 28-pins, there is just a single enroll that can be completely actualized, that is has pins relating to every one of the 16 bits in the I/O enlist. That is PORT B, and the pins are shaded in red in the outline above. There is another port that is in part populated, i.e. PORT A which has 5 bits actualized, RA0 through RA4. I will simply stay with PORT B.

4.There are different microcontrollers in this same processor family that arrive in a 44-stick bundle, where extra enroll pins are characterized (RA7-RA10, and RC0-RC9.

As specified before, the ports are controlled through different registers.

Contingent upon the sort of processor, the registers may show up in a similar memory outline the processor\'s memory (Smash); for this situation the locations are held for this reason and that fragment of Slam is not executed. The preferred standpoint here is that the majority of the directions that work on Slam will likewise work with the I/O registers.

The other plan, is to have an uncommon address space for I/O enrolls, and have unique directions (i.e. INP and OUT) which just get to these registers. Which plan is utilized is recorded, back in the 1970\'s Intel begun utilizing the different I/O tending to plan, and Motorola among others put both I/O and Smash addresses into a similar memory space.

b

Ans)

The Force of a microcontroller is its Pins and Ports by which it speaks with the outside world. In the figure underneath, you can see a pictorial representation of an ATmega8 microcontroller.

Atmega8 has 3 ports PB, PC and PD. PB and PD (short for Port-B and Port-D) has 8 pins related with it. PC (Port-C) has 7 pins related with it. Few AVR varieties can have as few as 3 sticks in a Port.

For this venture, we will utilize Port-C (Green shading coded). On the off chance that the voltage in any stick (PC0-PC6) is set to High (5 Volts) and associated with positive lead of Drove in arrangement and further associated with ground, your Drove ought to turn on. Set it to Low (0 Volts) and your Drove ought to kill.

Then again, in the event that you associate negative lead of Prompted to Port Stick in arrangement and further associated with 5 volts, then the Drove turns on. Set the Stick to High (5 Volts), your Drove ought to kill.

This idea is basic. In the primary situation, current streams from Stick to Prompted to ground. In the second situation, current streams from 5V control line to Prompted to stick, which is 0 volts. This is all the electronic learning required to kill on, or a Drove. Since I specified that whole port will be high, or low, you can interface the Prompted to any of the Pins in Portc.

(Programming 32-bit microcontrollers in C) (a) What pin on our microcontroller is used to access bit 2 of Port A? (b) Jim is thinking of connecting an extra LED

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site