12.07.2015 Views

PICAXE Manual Section 1 - TechnoPujades - Free

PICAXE Manual Section 1 - TechnoPujades - Free

PICAXE Manual Section 1 - TechnoPujades - Free

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

www.picaxe.co.uk<strong>Section</strong> 1 80GETTING STARTEDAppendix C – Configuring the <strong>PICAXE</strong>-14M Input-Output Pins<strong>PICAXE</strong>-14M (advanced use)+VSerial InADC4 / Input 4Infrain / Input 3PWM 2 / hpwm A / Out C5 / In C5 / Input 2hpwm B / Out C4 / In C4 / Input 1ADC0 / hpwm C / Out C3 / In C3 / Input 012345671413121110980VOutput 0 / Serial Out / InfraoutOutput 1Output 2Output 3 / Out C0 / In C0 / ADC1Output 4 / Out C1 / In C1 / ADC2Output 5 / Out C2 / In C2 / ADC3 / hpwm DThe <strong>PICAXE</strong>-14M is a very versatile device. In it’s default state, which is designedprimarily for educational use, it has a simple, clean ‘inputs on left’ - ‘outputs onright’ layout.However more advanced users can re-configure the bottom 3 pins on each side tobe either inputs or outputs. This has added advantages as follows:- more flexible quantity of inputs and outputs- more ADC channels become available- the option to use pwmout via the pwmout and hpwm commandsThe diagram above shows the advanced function of each pin. The 6 pins arearranged in a ‘port’ (portC) with bits labelled C0-C5. Note that the portC bitnumbers do not correspond to the normal input/output numbers (or even the legnumbers!). Study the pinout diagram very carefully!Using portc pins as outputsAny portc pin can be configured to be used as a digital output.To convert the pin C3 to output and make it highhigh portc 3To convert the pin C3 to output and make it lowlow portc 3To convert all the pins to outputslet dirsc = %00111111To convert all the pins to inputslet dirsc = %00000000It is not possible to access the portc pins C3-C5 with any other ‘output’ typecommands (serout, pulsout etc). Therefore when used as outputs these pinsshould be reserved as simple on/off outputs. Remember that C0-C2 are normaloutputs (3-5) anyway, and so can be used with any output command.revolution(c) Revolution Education Ltd. Email: info@rev-ed.co.uk Web: www.rev-ed.co.ukVersion 6.9 07/2009All rights reserved.80

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!