Picaxe 6 editor and 20m picaxe

Garahbara

New Member
Hi all,

I found 5 M20 chips in my box of goodies today, On the chip it says PIC16F677. In the Picaxe 6 editor it identifies them as 20M. (Check PICAXE Type Connected) However try and program them, and it says chip not supported, and 20M is not on the PICAXE Type drop-down list.

Is there anything I can do?

Thanks,

Alan.

TOOT!
 

premelec

Senior Member
20M seems to be recognized in editor 5.5.6 that I have [doesn't choke on syntax at least...] - so try the old editor...
 

Flenser

Senior Member
The PICAXE type pull-down list only shows a subset of the chips by default.
Go to File->Options->Compiler to add the older 20M chip to your pull down list in PE6.
 

Garahbara

New Member
The PICAXE type pull-down list only shows a subset of the chips by default.
Go to File->Options->Compiler to add the older 20M chip to your pull down list in PE6.

Brilliant! Thanks for that. :geek: Not that I'm about to use them for anything, but the entire train signalling system (in my other thread) is built using them.

"Those that think they know it all, annoy those of us that do" - me
"If at first you don't succeed, use a larger hammer" - that was me too.
 

lbenson

Senior Member
The 20M is a good chip, though without enough code space to support very much complication in the way of driving or reading all the individual pins available, but it should be fine for the signal crossing code--the pan and tilt mechanism for my rivercam is controlled by an 08M.
 

Garahbara

New Member
The 20M is a good chip, though without enough code space
Yeah. Tell me about it! 😵 I had to do some pretty tricky code for that signalling system to get it to fit on the 20M, with about 2 bytes to spare. I'll be using a 40X2 for the main train detetction system for the level crossing with at least 12 LDRs connected. 3 tracks, bi directional. It's not just a matter of turning the gates/lights on when it detects a train, then turing them off 10 seconds later, (whether the train has fully gone past or not) like some of the "commercially" supplied ones do.

It's more complex than you may think. Have a think about it, how you would code it, to cater for all directions, with multiple trains, in either direction, on 3 tracks, entering and leaving the "detection zones" concurrently. I'm glad I've got the 4096 bytes of the 40X2, rather then the 256 bytes of the 20M.

For those that are "programming logic" minded, some things to think about.
1. You need to detect the entire train has left the detection zone.
2. The train may be longer than the detection zone
3. Another train may be following, and enter the detection zone before the one in front has left the detection zone.
4. An east bound train is not to trigger the west bound "detection zone" triggers.
....... and more.
then there's 3 tracks of this.

This one is going to take me a while to code and test and get it right.

The light flashing, gate raising/lowering bell ringing is already done. (manually tiggered), even to the extent that it will immediately begin lowering the gates again, (on being triggered) even if the gates are in the process of being raised.

Alan

TOOT!
 

AllyCat

Senior Member
Hi,

Yes, 256 bytes is quite restrictive, although it's often the "User Interface" (menus and general Text formatting, etc.) that uses up lots of bytes. And of course the PE's "Pre-defined macros" such as BINTOASCII, PWMDUTY, SWAP and many more. ;)

Personally, I'd probably try to make use of PICaxe's overlayed Bit / Byte / Word variables data structure. Thus you could set up 8 (or even 16) "status" flags and then test them all with a single IF b1 > 0 THEN ... (or w1). Perhaps even consider the "weight" of the flags within the byte(s) and you can do more refined detection such as for example: IF b1 >15 THEN ... to ignore some flags and include others.

Of course with M2s, only b0 - b3 are directly bit-addressable, but I believe that X2s have more sophisticated bit-addressing instructions. However, these are of the "PE pre-defined Macro" type, so they don't do anything that can't be done with normal program logic (mask) instructions, and you might find that the Program space fills up faster than expected. :)

Cheers, Alan.
 

Garahbara

New Member
I'd probably try to make use of PICaxe's overlayed Bit / Byte / Word variables data structure.
Can't really remember now. it was a while ago, and the code is on a laptop I haven't cranked up for years. But I had to do something like that, as well as a lot of "dynamic" reusable code. As well as some very inventive use of "interrupt". I'll have to dig it out and have a look at it again one of these days.

Alan.

TOOT!
 
Top