Difference between revisions of "Sample code for most PIC18F4520 operations"

From Mech
Jump to navigationJump to search
Line 1: Line 1:
<b>Find the code samples for all of these and more at [http://peshkin.mech.northwestern.edu/pic/code http://peshkin.mech.northwestern.edu/pic/code]</b>
<b>Find the code samples for all of these and more at [http://peshkin.mech.northwestern.edu/pic/code http://peshkin.mech.northwestern.edu/pic/code]</b>


See the main page
These will/should also have wiki pages for background and associated electronics:
<li>DigitalIO Digital input and output bit-by-bit or byte-by-byte
<li>AnalogInput Reading up to twelve Analog Inputs
<li>Counter0 Counting pulses with Timer0
<li>Counter1 Counting pulses with Timer1
<li>MotorPWM PWM outputs for torque control of one or two DC motors; Timer 2
<li>RS232com Serial RS232 communication between PIC and a text window
<li>Interrupt0 Periodic servo cycles using interrupt routines, 10mS & slower; Timer 0
<li>Interrupt2 Periodic servo cycles using interrupt routines; 10mS & faster; Timer 2
<li>InterruptExternal Interrupts generated by an external pulse
<li>RCservoSoft PWM output in software for position control of up to five RC servos; Timer 3
<li>RCservoHard PWM output in hardware for position control of up to two RC servos; Timer 2
<li>QuadratureSoft Quadrature decoder/counter in software for arbitarily many encoders; 1KHz max
<li>QuadratureHard Quadrature decoder/counter in hardware for one arbitrarily fast encoder; Timers 0 and 1
<br>
<p>
Not available yet:
<li>AnalogOutputParallel Analog output using 8 digital lines
<li>AnalogOutputI2C Analog output using I2C serial
<li> Printing to a serial LCD
<li> Printing to a parallel LCD
<li> PIC-to-PIC communication
<li> Zigbee radio communication
<li> Modulated IR communication
<li> Strobing LEDs or IREDs for better range and immunity to background light
<li> I2C communication
<li> CAN bus
<li> Capturing data to Matlab
<li> Running stepper motors

Revision as of 15:08, 16 January 2008

Find the code samples for all of these and more at http://peshkin.mech.northwestern.edu/pic/code

See the main page