Cheers.Excellent idea. I'll do that now.
And there's a genuine reason why I and others ask for
location:
It's about providing information about accessible
local resources and hardware.
e
Cheers.Excellent idea. I'll do that now.
Now seriously, does the moon have any effect whatsoever on serial comms, as the PICAXE download circuit might use a slow download speed and is not affected.Cheers.
And there's a genuine reason why I and others ask for
location:
It's about providing information about accessible
local resources and hardware.
e
Hmmm?Now seriously, does the moon have any effect whatsoever on serial comms, as the PICAXE download circuit might use a slow download speed and is not affected.
I think it's by simply pushing the pendulum. Is that right?Consider the case of a Grandfather clock.
How does the owner renew its energy?
Whatever turns you on. )I think it's by simply pushing the pendulum. Is that right?
What's that supposed to mean?Whatever turns you on. )
Me being silly.What's that supposed to mean?
2000 /10000 ?Well now it's much worse! Corruption starts now at around only 2,000.
This isn't about the terminal. I'm talking about how many bytes of EEPROM the checker gets to before the data going to the GLCD gets corrupted.
Well I'm completely confused. With what sending what to what?Well now it's much worse! Corruption starts now at around only 2,000.
Well that's nice to know (now) - I suspect your patient audience were all thinking it was the number of bytes being transmittedI'm talking about how many bytes of EEPROM the checker gets to before the data going to the GLCD gets corrupted.
I have produced some test code - see after the stuff below.Well I'm completely confused. With what sending what to what?
You can see exactly what you've got in terms of EEPROMs, 18M2, 28X2, 40X2, resonators, crystals (and their capacitors?) and GLCDs - we only get snippets and it's too hard to guess what exactly you mean
Simplify it all down. Show some simple reproducible code that other people can run (so don't test an EEPROM as a means of testing serial comms, just PICAXE to something) to prove that PICAXEs are fundamentally unreliable (which seems to be the subtext of your posts IMHO).
If you can't (show some simple reproducible code that shows the problem) then it's highly likely it's something you are doing that we can't see...
Not looking at the datasheet at present but from what I remember the baud rate generator within the PICmicro increments 0 to N which is N+1 'steps' and that +1 becomes -1 when the equations are rearranged. Or something like that.Added: Has anyone got any idea why 1 needs to be taken off of the value calculated using the hsersetup formula after doing the (Fosc/BaudRate)/4 bit?
I will make a full circuit diagram for the test setup tomorrow.Crossed with a couple of posts above. I'm still not sure what we have or what the test regime really is.
Probably worth asking Microchip why there is a +1 adder in the USART Baud Rate Generator - Fig 15.1 of the 18F14K22 (20X2) datasheet which leads to all the Baud Rate Generator equations in Section 15.3...and which are the basis for the Rev Ed equations in Manual 2.Has anyone got any idea why 1 needs to be taken off of the value calculated using the hsersetup formula after doing the (Fosc/BaudRate)/4 bit?
I was meant to put a low command after the first loop waiting for busy to go high. I've done that now but it hasn't fixed the corruption.Just an observation. I notice that you have High ExecuteNow in the loop, which is obviously refreshed each loop. However, there is no equivalent Low ExecuteNow.
I'm not about to bury myself into the datasheet but does the GLCD need an edge or can it work continuously with the ExecuteNow line high?
That was already quite obvious.Dippy said:Just one final note about Asynch serial; timing errors are cumulative. i.e. a few bytes might get read OK, but if you send in a long stream/string then the timing errors build up and the string gradually corrupts until it conks completely.
I have a 3.6864 crystal I could try.MartinM57 said:So the final advice on accurate baud rates is to use a "baud-friendly" crystal - 3.6864, 11.0592, 18.432 etc - and then suffer the additional complexity that some of the PICAXE commands (wait, pause etc) take different times than the simple ratios of 2/4/8 that you get with the nMHz (n = an integer) crystals/resonators.
#picaxe 40x2
#no_data
#no_table
setfreq m32
hsersetup B4800_32, %001
do
do : loop until ptr <> hSerPtr
sertxd (@ptrinc)
loop
Oops! I was thinking too much about resistors. There's still corruption even after correcting it.Caps in parallel? http://www.play-hookey.com/dc_theory/parallel_capacitors.html. In series would be a lot better....
It isn't always 90. It varies each time it is run but it is within around 25 of 90.Looking at it afresh:
- if you get a corruption at 90 characters, reset everything and try again, does it go wrong at 90 again? I can't believe any comms link drifts reliably enough to not work after just 90 characters
Actually I meant today. Here's the full schematic for the recent test application - attached as a pdf.nick12ab said:I will make a full circuit diagram for the test setup tomorrow.
Well digital signals only have two voltage levels: high and low, so the stop bit has to be either of the two and what's stopping it from being interpreted as a data bit and the next or previous bit being used as the stop bit?MartinM57 said:"...Asynch serial; timing errors are cumulative..." I thought the start bit for each character, and the way it's interpreted by the receiver meant that it's not cumulative?
The stop bit must be a mark. If the serial is the hardware UART from 28x2 and picaxe firmare uses it, then that bit is checked and gives out Frame Error if it doesn't match.Well digital signals only have two voltage levels: high and low, so the stop bit has to be either of the two and what's stopping it from being interpreted as a data bit and the next or previous bit being used as the stop bit?
But if the data bit is also a mark then it could mistake that for the stop bit. As it corrupts and then temporarily corrects itself (for a small number of bytes) over and over again when it is corrupting that must be what's happening - data gets corrupted because the UART sees the wrong bit as the stop bit, and then the 'Frame Error' occurs when the bit it mistakes for the stop bit is not a mark.The stop bit must be a mark. If the serial is the hardware UART from 28x2 and picaxe firmare uses it, then that bit is checked and gives out Frame Error if it doesn't match.
What speed, and was it on a breadboard or PCB?I have 14M(x5) as slaves and a 28x2 as master network running for two years without serial issues.
Ok. I'll try reducing the speed of mine down to that and see if the corruption goes away.Is still running Nick, 4800 bps. Two years in a breadboard?
I'd agree. Maybe what's wrong isn't so "simple" but certainly there's more to it than baud rate and oscillator accuracy.But this is all getting far too complicated - I'd put 10p on there being something simple wrong, unrelated to this baud rate diversion...
#Picaxe 18M2
Symbol B2000000_16 = 1
SetFreq M16
HSerSetup B2000000_16, %010
Do
b0 = b0 + 1
HSerOut 0,( b0 )
Pause 2
Loop
#Picaxe 28X2
#Terminal 19200
Symbol B2000000_16 = 1
SetFreq M16
HSerSetup B2000000_16, %111
Do : Loop While ptr = hSerPtr
b1 = @ptrInc
Do
b0 = b1 + 1
Do : Loop While ptr = hSerPtr
b1 = @ptrInc
If b0 <> b1 Then : SerTxd( "FAIL" ) : End If
If b0 = 0 Then : SerTxd( "-") : End If
Loop
A few dashes will appear in the terminal then it will just be FAIL constantly. I think I should re-build the circuit on stripboard in case there is a problem with the breadboard I'm using.I'd agree. Maybe what's wrong isn't so "simple" but certainly there's more to it than baud rate and oscillator accuracy.
Below are my 'stress tests' for serial comms. The 18M2 uses HSEROUT to blast out an incrementing byte value at 200000 baud (2Mbps) every 1ms or so, and a 28X2 captures them with high-speed background receive and reports "FAIL" on the Terminal display when the latest is not one greater than the previous, and prints "-" repeatedly when everything is tickity-boo. Every consecutive "-" without "FAIL" indicates 256 bytes received without error. Both PICAXE run from internal oscillators, 16MHz.
No prizes for guessing what results I see
Isn't a dev board just a breadboard stuck in the middle of a few components like AXE091?dev boards
I don't have an oscilloscope. Would using a power MOSFET pair make it better though.hippy said:Putting a scope on the signal should show that
Just for today's testing,I don't have an oscilloscope. Would using a power MOSFET pair make it better though.
??? - I'll have to assume that's humor or admit I'm completely confused.I don't have an oscilloscope. Would using a power MOSFET pair make it better though.Putting a scope on the signal should show that.
Sort of. In theory having more current will make the wire go from high to low and low to high faster but I know that power transistors for a signal line are a massive overkil.??? - I'll have to assume that's humor or admit I'm completely confused.
I wasn't really going to stick in the power MOSFETs! I'm currently assembling a stripboard version which should remove the breadboard issues.Power MOSFETs? What, as a push-pull driver for transmitting 6 inches? Have you been out in the sun? It's a lovely day.
For short lengths direct (or via e.g. 1K) is fine. Transistor buffering should not be needed (and if you do it wrong then how will you know you've improved it ....without a 'scope?)
Slewing problems would mean serious wiring problems/layout in such a short distance.
Don't get diverted on to a tangent now - tidy your layout and wiring and then double check it before sticking devices in.
If your circuit is more complicated than it appears then it is time to post a schematic.
OK, I'll do that now.Did you try the stress tests at lower baud rates ? You were seeing some "-" symbols so that suggests some consecutive data was getting through.