How to address the outputs C0-C7 on the

28X? These are pins 11 to 18 which are the regular input pins like input 0-7. How do I address these as output pins so I can use them as such?
 

inglewoodpete

Senior Member
The port C pins 0-7 default to input but are actually bidirectional as you mention. These pins also have some special funtions. Refer to "PICAXE-28A/28X/28X1/28x2 Pinout and Circuit" in Manual 1 "Getting Started" for details.

To enable any of the port C pins as outputs, refer to the "Let DirsC", "High PortC" & "Low PortC" commands in the Manual 2 "Commands". Other commands like Toggle and PulsOut connot be used on PortC pins.
 

lbenson

Senior Member
Try this in the simulator:
Code:
#picaxe 28x1

dirsc = %11111111   ' all outputs

main:
  b13 = 1
  for b12 = 1 to 8
    pinsc = b13
    pause 1000
    b13 = b13 * 2 ' shift the bit which is on to the left
  next b12
  goto main
 

westaust55

Moderator
How to address the 28X1 outputs C0-C7

Read PICAXE Manual 1 page 84 and you find that it tells you all:

Using portc as outputs
The portc pins are, by default, digital input pins.
However they can also be configured to be used as digital outputs.
To convert the pin to output and make it high
high portc 1
To convert the pin to output and make it low
low portc 1
To convert all the pins to outputs
let dirsc = %11111111
To convert all the pins to inputs
let dirsc = %00000000
Note that ‘dirsc’ uses the common BASIC notation 0 for input and 1 for output.
 
Top