serout help

Durham_Biomed

New Member
Hi, I'm using a 40X1 Picaxe chip and I was wondering if the serout command can be used with pins other than 33 - 40 (Output 0 -7)? or is it possible to use it with pins that you assign as outputs?

Thanks
 

westaust55

Moderator
The SEROUT command is only for use with the 8 output pins 0 to 7.

From the PICAXE manual 2 page 144:
The serout command is used to transmit serial data from an output pin of the
microcontroller. It cannot be used with the serial download output pin - use the
sertxd command in this case.
Pin specifies the output pin to be used.
 
Last edited:

moxhamj

New Member
Lady luck smiles again. Thanks for asking this question (& for the answer) - I was just about to ask it too!

A followup question - on the 40X - which pins can be used for Serin?
 

westaust55

Moderator
serin help

The SERIN command is only for use with the 8 input pins 0 to 7.

From the PICAXE manual 2 page 140:

The serin command is used to receive serial data into an input pin of the
microcontroller. It cannot be used with the serial download input pin, which
requires use of the serrxd command instead.
Pin specifies the input pin to be used.
While the 40X and 40X1 have an additional 8-bit port, called portc, the use of this port is restricted to simpler commands like:

Pinsc, outpinsc, high portc, low portc, dirsc
 

westaust55

Moderator
If your are driving the LCD through portc using a parallel interface then yes.

But even serial comms commands like shiftin and shiftout (I have used shiftout on my 40X1 to drive 74HC595 shift registers thru the "standard" ouput pins) do not function with portc.
 

inglewoodpete

Senior Member
Port C on the 40X1 has the HSerIn and HSerOut functions on pins C6 and C7, which are a great way to implement serial I/O, especially the background receive option.
 
Last edited:

westaust55

Moderator
True IWP

And for completeness, in terms of other forms of serial comms, the 40X1 also uses the portc through:
- pins 3 and 4 to implement the i2c communications bus, and
- pins 3, 4 and 5 for spi communications.
 

BCJKiwi

Senior Member
And legs 25,26 for hserout/hserin (inc6/inc7)
For 28X and above, hser should be the way to go if not using i2c or spi.
 
Top