moving from 18x to 18M2

eitan

Member
Hi

please see below, audiorelay is output0


Symbol AudioRelay = Output0
Symbol COR = Input2
Symbol SpareSwitch = Output2
Symbol Fan = Output3
Symbol PTT = Output4
Symbol MuteRepeaterLed = Output5
Symbol MuteDTMFLed = Output6
Symbol IDLed = Output7
Symbol Timer1 = W5 'This is the Time Out timer, it's really just a counter, incrementing 1 count every 17mS.
'it's not perfect, but it works OK. 17mS. plus overheads.
Symbol Timer2 = W6 'This is the ID Timer, again, it's really just a counter, incrementing 1 count every 17mS.
'it's not perfect, but it works OK. 17mS. plus overheads.
 

eclectic

Moderator
Here's a start, but,
no idea if it will work for real.

Alter the code near the start of the program.

Code:
#picaxe 18M2 ;*********************************************************************
Symbol AudioRelay =      B.0 ;Output0
Symbol COR =             pinC.2;Input2
Symbol SpareSwitch =     B.2 ;Output2
Symbol Fan =             B.3 ;Output3
Symbol PTT =             B.4 ;Output4
Symbol MuteRepeaterLed = B.5 ;Output5
Symbol MuteDTMFLed =     B.6 ;Output6
Symbol IDLed =           B.7 ;Output7
Symbol Timer1 =          W5     'This is the Time Out timer, it's really just a counter, incrementing 1 count every 17mS.
                                'it's not perfect, but it works OK. 17mS. plus overheads.
Symbol Timer2 =          W6     'This is the ID Timer, again, it's really just a counter, incrementing 1 count every 17mS.
                                'it's not perfect, but it works OK. 17mS. plus overheads.
e
 

eitan

Member
Hi eclectic

Thanks for your post.
I tried it already but those are the simple problems.
when I fixed that, the real code start to bring bigger problem.
when I switch the program editor back to 18X, all the problems sleep (-:

Please helpppp
 

nick12ab

Senior Member
Hi eclectic

Thanks for your post.
I tried it already but those are the simple problems.
when I fixed that, the real code start to bring bigger problem.
when I switch the program editor back to 18X, all the problems sleep (-:

Please helpppp
Ok, then don't bother try my code as it is just your code but with the same changes as eclectic's.

Can you now describe the problems?
 

hippy

Ex-Staff (retired)
There are some PEEK and POKE commands at the start of the program which are "18X magic" and aren't directly transportable to the 18M2. The functionality should be achievable using 18M2 code and a circuit diagram to guide what that should be will be helpful.
 

eitan

Member
Hi Hippy
I think that you familier with the code since the code writer wrote some thanks to you (-:.
I am a beginer with picaxe and with coding, can you modifiy it to work with the 18M2?

the problems can be found when trying use the 18M2 on the programming editor.
 

Paix

Senior Member
@Eitan, I used to test code that I had written three months prior. The joke was that until I looked at the source code I didn't realise that I had written it. Life does tend to move on somewhat. I don't suppose for one minute that Hippy has a copy of the code hanging on his wall and I understand that his crystal ball is on the blink again . . .

Dodgey download cable I believe . . .
 

eitan

Member
(-:
My english is poor so I write slow, and understand even slower LOL.
I put the link to the project.
hope it will help

Thanks
 

eitan

Member
hi nick12ab

I must say that it does not tell me a lot.
I read that 18x is old and no longer can be found and we need to move to 18M2 which is a replacement.
so I wonder why isn't it a replacement, why the code is not working for the new 18M2?

Eitan
 

srnet

Senior Member
So I wonder why isn't it a replacement, why the code is not working for the new 18M2?
probably because the author of the program decided to read and write to some of the PIC processors registers directly. This is allowed, but the PIC registers will often be in different places for different processors. Thus a program that peeks and pokes the registers on a 18X may not work on a 18M2.

The 18X used a PIC 16F88 which has a different register map to the 16F1827 used for the 18M2.
 

hippy

Ex-Staff (retired)
I read that 18x is old and no longer can be found and we need to move to 18M2 which is a replacement. so I wonder why isn't it a replacement, why the code is not working for the new 18M2?
As srnet says; because the code is written to do something specifically for the 18X which does not apply to the 18M2. Not only is the code manipulating on-chip registers, it is manipulating a register reserved for use by the PICAXE firmware to force it to do something that it is not otherwise designed to do. In this case to use one of the 'output only pins' as an input.

Use of that code makes the program as is PICAXE-18X only. The code can however be modified for the 18M2 because that doesn't have the same restrictions as the 18X did.
 
Top