Only 2400 Serin work with 40X1

kakolon

Member
Hi,
I'm moving my last question to a new thread, as this topic is different than the last one.

I'm using a 40X1 Picaxe, I use the Program Editor Terminal program to send 1 byte to the picaxe. If I set N2400 in the picaxe, and set 2400 baud in the terminal program, the byte arrives well. If I set higher speeds like N4800 or N9600, the byte arrives corrupt.
Could this be a BUG in the Picaxe?

I have checked cables, circuit, etc.

Thanks everyone,
Kakolon
 

Technical

Technical Support
Staff member
Please provide softeware version, PICAXE firmware version and the sample program you are using. We can then check this for you.
 

kakolon

Member
Hi Technical,

The firmware is the following:

FIRMWARE VERSION A.2
(PICAXE-28X1 (40X1)FIRMWARE VERSION 2


The simple code is:

Code:
main:

debug
serin 1,N4800,b0
serout 7,N2400,(b0,10,13)

goto main
 

Technical

Technical Support
Staff member
Why two different speeds - N4800 for serin and N2400 for serout?

The computer (terminal editor) is only running at one speed, and so can't send data at 2400 and then retrieve it at 4800!

You need to use the same baud rate in both serin and serout. Is this your problem, or was this just a typo?!
 

kakolon

Member
Technical,
The two different speeds are because, I'm sending the data to a serial printer set to 2400 bauds. But let's forget about the SEROUT.
I have tried the same code, but without the serout, and in the DEBUG screen the bytes I receive are corrupted, when I use something over than N2400.
 

hippy

Technical Support
Staff member
@ kakolon : What is the source of charcaters you are receiving from ? At all baud rates the PICAXE can miss characters if data is sent too frequently or data can get corruped if the PICAXE only starts reading a character halfway through it being sent.
 

kakolon

Member
Hi Hippy,
I'm just sending a simple keystroke with my finger, with the terminal program.
At N2400 all characters sent arrive corretly. Any higher speed makes the characters arrive altered.
 

kakolon

Member
Hi, I've made some new tests:
I migrated everything (resistors, cables, pc cable, etc, used the same code) that was used in the picaxe 40X1, to a picaxe 18X.
With this picaxe I can send and receive perfectly at N4800,N9600.
Is there something wrong with SERIN in 40X1 part?.
Do I have to use a particular pin ?
I'm trying to avoid using that hardware pins as I don´t wan´t to use a Max232.

Any ideas are very welcome,

Best regards,
kakolon
 

kakolon

Member
Hi, Guys
I only want to know if it is a firmware issue, or do I have to keep searching for the fault?

Thank you,
kakolon
 

hippy

Technical Support
Staff member
The lack of response would seem to indicate that no one here knows or no one has a 40X1 they can connect up and test with.

There's no reason I can see that 4800 shouldn't work on a 40X1 as well as it does on any other PICAXE but I have no way of confirming it does. If no one has a 40X1 to test, the only hope is that Technical can do that testing to confirm if the Firmware is faulty or not.
 

kakolon

Member
Thank you Hippy,
Im going to test the hserin use with the Max232, maybe with this it will work at 9600.
I'll be posting the news.

kakolon
 

kakolon

Member
For anyone who is interested, I have finally made the picaxe 40X1 run at 9600 baud.
As I posted earlier I was going to test the fixed hardware pins using Hserin, and interfaced with a Max232, it came out working perfectly at 9600 baud.
The conclusion I arrived till someone else makes other tests, or Technical comes up with some answers is that the serin in the 40X1 doesn't work at higher speeds than 2400.

kakolon
 

poncho8m

New Member
HI...actually Im working with 28X1 and before wiht 40X1, and i have the same problems of "byte corrupted" when use higger speed than N2400.....(that was a couple weeks ago) so I use N2400 for my project...
 

hippy

Technical Support
Staff member
It does look like something Technical will have to investigate. They asked for Firmware details earlier so I presume they are doing so.

Going back to what you were seeing; send "1" and receive back "q" or "a"; the bit streams as observed on a scope for those characters should have been ...

Code:
                   S   0   1   2   3   4   5   6   7   E
                  ___     ___________         _______
"1" / $31     ___|   |___|   .   .   |___.___|   .   |___
                  ___     _______________         ___
"a" / $61     ___|   |___|   .   .   .   |___.___|   |___
                  ___     ___________             ___
"q" / $71     ___|   |___|   .   .   |___.___.___|   |___
It could be that there's a slight discrepency in bit timing causing the PC / receiver to misinterpret what's sent.
 
Last edited:

zoid1

New Member
18X to 40X1 communication problems

Hi all,

I think I have the same problem but by trying to communicate between 18X and 40X1 controllers...

The 18X sends a serout command at T2400 (or T4800) speeds and the 40X1 receives the data at the same speed.

I am handshaking the two controllers using a simple external interrupt as described in:
http://www.hippy.freeserve.co.uk/picaxesi.htm

I am trying to sent 3 bytes and a word using the following order : byte,word,byte,byte.

Although the com link was perfect between 2 of 18X microcontrollers, it seems that using the 40X1 instead, the data received after the first byte are corrupted. Unfortunately for me is a dead end situation since the use of timeout function provided by X1, X2 controllers, is an absolute necessity.

Please let me know if you have any ideas of what might be the problem.

Regards
Akis
 

inglewoodpete

Senior Member
My only thought is that if someone has a 28X1 or 40X1 (I don't) and a 4MHz resonator available, they could test some serial comms using an external resonator.

The external resonator may offer better frequency stability/compliance.
 

zoid1

New Member
Ceramic resonator 4MHz

Hi again,

Unfortunately, I have already implemented my design using the PICAXE-28A/28X/40X PROTO BOARD KIT, which includes an external 4MHz ceramic resonator...

However, I have tested my circuit with both external or internal resonators (j4, j5 not connected if you want to operate with internal circuitry), but no results.

Any ideas?

Thx
Akis
 

zoid1

New Member
Hi kakolon,

I used an Max233 driver but there was no improvement :(.

I will try to establish a serin-serout network between two of X1 chip sets and if it works OK (as was the case with the two 18Xs) it will only mean that there is incompatibility between firmware of X and X1 versions..

Akis
 

zoid1

New Member
Hi all,

Just to let you know that I am now 90% sure there is incompatibility of the serin-serout commands between the PICAXE X and X1 versions...

I have just connected a 28X1 to 40X1 chip-sets and they communicate without problems...

Previous experiments using 2 18X were working perfectly as well...

Connection between 18X and 28X1 (or 40X1) using serin-serout failed. They could only communicate the first byte correctly!!!

Just take a look at this so you could correct it in your next firmware version. :p

Regards
Akis
 

zoid1

New Member
A correction! I have just notice it that even with the X1s the serin-serout does NOT work for frequencies higher to T2400...

It seems to me that the new X1s are highly unstable with serial commands... I give up...

I will implement an I2C communication protocol instead and that is the end of story...:p

Akis
 

hippy

Technical Support
Staff member
It would be interesting to know if the problem appears to be in sending or receiving with the 28X1 above 2400. Testing 4800 and 9600 baud from 28X1 to 18X and vice-versa would be useful tests to try while you have the test environment to try that.

I can well understand the feeling of "sod it" or "I give up", but you are doing an excellent job at helping others understand what the extent of the problem is and it is appreciated.

One thing to note is that PICAXE-to-PICAXEis usually best done at Nxxxx baud rates. Using Txxxx baud rates may give rise to more errors in the first byte sent depending upon how you initialise the output for the transmitter.
 

zoid1

New Member
Hi Again,

So far I was sending 4 bytes from the 18X device to 28X1 and 40X1(I have tried both) and I was receiving only the first byte correctly!!! Now It is worth mentioning the following things:

1. In my experiments I used the internal oscillator of 18X (transmitter) and I used the PICAXE Experimenter Kit (AXE090), which comes with a 8MHz external resonator (ZTT 8.00 MT), with a 28X1 device. The same experiment was implemented using the 40X1 device on-board the PICAXE-28x/40xProto Board (AXE022), which uses a external 4MHz resonator.

2. The serin command on the X1 chip sets was used with the TIMEOUT function . I noticed that even if I had an external interrupt to sync the two chips, increasing the TIMEOUT value was effecting the transmitter-receiver communication and above a certain value they could not communicate at all.

The same scenario was tested using a 40X1 as transmitter and a 28X1 as receiver. Initially, for the transmitter I used the PICAXE-28x/40xProto Board (AXE022), which uses a external 4MHz resonator and the receiver was utilizing the PICAXE Experimenter Kit (AXE090), which comes with a 8MHz external resonator (ZTT 8.00 MT).

A final experiment was implemented between a 40X1 as transmitter and a 28X1 as receiver again but this time both devices were accommodated on two PICAXE-28x/40xProto Board (AXE022) with an external 4MHz resonator.

In this experiments, the serial comm was perfect for T2400 speed but above that (e.g. T4800) I could only receive only the first out of four bytes correctly again.

I will do some additional experiments and I will let you know of the results :)

Akis
 

hippy

Technical Support
Staff member
One thing you could try, if this applies, is rather than ...

- SEROUT pin,baud,b0,b1,b2,b3

try using ...

- SEROUT pin,baud,b0
- SEROUT pin,baud,b1
- SEROUT pin,baud,b2
- SEROUT pin,baud,b3
 

zoid1

New Member
I have try that as well... It doesn't work!!! It gives me the same think!. Plus I have try the MAX233 chip set, which does thinks worse...

Something that I forgot to mention is that serin-serout communication between 2 18X is working perfectly for T2400 and T4800.. Therefore, I do believe that is a firmware problem...

Some additional info is that although I am using 30-40 ms Timeout period, sometimes it takes much longer to timeout (for the X1s)...

Akis
 

TERD

New Member
Simple solution - Use the calibfreq command.

The problem is that the timing is out of sync. Use the calibfreq command to slow down your x1 slighty. "calibfreq - 4" works for me at 9600.
 
Top