Executing Programs on Microcontrollers & Hexadecimal

Click For Summary

Discussion Overview

The discussion revolves around the execution of programs on the PIC16F819 microcontroller, focusing on how programs control current flow and the significance of hexadecimal notation in programming. It encompasses theoretical understanding, practical application, and conceptual clarification related to microcontroller operation.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Homework-related

Main Points Raised

  • One participant expresses confusion about how programs execute on the PIC16F819 microcontroller and how current flow is controlled by the program.
  • Another participant explains that transistors create logic gates and flip-flops, which are used to store bits and route information based on program instructions.
  • A participant asks for clarification on the meaning of "0x10" and whether it represents hexadecimal notation, seeking to understand its value and how to calculate it.
  • Another participant confirms that "0x" denotes hexadecimal notation and explains the base systems, illustrating that "0x10" equals 16 in decimal.
  • Further contributions confirm the values of other hexadecimal numbers, such as "0x40" equaling 64, "0x41" equaling 65, and "0x60" equaling 96.
  • One participant suggests using the Windows Calculator for hex/decimal conversions as a helpful tool.

Areas of Agreement / Disagreement

Participants generally agree on the interpretation of hexadecimal notation and its conversion to decimal values. However, the discussion remains open regarding the deeper understanding of program execution and control of current flow, with no consensus reached on those aspects.

Contextual Notes

Some participants express uncertainty about the execution process of programs on microcontrollers and the implications of hexadecimal notation, indicating a need for further clarification on these topics.

Who May Find This Useful

Readers interested in microcontroller programming, digital logic design, and hexadecimal notation may find this discussion relevant.

indie452
Messages
115
Reaction score
0
Hi
i'm doing a circuits lab in physics at the moment based on programming a PIC16F819 microcontroller. What i don't understand is how the program is executed.
I kind of understand that when a pin is logic high voltage then the bit of the number is one and when it is logic low it is zero.

Also i understand that transistors are used to control the flow of current and this current flow results in a change of circuit voltage which represents the bits of information.
But what else is there to know? How does a progam that we write control the current flow and what does the hexadecimal notation have to do with the chip?

any help is welcome thanks
 
Engineering news on Phys.org


indie452 said:
Hi
i'm doing a circuits lab in physics at the moment based on programming a PIC16F819 microcontroller. What i don't understand is how the program is executed.
I kind of understand that when a pin is logic high voltage then the bit of the number is one and when it is logic low it is zero.

Also i understand that transistors are used to control the flow of current and this current flow results in a change of circuit voltage which represents the bits of information.
But what else is there to know? How does a progam that we write control the current flow and what does the hexadecimal notation have to do with the chip?

any help is welcome thanks

There is a good set of articles at HowStuffWorks.com about microprocessors (uPs) and how they work:

http://www.howstuffworks.com/search.php?terms=microprocessor

Transistors are used to make the fundamental building blocks of logic -- logic gates and flip-flops. Flip-flops (FFs) are used as memory to store a single bit. You use sets of FFs to make registers -- a register would be 8 bits wide for the simpler uPs, and can be 16 bits or 32 bits wide or more for more complex uPs.

You use logic gates to route the bits between registers, and the behavior of the logic depends on what is currently in memory, and what your program instructions direct the logic to do. So your program might do something like "Load Register A with 0x10", and then "Increment Register A", and then "Store Register A into memory location 0x1234". Loads, adds, increments, stores, and so on, are typical fundamental uP instructions.


EDIT -- those are fundamental Assembly language instructions. Higher level computer languages like C give you more abstract program control and flow. Higher level languages are compiled into Assembly language as part of the process of getting the program ready to load and run on your uP or uC (microcontroller).
 


berkeman said:
"Load Register A with 0x10", and then "Increment Register A", and then "Store Register A into memory location 0x1234".

ok but what does the 0x10 mean is this the hexadecimal notation? if so what is the value? how do you work it out?
 


indie452 said:
ok but what does the 0x10 mean is this the hexadecimal notation? if so what is the value? how do you work it out?

Yes, that is standard notation for hexidecimal. 0x for hex, 0b for binary.

In base 10, the numbers represent 1's, 10's, 100's, etc, right?

In base 2 (binary) the numbers represent 1's, 2's, 4's, 8's, etc. So 0b10 = 2 in decimal.

In base 16 (hex), the numbers represent 1's, 16's, 256's, etc. So 0x10 = 16 in decimal.

http://en.wikipedia.org/wiki/Hexadecimal

.
 


so does 0x40 = 64
0x41 = 65
0x60 = 96
 


indie452 said:
so does 0x40 = 64
0x41 = 65
0x60 = 96

You're on the right track. One hint -- the Windows Programs>Accessories>Calculator has a hex/decimal conversion capability (when in Scientific mode). Try it out, and you can check your equations above.
 


thanks forthe tip about the windows calculator didnt know that

thanks for the help
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 18 ·
Replies
18
Views
4K
  • · Replies 11 ·
Replies
11
Views
5K
Replies
68
Views
7K
  • · Replies 11 ·
Replies
11
Views
8K