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 42: | Line 42: | ||
I suppose an input/output port is a peripheral, but normally the term is used for something more complicated. A counter/timer is one example. A counter is connected to some source ( a pin for example ) and each time the pin changes from a 0 to a 1 the counter increase by 1. Some counters are 8 bit, some 16 bits( this is the number of bits for the highest number the counter can count to ).. | I suppose an input/output port is a peripheral, but normally the term is used for something more complicated. A counter/timer is one example. A counter is connected to some source ( a pin for example ) and each time the pin changes from a 0 to a 1 the counter increase by 1. Some counters are 8 bit, some 16 bits( this is the number of bits for the highest number the counter can count to ).. | ||
− | Other peripherals are: PWM outputs ( pulse | + | Other peripherals are: PWM outputs ( pulse with modulation ) Serial communications, Analog to digital converters. |
All the peripherals discussed so far are built right into the chip, they are called internal peripherals, peripherals can also be outside the PIC chip, these are external peripherals. | All the peripherals discussed so far are built right into the chip, they are called internal peripherals, peripherals can also be outside the PIC chip, these are external peripherals. | ||
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 |
− | + | trisa = 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. | ||
Line 502: | Line 502: | ||
− | Lots of PIC Links use page search on PICIntro, and/or Tutorial, and/or Info for more or less instructional materials. | + | Lots of PIC Links [[PIC Links]] use page search on PICIntro, and/or Tutorial, and/or Info for more or less instructional materials. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 519: | Line 513: | ||
Programming in C: A Tutorial - Brian W. Kernighan - Bell Laboratories, Murray Hill, N. J. http://www.lysator.liu.se/c/bwk-tutor.html | Programming in C: A Tutorial - Brian W. Kernighan - Bell Laboratories, Murray Hill, N. J. http://www.lysator.liu.se/c/bwk-tutor.html | ||
− | |||
− | |||
== Appendix: What you Need for this Project == | == Appendix: What you Need for this Project == | ||
Line 561: | Line 553: | ||
CF1 This capacitor helps smooth out ripple and noise in the output. 50 micro F should do. | CF1 This capacitor helps smooth out ripple and noise in the output. 50 micro F should do. | ||
CF2 This capacitor helps smooth out high frequency in the output. Normally capacitors like this are placed close to the power pins of each integrated circuit. A ceramic capacitor of .1 or .01 micro F should serve. | CF2 This capacitor helps smooth out high frequency in the output. Normally capacitors like this are placed close to the power pins of each integrated circuit. A ceramic capacitor of .1 or .01 micro F should serve. | ||
− | |||
− | |||
− |