Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 06:00 06 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Electronics : PICAXE 20X2 CHIP PROBLEMS

Author Message
Downwind

Guru

Joined: 09/09/2009
Location: Australia
Posts: 2333
Posted: 11:33am 05 Jul 2010
Copy link to clipboard 
Print this post

Picaxe 20X2 chip Problems.


It became apparent that the picaxe 20X2 chip has problems with sending serial data through the USB to serial cables i am using, all other picaxe chips work fine but the 20X2 would send pure garbage, regardless of the clock speed or baud rate used.

It would work fine with a standard serial cable and a physical serial port but not through a USB to serial cable.

This turns out the be a miss calibration in the clock timing within the 20X2 picaxe chips and needs a re calibration done to the internal clock to get it correct.

This requires the "CALIBFREQ" command to be used to adjust the internal clock speed slightly.
My chip needed a value of minus 14 in the calibfreq command to set the internal clock to run at the correct speed.

This simple program loop will allow for you to adjust the clock frequency and also see if the data out is corrupted or not.
It might need the value of calbifreq adjusted till no corrupt data is shown on screen in the terminal window (press F8)...trial and error adjustment.

[code]
#Picaxe 20X2
#Terminal 4800

setfreq m4

CalibFreq -14

Do
SerTxd( "U" )
Pause 50
Loop
[/code]

I find it best to do the adjustment at the lower 4 meg speed then once adjusted check the higher speeds 8meg, 16meg, 32meg, 64meg.

Once adjusted just place the calibfreq XX command in the startup of the picaxe program, and good data transfer will result there after.

I suspect some of the data errors that show with other chips in serial comms is due to miss matched internal clock frequency, that causes incorrect timing in the serial data as well.

Pete.
Edited by Downwind 2010-07-06
Sometimes it just works
 
GWatPE

Senior Member

Joined: 01/09/2006
Location: Australia
Posts: 2127
Posted: 12:52pm 05 Jul 2010
Copy link to clipboard 
Print this post

Hi Pete,

I think the problem is really partly with the USBinterface, as I have a futuretech USB to ser converter that adapts and works with a frequency compensated picaxe and a non compensated as well.

My chinese converter came to life with a frequency compensation of -30.

I have tested up to a 32M clock on the picaxe and all systems are go now.

May go up to 64M just for kicks.

Gordon.

PS I increased the adjustment to a point where COMMS came good, and then increased to a point where the COMMS lost the plot again. I set the adjustment to the value approx half way between these limits, and seems OK now with the chinese converter. The futuretech unit works all the time, so must adapt to the COMMs automatically.
become more energy aware
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5024
Posted: 02:56am 08 Jul 2010
Copy link to clipboard 
Print this post

Good tip Pete, I had the same problem here. Fixed now.
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024