Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Can you check my answers - Internal elements of PIC

Status
Not open for further replies.

Spadez

New Member
Hi, could you please give me some feedback on my answers please?

------------

QUESTION
Briefly describe the function of the following internal elements of a 16F628
microcontroller :
i) PORTB
ii) The STATUS register
iii) The OPTION register
iv) The Stack
v) The CMCON register

ANSWER
i) PortB is an 8 bit register located in BANK0, which controls the state (high / low) of the port b bits, B0 through to B7.

ii) The status register contains the result of the arithetic or logical operations of the program.

iii) The contents of W are loaded into the option register. This instruction is used to prescale, i.e set TMR0 timing rate.

iv) The stack is the name given to the memory location that keeps track of the programs address when a call instruction is made. There is an eight level stack in the 16F628, meaning it can make eight total jumps and the stack will be able to return to the original program.

v) The CMCON register controls if the comparitor pins are enabled. By default they are enabled, which means that they are set to compare the input voltage with a reference voltage.


------------

I think these answers might be a bit flaky, so any feedback is appreciated.

James
 
Just from a linguistics point of view your definition of stack should replace location with area. The stack is an area, the stack pointer is a location.
 
Just from a linguistics point of view your definition of stack should replace location with area. The stack is an area, the stack pointer is a location.

Agreed. You also might want to change that "jumps" to "calls" in that same answer, as the stack normally records the return address from a CALL, not a jump.
 
i) could be better. What's a port?
ii) Nope. If I added 2 and 2, the result 4 is in the STATUS register?
iii) You probably only described one use, right?
iiii) A stack is a structure. LIFO, FIFO are just two types of stacks. LIFO - Last In First Out; FIFO - First In First Out Describe the structure.
iv) CMCON - Can't comment
 
I see nothing wrong with the PortB definition.

If you add 2 to 2 the results are stored in the destination register. The status registers will only change for carries or other instruction specific reasons.
 
Port B is an 8 bit register located in BANK0, which controls the state (high / low) of the port b bits, B0 through to B7.

the OP is using the word that's being defined in the definition. In grade school I was told that's a bad idea. Just like the the definition of "steering wheel" is not the wheel that controls the steering. is not the definition. "controls the steering" has to be at least be changed to 'controls the direction ....etc.'

More importantly, it's a digital ON/OFF input/output interface to the world as opposed to a register etc.

Thanks Mike.
 
Last edited:
Good point Pommie.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top