What's different between 14m and 14m2 ?

100317

New Member
I have created a stripboard with a 14M to act as serial LC Display. It works perfect.
I have created a second Stripboard with a 14M to act as Master for the serial LCD. It works perfect.

Because of the very low program space I have substituted the 14M with the 14M2. But I get always garbage on the LCD. Why?

I tried the serial LCD with a 14M and also with a 28x1. It works as expected.

What is different between 14M and 14M2?

The Programm code is very simple:

serout 3,N4800,(Pos1,"Kessel- ") ' Ausgabe auf LCD
pause 400
serout 3,N4800,(Pos4,"steuerun") ' Ausgabe auf LCD
pause 400
serout 3,N4800,(Pos5,"g2 ") ' Ausgabe auf LCD
pause 200

Advices are appreciated.

Thanks.
Hans
 

westaust55

Moderator
Have a read of the M2 brief/addenda:
http://www.picaxe.com/docs/picaxem2.pdf

Note the new port.pin style for IO pin addressing.
Also there is a need to use the dirsB command to predefine IO on port B before a pin can be used as an output (there are some exceptions such as the HIGH and LOW commands).

What clock speed is the M2 part operating at?
Default is 4MHz (unless in multitasking mode).
If using an alternate speed, you need to add the clock speed as a suffix to the baud rate
For example N4800_8
 
Last edited:

Technical

Technical Support
Staff member
Also there is a need to use the dirsB command to predefine IO on port B before a pin can be used as an output (there are some exceptions such as the HIGH and LOW commands).
Actually all of the output commands set the pin as output (e.g. serout, pulsout etc.) not just the simple high, low
The exception is that you do need to set the pin as an output before using 'let pinsB = '
 

100317

New Member
I use all devices with default speed (4Mhz).

I tried many things with no luck.

I also tried Calibfreq 10. In this case it worked, but if I turn the ciruit off and on, I get the same garbage.

Here ist the code.
 

Attachments

Technical

Technical Support
Staff member
Garbage is because you are mixing T4800 and N4800

serout 3,T4800,(Pos1,"Kessel- ") ' Ausgabe auf LCD
pause 100
serout 3,N4800,(Pos4,"steuerun") ' Ausgabe auf LCD
pause 100
serout 3,N4800_4,(Pos5,"g2") ' Ausgabe auf LCD

also chnage symbols like this:

symbol Led = B.1 ' Output 1
symbol Taste = pinC.2 ' Input 2
symbol Ton = B.2 ' Output 2
symbol Relais = B.4 ' Anschluss des Relais auf Output 4 /Out C1 /pin 9
 

100317

New Member
Sorry Technical.

The code that i gave you was the last test. Before I try it with N4800, N4800_4, N4800_8 ... etc.
But it does not work. Only with calibfreq I get some time a good result.
 

inglewoodpete

Senior Member
Your only option will be to continue to use CalibFreq 10.

It is unusual to have to adjust the clock speed by such a large amount.

If you use the SerTxd command with either the 14M or 14M2 chip, do they communicate OK with the PE Terminal? Or do you have to adjust the speed of the PICAXE so that you can receive good data with the Terminal?
 

100317

New Member
@inglewoodpete,

If I use calibfreq 10 and after I turn the power off and on, it does not work. If I download the progamm twice without powering off and on then I get the Message some times correct!
Calibfreq -in my case- does not disturb the Messages, sent to PE.


I have now corrected the Programm as Technical mentioned, have testet it with Calibfreq -1 to -15 and also 0 -15 with no luck.


I have attached the two programms that are involved.

Thank you for your Time.
Hans
 

Attachments

Technical

Technical Support
Staff member
Why don't
PPause:
Toene:
have a return - they both drop into the code below.

Which code are you trying to #rem out - there is no matching #endrem

Also you have some serouts of a single byte e.g.
serout 3,N4800_4,(dc) ' Anzeige löschen
but your serial firmware must always receive 9 bytes before it does anything....

Try and simplify your programs much more, so we can get a clear idea of what you are actually trying to do.
 
Last edited:

westaust55

Moderator
Further to the comment by Technical about the #REM without an #ENDREM

At the bottom of the Init: section where you have:
#rem
gosub interrupt ' setzen interrupt für starttaste
B12 = 0 ' Kennung für Interrupt

it is hard for us to tell what is temporary for testing or intended.
The Interrupt routine is the only place where B12 is set to 1

Yet immediately after the GOSUB interrupt you are setting B12 to 0

It would be better if you had
setint %00000100,%00000100 ' interrupt setzen
as part of the Init: section of the code.

Until B12 = 1, the program will never progress to the Start: label and perform the rest of the program.

It would be far better to post your program as you want it to work without added lines or REM'ed out lines for testing purposes.
 
Last edited:

100317

New Member
@Technical and westaus55

The only reasons why I put in the #rem directive is to make the downloading MUCH faster and I can download it also to the 14M.

My problem is only that SEROUT is not working properly.

The rest of the programm is in this case irrelevant until I get serout working.

For your information: the Programm is tested and running for a month but it was very hard to get information about the status with only sound.
So I bought some 14M2 to have more space. I then connected a serial LCD, added the serout commands and remark the rest of the programm out so that i can run it on the 14M and it works.
Then I put in the 14M2 into the circuit and now have all trouble of this world. :)
 

Technical

Technical Support
Staff member
You are missing the point really. You can't test reliably with a faulty test program. You need to go back to basics and have a new, proper, clear test program, not a hacked old program.

For instance, the way your serial system works is that you *must always* have 9 bytes in the correct order for it to work. This is not a good design for a serial LCD. Just because it happened to work in the past does not make it a good reliable design.

So if you do a download to the 14M2 and interrupt the main program, you could then end up sending an incomplete number of bytes to the 14M. You are then out of sync and nothing will work as expected, which is what you seem to be experiencing. Every time you do a download the serout pin is also floating and could be floating high, corrupting the signals to the 14M and again putting the LCD out of sync.

You should also consider adding a low B.3 as the first line in your program. Without it the 14M2 serout pin is floating until the first serout command. This could indeed corrupt your LCD transmission system with floating signals, due to the 14M '9 byte' requirement. A 10k pull down resistor on the serout pin may also help.
 

100317

New Member
I have found the solution for my problem.

Low B.3 as recommended
10K Resistor as recommended and
CalibFreq 14

have solved my problem.

Thanks to all which have tried to solve my problem.

Hans
 
Top