08m to 28x1 serial data

sid

Senior Member
hi,
Advice from a previous post helped me to get an 08M to talk to a 20x2, now I'm trying to get the same 08m to talk to a 28x1.
I've written a short test code which works in the simulator
Code:
start:
;serin s8x1
setfreq m8

serin 2, n1200_8, ("ABC"),b0
if b0=1 then goto led1
if b0=2 then goto led2
goto start

led1:
high 7
low 6
goto start

led2:
high 6
low 7
goto start
but it doesn't work in the real world.
I know both circuits work and there is a 0v strap between each circuit, so it must be an error with my code (again).

Also I'm confused about the input pin command. Reading the manual, I should be using a "porta" command for example something like...
Code:
serin porta, 0, n1200_8, ("ABC"),b0
serin port a.0, n1200_8, ("ABC"),b0
But these throw up syntax errors, so I searched through the forum and came across a thread that used
Code:
 serin 2, n1200_8, ("ABC"),b0
which pass's the syntax test but I don't have a clue which pin "2" is.
Even when I tap my serial-out lead onto each input/output pin of the 28 the 28 fails to respond.
 

sid

Senior Member
Input Pin 2 is on leg 13 of a 28X1. Pinouts are in PICAXE Manual 1.
P33 of Manual 1 shows a pinout for the 28x and pin13 is labelled up as c.2,not 2. Its all very well being refrered to the manuals but in a lot of cases the manuals aren't that plainly written. Because the manuals have been written by people who know what they're talking about, the explanations all make sense to the author and experts such as your self, but to the relatively newcomer like myself the manuals are often ambiguous, confusing and lack "basic" clarity.
So pin 13 port c.2 can be used as serin 2.

How do I get port a.o to work as a serin pin?
 

John West

Senior Member
I have version 5.3.0 of the editor - and the manual 1 found in the HELP section at the top of the editor screen identifies the pinout of the 28X1 (on page 8 and page 33.) It shows one of the possible functions of IC leg 13 as being "In 2" - among others.

It appears the 28X2 found directly above the 28X1 (on page 33) is what you are now referring to (while in the post immediately preceding this one you simply refer to "28X" as if the 28 pin chips are all the same) - but in your original question you indicated you were working with a 28X1. Which is it? The chips are not the same.

While the docs are imperfect - as are all things - and would benefit by a good rewrite - I've found that with some care and persistence and double checking of things (and a bit of help from the forum) that they do a pretty good job - even for those of us who are not experts. Looking them over for awhile to get a feel for their manner of implementation is the key to getting the most out of them.
 
Last edited:

hippy

Ex-Staff (retired)
P33 of Manual 1 shows a pinout for the 28x and pin13 is labelled up as c.2,not 2.
That's the pinout for the 28X2. The pinouts for other 28-pin chips are shown below that.

It appears there is some confusion over which PICAXE you are using and there may be further confusion between "pin" ( what's used in commands ) and "leg" ( where that pin is on the physical chip ).

Can you clarify which PICAXE you are using and which pin / leg you are trying to connect to ?
 

westaust55

Moderator
@sid,

presuming that you are using a 28X1 chip then

The pin outs in the manuals are correct as others have advised above.

Your example program lines of:
serin porta, 0, n1200_8, ("ABC"),b0
serin port a.0, n1200_8, ("ABC"),b0​
can never work on a 28X1

PortA is primarily for analogue inputs and may be used for simple digital inputs but only with the IF...THEN statement.

For SERIN comamnd to work on a 28X1 you must use the "normal" (portC) pins on physical legs 11 to 18
 

sid

Senior Member
Yes I am using a 28x1, sorry if I did not make that clear.
I was trying to connect to pin 2 (port A.0) but looking at the manual again with fresh eyes I can see your right, I've been looking at the pinout for the 28x2 and not the 28x1, dooooh
Although I still wouldn't have known that C2 was serin 2.
Perhaps todays lesson, is to walk away for a couple of hours and come back to it later
Thanks all
 

hippy

Ex-Staff (retired)
Although I still wouldn't have known that C2 was serin 2.
Using an X2 and pin C.2 would be SERIN C.2 -- non-X2's use a pin number while X2's have a port.number designation. On an X2 you can use pin A.2 with SERIN A.2 etc, on non-X2 the Port A pins can only be used in a more limited way.

Perhaps todays lesson, is to walk away for a couple of hours and come back to it later
That always helps I find. As well as 'sleeping on it', taking a break away from things is a very good tool to have in an armoury.
 
Top