Upload circuit works for 40X1, however not 40X2

DrDunk

New Member
Hello All,

Hopefully someone wise out there can help me. I am able to upload a program to a 40X1 chip, using my circuit, however I wanted to place a 40X2 in there instead now. The issue is that it will recognise that I have the 40X2 installed (via the Options menu, check firmware, of the Programme Editor software) however fails when I try to upload the program and gives a series of reasons why it may not work, including a floating rest pin, issue with power to the chip, etc.

My issue is that it does work for the 40X1, however when I swap out for a 40X2 it doesn't!

Am i missing something simple here? I checked the pin out diagrams, and all seems to coincide (Serial In, Serial out, V+, 0 V)

Thanks in advance!
Duncan
 

DrDunk

New Member
Sorry, I realise that I should have provided a bit more information.

I have tried multiple 40X2 chips that I had purchased, and none work.
I put back in the 40X1 after trying to download a program to the 40X2 - a program uploaded without an issue to the 40X1.

I also have an 18M2 chip which I was able to program to, without issue, which indicates that the computer/USB-Serial adapter work fine.
 

OLDmarty

Senior Member
1) Can we assume you're selecting the 40X2 chip "type" in the picaxe editor/programmer?

2) did you edit your code to use "#PICAXE 40X2" instead of the 40X1 definition?

3) Are you certain the 40X2 is plugged into the circuit the correct way around etc?

Sorry, i had to ask, because these little things catch all of us, sooner or later. ;-)

Did you buy the 40X2's from some chinese ebay outlet? they'll just be blank chip bodies ;-(
Hopefully you got your 40X2's from a legitimate Picaxe reseller.
 

DrDunk

New Member
HI Oldmarty,

Thanks so much for your reply, and for suggesting the possible checks..

1) Can we assume you're selecting the 40X2 chip "type" in the picaxe editor/programmer?

You can assume this! I selected it in the options.

2) did you edit your code to use "#PICAXE 40X2" instead of the 40X1 definition?

I did indeed! I had two programs, one written for 40X1 and another that I had updated for 40X2. Syntax checks passed for both

3) Are you certain the 40X2 is plugged into the circuit the correct way around etc?

Good point! I checked that a few times, and ensured that it was plugged in the same way as I had for the 40X1. On this point, the program editor picks up that I have a 40X2 on the board, via the serial connection.. It is when I come to download the program that it doesn't work..

Lastly, I had bought the chips from Altronics here in Perth, WA, Australia!

Thanks again for your reply!

I am about to breadboard the chip to see if I can communicate with it that way. Will report back if this works.
 

OLDmarty

Senior Member
No probs, as i said "i had to ask".

Altronics chips will be fine, i used to get mine in Victoria/Altronics.

- Do you definitely have pin1 held high via a 4k7 resistor to keep it running?
- Do you definitely have +5volts on pins 11 & 32?
- Do you definitely have 0volts on pins 12 & 31?

- Do you have anything else (another chip or a LED) connected on your serial program pins 6 & 7? (remove anything else, until you can program the chip)

- Do you have an external Crystal or resonator attached?, if so, remove it and let the chip run on it's internal clock to prove things.

Clearly, you've proven your programming cable and everything works with your other chips.
Are you using exactly the same programming socket/board on the breadboard that the 'working' chips were using?
You need to rule out any kind of stupid 3.5mm socket that's not pinned out as you expect, or something sneaky like that.

I'm simply listing everything i would check if my proto-project didn't work lol ;-)
Hope it helps...
 

OLDmarty

Senior Member
At worst case, you could take the 40X2's to Altronics and ask the techy to attempt to program the chip on the counter (they usually have breadboards setup to program displays on their counter etc).

If you want, you can mail me a chip or 2 (i'm in Victoria) and i can prove if they program or not and send them back.
Hopefully you know someone more local to you, that can can help out.
 

inglewoodpete

Senior Member
Next question... what are you using to power the 40X2? If batteries, try fresh ones.

And, as young Marty asks: "Are you using the same circuit bed (board/breadboard) to run both the 40X1 and 40X2?"
 

OLDmarty

Senior Member
As an afterthought DrDunk,

Can you start a fresh clean code page to prove any coding conflicts between your 40X1 & 40X2 coding.

Add something simple in the code, like the following:

Code:
#PICAXE 40X2

main:    high B.1    ; switch on output B.1
    pause 1000        ; wait 1 second
    low B.1               ; switch off output B.1
    pause 1000        ; wait 1 second
    goto main         ; loop back to start
.... and re-attempt to program it into the 40X2....


Also, what version of picaxe editor are you using? is it the latest v6.1.0.0 ????
 

OLDmarty

Senior Member
Oh yeh, maybe you're getting no power because of a break in the breadboard power rails.

I've found the power rails on the edge of the breadboard (marked red & blue) don't always continue along the entire length of the rails.
On some brands of breadboard, there is a break in the centre (see yellow circles i marked out).

This means if you have power entering at one end, and your chip(s) plugged in towards the other end, then the chips won't have any power until the centre of the rails are jumpered together.

23234
 

hippy

Technical Support
Staff member
The issue is that it will recognise that I have the 40X2 installed (via the Options menu, check firmware, of the Programme Editor software)
If the Check Firmware option is working, that means PE6 can communicate with the 40X2 via the AXE027 and your circuit and the 40X2 is responding as expected.

If Check Firmware works but Program (Download) doesn't it may be because the 40X2 is running its production line test program which should be outputting it's "Hello I'm your PICAXE-40X2" or something like that.

If you simply open Terminal within PE6 and select 9600 baud does it show anything ? If it shows 'garbage' then try different baud rates to see if that makes things readable.

We would recommend trying that just to help determine what the problem may have been because that opportunity will be lost once you do come to program the chip.

Regardless of what the results are there, because Check Firmware works, you should be able to program the 40X2 using a Hard Reset procedure - Turn power off, leave a few seconds, initiate the download, then, a second or so later, turn power back on. The download should complete.

If you have a Reset Button fitted; you can press and hold that instead of turning off power, release it that second after initiating download.
 

DrDunk

New Member
As an afterthought DrDunk,

Can you start a fresh clean code page to prove any coding conflicts between your 40X1 & 40X2 coding.

Add something simple in the code, like the following:

Code:
#PICAXE 40X2

main:    high B.1    ; switch on output B.1
    pause 1000        ; wait 1 second
    low B.1               ; switch off output B.1
    pause 1000        ; wait 1 second
    goto main         ; loop back to start
.... and re-attempt to program it into the 40X2....


Also, what version of picaxe editor are you using? is it the latest v6.1.0.0 ????
Oh dear... I may very well have been using the older version of the program... If this is it, then I humbly apologise and will hand back my amateur programmers card. That might make sense why it worked for the 40X1 and not the 40X2?

Will test Monday morning when I return to the lab!
 

OLDmarty

Senior Member
Oh dear... I may very well have been using the older version of the program... If this is it, then I humbly apologise and will hand back my amateur programmers card. That might make sense why it worked for the 40X1 and not the 40X2?

Will test Monday morning when I return to the lab!
Well, i hope (in a way) it's simply and old editor letting you down.
Hopefully on Monday we'll all know the answer.

In the meantime, the responses in this post alone should become the absolute bible of checkpoints for anyone suffering "my project doesn't program/work" ;-)
 

DrDunk

New Member
Well, i hope (in a way) it's simply and old editor letting you down.
Hopefully on Monday we'll all know the answer.

In the meantime, the responses in this post alone should become the absolute bible of checkpoints for anyone suffering "my project doesn't program/work" ;-)
Too true! I am loving the enthusiasm of the people on the forum, thank you so much for the quick answers!
(I was using the 5.5.5 software version...)
 

hippy

Technical Support
Staff member
I was using the 5.5.5 software version...
Though we would recommend using PE6, that 5.5.5 version is just one away from the last PE5 release and does support the 40X2. We would not put the issue down to the software being used.

PE6 is installed alongside PE5, allowing both or either to be used. It's not an 'upgrade and lose what you had' affair.
 
Top