Editing A Really Basic Guide to the PIC Microprocessor and BoostC
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 200: | Line 200: | ||
this is the so called main program, when the PIC starts up it starts here. What does this code do? Lets take a look: | this is the so called main program, when the PIC starts up it starts here. What does this code do? Lets take a look: | ||
− | '''//Configure port | + | '''//Configure port A |
trisb = 0x00;''' | trisb = 0x00;''' | ||
− | this line sets the control register for port | + | this line sets the control register for port a: called trisa to all 0's ( every bit = 0 ). 0 makes the bit an output bit, that is the pin connected to port pin is an output pin. To find what pins this is on the chip look in the 877 manual The 0x means that the number is expressed in hexadecimal or base 16. You can also use regular decimal, or binary. In binary you can clearly see each bit. |
0x0 is 0b0 in binary or 0b00000000 the last notation showing all 8 bits in the byte. | 0x0 is 0b0 in binary or 0b00000000 the last notation showing all 8 bits in the byte. | ||