Thanks from a 28X1 & Project PCB New User, for your help. Plus some ideas.....

Hi everyone here on the PICAXEForum, I want to write a letter of my experiences in the 1 st month or so with PICAXE. Also, I want to thank everyone here, both those that have already helped me and those who have not (as yet!).;)
I am using a PICAXE 28X1 chip in a 28 Pin project Board by the way.
As I have a background in computers, though the first one was in the 1960’s, but was only an onboard missile guidance system for RN Destroyers, about as big as a small house!!! I did imagine that after my almost 40 years work as a technical specialist and my programming knowledge, that I would find PICAXE easy. How wrong I was!!!!

I might agree that my age plays a role (I’m almost 68!)……

On looking back over this short time, I do notice that the supplied learning tools area little incomplete, but I do understand that it is a gargantuan job to get such Tutorials written and tested, and I do not mean that as a negative critique, more as a positive one, really!!

I worked through the easy stuff, making a LED blink etc., but I then found that the programs that I studied, for example, to read an RTC chip and display the time on an cheap 2004 type LCD display, were
fraught with problems, not of the PICAXE itself or even the programs I looked at were actually at fault, but the REMed comments were generally somewhere between bad and awful…. Very unhelpful.

Few of the programs (none that I have seen!) even put the PICAXE chip type in the program for which it was originally written! None mentioned which PICAXE pin should be connected to what pin on the LCD, except for a really good website (in NZ I think!), who not only correctly mentioned which PICAXE type it was written for, but also placed a correct schematic nearby and even mentioned in REMs which
connections should be made!! For beginners like myself FANTASTIC, I can only recommend the website of Technical Tutors:-
http://technologytutor.co.nz/introduction-to-electronics
Previously, all I had was Syntax Checking using the PICAXE Editor was one of the few ways to get things going.

May I make a request for the future to anyone placing PICAXE programs anywhere online for General usage that they adhere to at least the following requirements:-
1) Quote the exact PICAXE chip type that the program was written for in the format “#PICAXE 28X1” or similar for example.
2) That the program includes a REMed list of what each line is required to do, or be. Full details, especially Variables need to be carefully detailed how/why/what.
3) That the pin usage of the PICAXE is fully listed in REMs, no more guesswork!
4) A schematic is added, even for simple circuits.

I can say that the LCD examples in the PICAXE Manuals were more of a hindrance than a help, sorry, I took a long time to understand that.

The Chinese LCD display that I bought off ebay was cheap(!):-
a) not I2C as it actually said in the ebay ad. (Watch out for that, the seller is call “emall-foryou” (not my spelling error. It should have warned me!!). Leave him/her well alone. I asked for a schematic as they maintained that it was I2C compatible [its not!!] and got a dimension drawing, they haven’t a clue!!!)
b) Could have been defective, I could not prove it either way with my massive lack of knowledge.
c) Even the contrast control that I made could have been wrong!

But I did get it to work eventually and was able to place my full name 4 times on the screen!!! What a wonderful feeling!!!

I had already got a RTC readout program to work on I2C with the aid of several people here, but it was little of my own work.

Furthermore I have made some (I feel) useful changes to the 28 Pin Project Board, which may help
here, though maybe its already been done by some. I feel that they could be included on all
boards with only a small extra cost……
1) removed the 10k resistor pack and replaced it with a single line of chip sockets, now I can use the 10k resistors, or not, or change them for another is ever needed.
2) I will also remove the resonator and replace it with a 20Mhz. But I am going to also place three pins of an IC socket there to allow the resonator that I wish to be easily added or removed. I know that an external resonator is slightly more accurate than an internal, but I do not see that as a valid reason for having 4Mhz TWICE!!! I was appalled when I saw exactly what value it was!!
3) I see no reason as to why the bottom of the PCB has been cut to break the lands between the PICAXE chip and the ULN2803A Darlington driver chip. But other lands are in place on the component side. I managed
to fit a set of extra pins (similar to the output pins already used, but a single bank and far longer [ebay} so they are well above the top of the existing chips) in the set of holes left free between the PICAXE chip and the
Darlington Driver, which allows me now to be able to tap off the PICAXE “B” Port pins directly and not have to use the inverted signals of the driver chip!!! The soldering was a little difficult with my eyes, but it works really well.

I am interested in your thoughts on these areas.:mad:

Regards

Andy
 

hippy

Ex-Staff (retired)
Many thanks for the feedback and I am sure others will also have things to add and say.

You are absolutely correct that is is very helpful to have well documented projects, programs and circuits, to know which PICAXE is being used, which pins are used and what for. For our own documentation that can sometimes be a problem when creating generic examples which may be used with any number of PICAXE in any number of configurations. We have been updating examples and example code to better reflect the latest versions of PICAXE and we will continue to do that and improve things where we can. As you note it can be a bit of a gargantuan task.

For project boards it is always difficult to produce a board which does everything everyone might like without adding cost or making it difficult to use how it was originally intended to be used, and some boards may be easier to use or modify than others. We have upgraded some boards to make it easier to access pins directly and will continue to review boards as time goes on.

On the 4MHz resonator issue, I believe that may mainly be a hang-over from when 28-pin PICAXE's required a resonator, and 4MHz was chosen to match with other default operating speeds. Now all production PICAXE's can run from internal clocks I believe the plan is to not fit resonators or replace them with more useful values.
 

oracacle

Senior Member
i made a "jumper" ic from a ic socket by soldering some wire into the pin head to replace the darlington driver which leave the current pin header for use, handy if you set it up on a board with a couple of bread boards on either side and removed the pull down resistors on part c for testing I2C circuits. i replace my resinator with a 3 pin socket (cut from a 4 pins ic socket iirc) to make replacing the the resinator quick easy and painless.

it must be noted that i got the board when the 28A was the PICAXE that is was supplied with
 
Many thanks for the feedback and I am sure others will also have things to add and say.

You are absolutely correct that is is very helpful to have well documented projects, programs and circuits, to know which PICAXE is being used, which pins are used and what for. For our own documentation that can sometimes be a problem when creating generic examples which may be used with any number of PICAXE in any number of configurations. We have been updating examples and example code to better reflect the latest versions of PICAXE and we will continue to do that and improve things where we can. As you note it can be a bit of a gargantuan task.

For project boards it is always difficult to produce a board which does everything everyone might like without adding cost or making it difficult to use how it was originally intended to be used, and some boards may be easier to use or modify than others. We have upgraded some boards to make it easier to access pins directly and will continue to review boards as time goes on.

On the 4MHz resonator issue, I believe that may mainly be a hang-over from when 28-pin PICAXE's required a resonator, and 4MHz was chosen to match with other default operating speeds. Now all production PICAXE's can run from internal clocks I believe the plan is to not fit resonators or replace them with more useful values.
Dear Hippy. Many thanks for your rapid (as ever!!) reply. It appears that you have some good ideas of your own already. My PCB is stamped with a date of 202. The changes I made have helped me a lot and I would recommend anyone with a reasonable soldering ability to do for themselves.
I understand now that the 4Mhz resonator is a history "Hangover" that is also easy to fix if anyone is interested... though of course one MUST pay attention as to which 28 pin is to be used, I did everything for the X1 that I was using....which means that I will buy a 20Mhz resonator. They are REALLY cheap on ebay....as I said before, both these and the position of the resistor pack need to be replaced with a quality sockets.
I feel the most important change is the adding of pins to the set of holes between the PICAXE and the ULN Darlington driver chip, that allow the PICAXE signals to be taken directly off the chip itself as the inverted ones from the ULN chip are not useful in many situations....as I found out to my cost......Removing the ULN chip and pushing pins in the socket, only damages that socket.....
Thanks again Hippy.
Regards
Andy
PS. If anyone needs help and/or fotos, just ask.....
 

bryanl

Member
A lot of the suggestions are about good programming practice and using what has been provided. For instance, start every program with something like

Code:
#PICAXE 28X2
; #slot 0
; #no_data		; leave EEPROM alone
; #no_table		; leave EEPROM and Table alone
#REVISION 2		; see readrevision
; #Terminal 9600		; open monitor window after download
#REM
  name of project, description of function, dated list of revisions, etc
#ENDREM
The SYMBOL directive should be used to define all pins, ports, ADC channels with descriptions of purpose and function following that. The register usage should also be mapped out along with the usage of EEPROM, TABLE, and scratchpad memory

Making a habit of this sort of program header would go a long ways towards satisfying your comments. The problem you note is that such practice is often missing or poorly implemented.

I think a lot of confusion and redundancy could be reduced if a command were added that defined pin function. This would map chip pins to a particular function as you can find in, for example, the AXE401 manual on page 5. The command should define an alias for the pin (like SYMBOL), the hardware pin number, the function, and any options or arguments necessary for that function. It would set the appropriate port bits, ADC configuration bits, interupt flag bits or whatnot. The use of a command like this would go a long ways towards making it clear what is expected of an external interface, especially if appropriately commented. It might also help a lot with reducing confusion caused by the advance of technology in mcu's.

It's easy to see what might be and much tougher to really get a handle on just how much there actually is. It can be very frustrating working around bugs and things that aren't quite clear. -- sure can learn a lot, though ;-)
 

westaust55

Moderator
Hi everyone here on the PICAXEForum, I want to write a letter of my experiences in the 1 st month or so with PICAXE. Also, I want to thank everyone here, both those that have already helped me and those who have not (as yet!).;)



- Few of the programs (none that I have seen!) even put the PICAXE chip type in the program for which it was originally written!
-None mentioned which PICAXE pin should be connected to what pin on the LCD, except for a really good website (in NZ I think!), who not only correctly mentioned which PICAXE type it was written for,
- but also placed a correct schematic nearby and even mentioned in REMs which connections should be made!!

May I make a request for the future to anyone placing PICAXE programs anywhere online for General usage that they adhere to at least the following requirements:-
1) Quote the exact PICAXE chip type that the program was written for in the format “#PICAXE 28X1” or similar for example.
2) That the program includes a REMed list of what each line is required to do, or be. Full details, especially Variables need to be carefully detailed how/why/what.
3) That the pin usage of the PICAXE is fully listed in REMs, no more guesswork!
4) A schematic is added, even for simple circuits.


I am interested in your thoughts on these areas.

Regards

Andy
That is certainly not universally the case. Have you looked in the finished projects area?

Many (I will not claim all) of my projects/tutorials as posted in the finished projects area include schematics, code specific to various PICAXE chips (the PICAXE type in the title if not in the code header) and in some cases even proto board layouts and descriptions.

Here are just a few of my projects where most of the mentioned elements are provided/stated
(often the schematic is embedded in a pdf file):

http://www.picaxeforum.co.uk/showthread.php?13687-3-digit-display-using-74HC595
http://www.picaxeforum.co.uk/showthread.php?18678-PICAXE-based-Logic-IC-Tester
http://www.picaxeforum.co.uk/showthread.php?20186-Nokia-1100-amp-2280-gLCD-modules
http://www.picaxeforum.co.uk/showthread.php?22713-Getting-Started-with-the-WS2801-3-Channel-RGB-LED-Driver-with-PWM-output
http://www.picaxeforum.co.uk/showthread.php?23293-Getting-Started-with-the-MAX7219-Eight-Digit-7-Segment-LED-Driver

And a code only example (the PICAXE type used is stated):
http://www.picaxeforum.co.uk/showthread.php?19714-Calculate-Square-Root-to-two-decimal-places

http://www.picaxeforum.co.uk/showthread.php?23648-Getting-Started-with-the-PT6961-6-digit-12-segment-LED-driver-with30-key-switch-scan



3) That the pin usage of the PICAXE is fully listed in REMs, no more guesswork!
4) A schematic is added, even for simple circuits.
Something I aim for, but may not always achieve, is to avoid duplication.
If I provide a schematic there is no need to inducle pin conenciton details in REM's in the program listing.
Otherwise I (or you) must remember to alter in multiple locations/documents.

There are threads here dedicated to trying to:
- have folks ask questions supplying all the necessary information to avoid guess work,
- provide remarks in their code
- provide header information indicating PICAXE type, etc
But this all ultimately is lost and many do not take notice. Accordingly such goals are never achieve in many cases.
 
A lot of the suggestions are about good programming practice and using what has been provided. For instance, start every program with something like

Code:
#PICAXE 28X2
; #slot 0
; #no_data        ; leave EEPROM alone
; #no_table        ; leave EEPROM and Table alone
#REVISION 2        ; see readrevision
; #Terminal 9600        ; open monitor window after download
#REM
  name of project, description of function, dated list of revisions, etc
#ENDREM
The SYMBOL directive should be used to define all pins, ports, ADC channels with descriptions of purpose and function following that. The register usage should also be mapped out along with the usage of EEPROM, TABLE, and scratchpad memory

Making a habit of this sort of program header would go a long ways towards satisfying your comments. The problem you note is that such practice is often missing or poorly implemented.

I think a lot of confusion and redundancy could be reduced if a command were added that defined pin function. This would map chip pins to a particular function as you can find in, for example, the AXE401 manual on page 5. The command should define an alias for the pin (like SYMBOL), the hardware pin number, the function, and any options or arguments necessary for that function. It would set the appropriate port bits, ADC configuration bits, interupt flag bits or whatnot. The use of a command like this would go a long ways towards making it clear what is expected of an external interface, especially if appropriately commented. It might also help a lot with reducing confusion caused by the advance of technology in mcu's.

It's easy to see what might be and much tougher to really get a handle on just how much there actually is. It can be very frustrating working around bugs and things that aren't quite clear. -- sure can learn a lot, though ;-)
Good post, many thanks.
 
That is certainly not universally the case. Have you looked in the finished projects area?

Many (I will not claim all) of my projects/tutorials as posted in the finished projects area include schematics, code specific to various PICAXE chips (the PICAXE type in the title if not in the code header) and in some cases even proto board layouts and descriptions.

Here are just a few of my projects where most of the mentioned elements are provided/stated
(often the schematic is embedded in a pdf file):

http://www.picaxeforum.co.uk/showthread.php?13687-3-digit-display-using-74HC595
http://www.picaxeforum.co.uk/showthread.php?18678-PICAXE-based-Logic-IC-Tester
http://www.picaxeforum.co.uk/showthread.php?20186-Nokia-1100-amp-2280-gLCD-modules
http://www.picaxeforum.co.uk/showthread.php?22713-Getting-Started-with-the-WS2801-3-Channel-RGB-LED-Driver-with-PWM-output
http://www.picaxeforum.co.uk/showthread.php?23293-Getting-Started-with-the-MAX7219-Eight-Digit-7-Segment-LED-Driver

And a code only example (the PICAXE type used is stated):
http://www.picaxeforum.co.uk/showthread.php?19714-Calculate-Square-Root-to-two-decimal-places

http://www.picaxeforum.co.uk/showthread.php?23648-Getting-Started-with-the-PT6961-6-digit-12-segment-LED-driver-with30-key-switch-scan




Something I aim for, but may not always achieve, is to avoid duplication.
If I provide a schematic there is no need to inducle pin conenciton details in REM's in the program listing.
Otherwise I (or you) must remember to alter in multiple locations/documents.

There are threads here dedicated to trying to:
- have folks ask questions supplying all the necessary information to avoid guess work,
- provide remarks in their code
- provide header information indicating PICAXE type, etc
But this all ultimately is lost and many do not take notice. Accordingly such goals are never achieve in many cases.
Some good projects and ideas, Many thanks....
 

oracacle

Senior Member
i really dont think that adding extra pins to the board is necessary, iirc the servo upgrade pack come with an IC that contains 8 330ohm resistors to replace the darlington array, it maytbe possible to obtain some of these with 0ohm values, or simply insert a small length of wire into the IC socket accros the pins that are needed once the farlington IC has been removed.

i myselft have made these and easy swap out by soldering wires into a blank IC socket that stand in for either the darlingto or the 16 pin resistor package, i have 2, 8 pin sockets to cover all the outputs that i need.
 
In answer to Oracles comments.

i really dont think that adding extra pins to the board is necessary, iirc the servo upgrade pack come with an IC that contains 8 330ohm resistors to replace the darlington array, it maytbe possible to obtain some of these with 0ohm values, or simply insert a small length of wire into the IC socket accros the pins that are needed once the farlington IC has been removed.

i myselft have made these and easy swap out by soldering wires into a blank IC socket that stand in for either the darlingto or the 16 pin resistor package, i have 2, 8 pin sockets to cover all the outputs that i need.
Each to his own of course, that's part of the fun with PICAXE, we can all have our own opinions and "publish" them here if we wish.....

But did you really understand all the reasons why the changes are most probably a good idea for some users? I had hoped that I had detailed them clearly enough for anyone who would like to make such useful changes, Hippy appeared to like the possibilities as adding a few useful but cheap extras.....but I will try again for you:-

Removing the resistor pack and placing a row of turned IC sockets (quality ones) to allow any other value required to be inserted when needed, makes life far easier, but the most important part being that when communicating with I2C devices using the correct PICAXE pins, supported in BASIC, the soldered in Resistor pack stops all possibility of communicating with I2C devices!!

Maybe you have never used I2C devices with the 28 Pin Project board, but it took some good help from other PICAXEForum colleagues to point that out that problem with the resistor pack!! I was/am very grateful.

I will also eventually replace the 4Mhz resonator with 3 of the same socket pins as its pointless to have an internal 4 and 8Mhz resonator and an external 4Mhz. I will therefore be able to place any compatible resonator (they are REALLY CHEAP!) that I wish to have in that socket!

Up to 20Mhz for a 28X1 for example.....quite a speed increase over standard, though some older chips may still require the original resonator to work at all.....But for anyone more up to date than myself, a possible 64Mhz for X2 parts. So it would be rather a waste of possible performance only having the internal resonator or the old external 4 Mhz don't you think?

Furthermore, adding extra pins connected to the PICAXE B Port outputs directly, does two things, firstly it takes the ULN Darlingto inverter out of the circuit without the need to remove it physically (and would still allow inverted signals to be available if needed), and allows direct connection to the B Port pins with no inversion, which is needed for example when driving an LCD directly. As I found out the hard way!! This time without external help!!

I do not see personally another better way to do that, but if you know of one, be so kind as to mention it here as I am sure that others are also interested just as much as I will be. I can only say that I managed to interface successfully to an LCD once I had done that....not before, too complicated having to reverse all signals UGH!!

Don't take offense, but I would guess that you are probably not talking to I2C or driving directly an LCD for example, but none of these changes that I make stop the PCB working as it originally did, except possibly the resonator change if you throw the old 4Mhz one away!!!

I haven't driven any motors yet though!!

I did put some careful thought into the changes before making them....and publishing them here, though they may not be 100% perfect!!

But I am always willing to learn something new & useful, so if I have not fully understood your comments as they were intended, firstly my apologies and secondly, please detail the advantages for me and other users here clearly.

As you probably know, I am almost a complete Newbie with regard to PICAXE, though I have been in the computer support business for more than 40 years......hardware and software.

Thanks in advance Oracle and have a great day - in spite of me!!:cool:

Andy
 

srnet

Senior Member
I will also eventually replace the 4Mhz resonator with 3 of the same socket pins as its pointless to have an internal 4 and 8Mhz resonator and an external 4Mhz.
The external resonator would be used when you want to be sure any timing you do is more accurate and more temperature stable than is possible with the internal resonator. Fitting the resonator also has the side effect of cutting the sleep current a bit.

I did a PICAXE design that was fitted with a 2Mhz resonator, which since the PICAXE always runs at 4 times the resonator speed, meant it ran at 8Mhz, the same as the internal resonator. In this case it was important that the clock the PICAXE was using was stable over a wide temperature range.
 
Changing of the External Resonators to suit different versions of PICAXE chips.

The external resonator would be used when you want to be sure any timing you do is more accurate and more temperature stable than is possible with the internal resonator. Fitting the resonator also has the side effect of cutting the sleep current a bit.

I did a PICAXE design that was fitted with a 2Mhz resonator, which since the PICAXE always runs at 4 times the resonator speed, meant it ran at 8Mhz, the same as the internal resonator. In this case it was important that the clock the PICAXE was using was stable over a wide temperature range.
I agree entirely, I see as having the possibility to change the external (slightly more accurate as you said!) resonator as being simply super "Plug 'n Play".

This also means that also the PCB can be used (in my case at least!) for several different 28 pin PICKAXE chip versions, each with the correct external resonator. I would expect that to apply to other sizes of PICAXE Project boards, if needed.....Though I cannot say as to whether its "normal" to having different versions of chips in use at different times, but it would not surprise me if "older" PICAXE users need that flexibility!

If I buy new chips, they will be the latest (fastest) version I tend to think, with therefore a need for faster resonators....sometimes!

Thanks for your post.

Andy
 
Fotos - The Easy changes I made to the 28 Pin Project PCB to make it even more useful

The changes needed to make the 28 pin Project PCB even easier and more flexible to use, also making it possible to use it as an I2C Master with the 28X1 chips, are actually easy to do and a cheap upgrade.

In the picture, you can see "A, B and C". "A" is the three turned pins off a 40 pin strip that I soldered in place of the resonator to allow easy changing of the external resonator frequency with no further soldering. If you are only using early 28 Pin chips without an internal resonator, then simply leave this alone.

I am using older 28X1 chips with a 4 & 8 Mhz internal and up to a possible 20Mhz external resonator and having the older 4 Mhz external resonator permanently installed was basically a waste of time for me personally, though after de-soldering the original resonator, I stuck it back in for the foto showing how easy it now is to use....Resonators are REALLY cheap by the way!

I also had to remove the 10K resistor pack that runs ALMOST in line with that as this was preventing I2C working on pins 13 and 14....you need pullups (once only!) for I2C, not "pull downs". I soldered in a strip of pins off that same 40 pin strip to allow the original resistor pack in the socket if and when needed (watch the orientation by the way!!), just to show how flexible that is now.

I can now use I2C with no problems with the resistor pack removed. That was a big problem for me some weeks ago till I got some good help on this forum.

The last change I made was to solder a line of pins at "A" to allow access to the PICAXE output pins directly without going through the driver chip which also reverses the signals. Mine are a bit long, but are stable and easy to use, so as I can access the output pins of the PICAXE chip and also have access to the reversed driver outputs at the same time....very useful!

If you have any queries just drop me a line. But it really is as simple as it looks....

If your soldering skills are poor, get someone to do it for you. If you do not have access to a proper de-solder gun, then cut the resonator and the resistor pack into 3 and 9 pieces with a single leg and remove each one individually with the normal soldering iron, then buy new parts. Not doing this may cause damage to the PCB if trying to remove them whole. You have been warned.....

The second picture shows the one of the type of pins I added (not the turned sockets ones) and the two types of wire connectors I use to connect between the Project PCB and a Breadboard. One is male both ends and the other is male one end and female on the other. All bought from ebay....

Regards

Andy
 

Attachments

Top