20X2 pulsout on C port?

ljg

New Member
Is it possible to use Pulsout on the C port of a 20X2?

I want to use the hardware interrupts and I2C and still control some servos and have run out of pins. The documentation mentions the servo command only works on the B port, but isn't clear to me about the C port and pulsout.

the documentation on Pulsout only mentions 0-7 as pin designations.

Thanks, Larry
 

westaust55

Moderator
With the X2 chips, you have to state the port (by its letter) as well as the pin number


So for port C

Pulsout C.x, 1000

will pulse pin x of port C for the specified duration (in ms).

Be aware that the X2 devices have a default clock speed of 8MHz. You will need to read up whether that influences the duration for X2 devices for the PULSOUT command.
 

ljg

New Member
thanks for the quick response, and for the reminder on the 8MHz clock speed. I guess that translates as 5µsec units, so I'll make adjustments.
 

westaust55

Moderator
Had a chance to read manuals now.

Picaxe Manual Part 1 page 78 states:
All main PICAXE functions are based upon a 4MHz resonator frequency (8MHz on X2 parts).
From this I understand that the X2 parts will use the same time frame at 8MHz and other PICAXE parts (M, X and X1 ) use at 4MHz.

thus PULSOUT C5, 1000 would still time for 1 second by my understanding.


Test and make sure for yourself.
(I am sure if this is wrong someone will quickly correct)
 
Top