40x2 programing problem

Randy5140

Member
I am having difficulties getting my picaxe 40x2 to program.

Below is I will try to explain the problem I am experiencing and also my setup/hardware, hoping this might help.

Any Ideas would be greatly appreciated!


I purchased an rkp40c and 40x2 chip about a month ago.

Received the rkp40c and assembled it following the information in its pdf

After assembly I checked each connection following the schematic just to be sure everything was correct. (Everything checked ok)

I installed the picaxe program editor and also the Logicator software as I am\was not sure which I would use

I downloaded and installed the drivers for the axe070 cable

Put the chip into the rkp40c, inserted the cable, software found cable, connected cable to rkp40c.

Selected the 40x2 chip in Program Editor and also selected the correct com port from the options setting.

Typed the Led program (from the manual 1) simulated it then pushed program.

Got error message saying “could not connect to hardware”,

I keep getting the same message.

Oh did try doing "reset" several times,, (don’t know if it worked,, I do know the connections to the reset pin are correct, verified from schematic in PDF.

I have tested the cable using "terminal" and putting a paperclip on the phone jack,, checked ok,, everything I typed was sent and received in the other text box

Under Options, I did the "test port" at pin 6 I get 0.0v and after clicking the led it jumps to 4.58

I have checked for power and ground at the chip,, 4.58 v at pin 11 and 32, 0v (ground) at pins 12 and 31.

all resistors are in correct position and values checks ok

I am using a computer power supply for chip power. Using the +5v tap. (Same one I use to power my Vixen Christmas light and servo boards)

I have also tried two different computers, one laptop running windows 7 and the other a PC running XP Pro. SP3 (with all current updates)



Thanks
Randy
 

Bill.b

Senior Member
Hi Randy

Have you tried a power reset?

remove power from the picaxe, select download from PE,
apply power to the picaxe while the download bargraph is on screen.

The picaxe chips always check for a download at power up. This has got me out of
trouble when I have had difficulty downloading.

Bill
 

Randy5140

Member
Bill,

Yes have tried a power reset.

also I have tried three different New chips.

this is so wierd. I just cant figure it out!

I chip was ordered from UK and two were from here in USA.

Randy
 

inglewoodpete

Senior Member
It is a very rare PICAXE chip that is faulty on delivery. They are pretty tough critters, even when mistreated (don't ask me how I know :)). To program the chip you need a dowload path and a return (feedback) data path. I think you have proven that the download path is good.

If the PICAXE chips have never been programmed (by you) before, then they should be outputting a message (something like "I am your new PICAXE 40X2" or similar) on the Serial Out pin (leg 7 of the 40X2).

To test the return data path on a new PICAXE, open the Programming Editor and press the <F8> key. The serial terminal window will open. Select 9600 baud, and after ensuring that the PICAXE is powered up and connected to the programming cable, you sould see the "I am your PICAXE..." message in the terminal window. If the message does not appear in the terminal window, you know the problem is in the return data path. If you have a spare LED and resistor (anything between 220 ohms and 1.5k ohms will do) and a couple of pieces of thin flex wire, you can use that as a simple logic probe to trace the return data path. Start by connecting the cathode side of the led (the flat edge) to 0v and use the other wire on leg 7 of the chip. Does the LED flicker? If so, does the centre pin on the programming socket work too?
 

Technical

Technical Support
Staff member
I am using a computer power supply for chip power. Using the +5v tap. (Same one I use to power my Vixen Christmas light and servo boards)
These power supplies often won't regulate correctly with the (very small) PICAXE current draw and are often very noisy - try instead with 3xAA batteries whilst troubleshooting.
 

Randy5140

Member
OK,, I changed the power supply to batteries. none of the three chips I have will program.

I opened Programming Editor, pressed F8, set terminal to 9600 baud, with two chips I recieved nothing with one chip I recieved a bunch of symbols looked like garbage to me,, but probably was some type of code,, lot of what looked like PI signs.

I went ahead and wired up a diode like you described, connected it to ground.

On one chip I got nothing from leg 7, from one chip I got a few unevenly spaced blinks then nothing and on the third chip, the one that displayed the garbage/code in terminal I got evenly spaced flashes that continued as long as I held the probe end against the leg.

OH,, also on the third chip,, the center pin on the programing socket caused the led to flash

Now,, having the third chip actually put something in the terminal and it flashing the led (I am guessing like is should) I thought I would try to program it.

I wrote the code for the LED program in Manual 1 and clicked program,, the bargraph appeared,, then the dreded cannot connect to hardware error appeared!

bout ready to chuck the whole thing and go back to steam power! :)

Any Ideas? I have one chip left and I am afraid to put it in the socket

Randy
 

inglewoodpete

Senior Member
I do understand your frustration. When you have never seen one work, you wonder if the whole concept is flakey. Not the case in my experience over the last 7 years.

Firstly, the easiest way to check the programming link is the do a Firmware Check from the Programming Editor. No need to write test programs at this point.

The results suggest that there is either a dry soldering joint on the board or the programming lead is faulty. I know you have said that you have run a successful loopback test with the cable but there have been cases of wires not being properly secured inside the phono plug. This will show up in some positions but be OK in others.

Unless the PICAXE chips have been stressed with overvoltage or reverse voltage connection, they are unlikely to be damaged. From my experience of over 100 PICAXE chips, I have never had one fail without good reason.
 

westaust55

Moderator
OK,, I changed the power supply to batteries. none of the three chips I have will program.
Even with batteries there can be problems if the batteries are not in a fairly healthy state of charge.

Can you perform a firmware test using the Programming Editor through the Options menu button?
If the firmware test works but you cannot download a program, many before you have found that replacing the batteries with three fresh new batteries has solved the problems.
 

Randy5140

Member
inglewoodpete and westaust,

I did try the firware check multiple times with no avail

the batteries are brand new,, fresh Duracells. AAA size.

got any ideas on why i get "garbled" (for the lack of a better term) information in the terminal? I am beginning to think that the programming cable is (as you suggested) bad or at least faulty at times.

I know you folks dont know me yet,, but just for information sake,, the next paragraph will give you some info on me. (just trying to keep you from thinking I am a complete dummy on this stuff)

While the picaxe system is new to me,, I have messed around with PICs before. I have been doing "programmed" Christmas lights and also halloween decorations for a few years now working with Vixen software and using the Renard deisgn boards (16f688 chips) programing them and changing the build so that different pins output different types of information, (like 4 for servo and 4 for light dimming) also been using Xbee to send the signals from the computer to the boards thus getting away from the Cat5 cable running all over the house and yard. I have been working with servos on the system too. (last halloween I did Priates of Price Rd,, skeleton pirates with a "fireing cannon" to shoot at the visitors with lights and smoke out the barrel.) It was quite well recieved by all.

I also do a little messing around in Visual Basic writing programs for here at work and for fun with my main hobby Radio Control. (www.alien-aircraft.com) see the Jenny Video. Shes a bute!

back the the picaxe,, how about if I were to make a regular serial cable up and try that,,, well at least that would eliminate the data cable from the equation. I think I saw a "shematic" somewhere in the documentation on the pinouts for one. I will look and see if I can find it again.

Also on the power supply last night I did build up a small board from the schematic (think it was in manual 1) for a power supply using a walwart using the appropriate caps and a 7805L vreg. then powered it with a 12v walwart supply. (didnt make any difference)


any ideas?

Randy
 

Randy5140

Member
PHONE JACK.jpg

Just had another thought,, last night, I did some probing on the rkp40c.


on the phone jack connections. when no plug is inserted into the jack, pins G and E (see the inserted pdf) are connected directly to gnd (0v)

when the plug ( I happened to have an unused plug) is inserted into the jack, only G is connected to gnd (0v).

is this correct and if so doesnt that mean that the plug is not connected to the board gnd?

this sounds wrong as when I have worked with my other boards I always needed to be sure the (programing) computer shared ground with the boards.


Any ideas?

randy
 

bfgstew

Senior Member
Have you got your download circuit wired correctly? See manual 1 for download schematic.

G and E are linked, so is F and D. put a dab of solder across both of them.
 

Randy5140

Member
eclectic,

no,, it was on my other computer at home,,

it was a bunch of symbols, like the PI sign letter with colons over the top of them. like what you see if you try to open a,, well jpeg in a text editor.

Randy
 

Randy5140

Member
bfgstew,

that sounds like that may be the problem,, on the board they have seperate solder connections,, the only time both are connected to ground is when no plug is in the jack when the plug is inserted it opens the internal contact and the end contact on the plug is not grounded to the board. There was no info on the PDF for the rkp40c about jumpering them together.

Randy
 

Randy5140

Member
bfgstew,

the only exception to the schematic is like I stated before, when the plug is inserted into the jack (referencing the schematic in manual 1) connection C is not grounded, there is no bridge/connection between the two solder points related to the end of the plug (c)

with no plug inserted, both solder points are connected to board ground (0v)

When a plug is inserted, the internal contact opens and the connection against the plug end (c) is open/floating.

in the schematic (drawing) in the manual on page 44 is does appear that there is a connection between the two pins (G and E on my drawing)

And One Between (F and D on my drawing)

if this is correct, then a solder bridge between (G and E) and one between (F and D) might solve the problem.

Please let me know if this is correct.

Randy
 

hippy

Ex-Staff (retired)
when no plug is inserted into the jack, pins G and E are connected directly to gnd (0v)

when the plug is inserted into the jack, only G is connected to gnd (0v).

is this correct
This is correct.

G is the 0V connection to the circuit. That will connect to the 0V of the cable when plugged in.

E connects to G when the cable is not plugged in, E becomes floating when the cable is plugged in.

Pins E and G pins may be soldered together but not having E connected should not usually be a problem. If E is just a solder pad there should nothing to worry about, soldering the two pins together should not be necessary but you can try it anyway. If there is tracking to E it would be worth posting a photograph of the tracking or a datasheet which shows that.

There was an issue with RKP 8-pin boards where tracks were not fully connected together on a board which caused problems so perhaps worth checking for 0V continuity around the board and proving a photo and/or datasheet anyway -

http://www.picaxeforum.co.uk/showthread.php?16186-hardware-not-connected&p=143630&viewfull=1#post143630
 
Last edited:

Randy5140

Member
I have traced all the tracks on the board and then did a shematic and a pcb in express pcb.

I think everything is correct, is it ok to post a copy of my what I have done on here so someone else might be able to check it?

(not real familiar with this forums policies)

Randy
 

Hemi345

Senior Member
back the the picaxe,, how about if I were to make a regular serial cable up and try that,,, well at least that would eliminate the data cable from the equation. I think I saw a "shematic" somewhere in the documentation on the pinouts for one. I will look and see if I can find it again.

Randy
This is what I'd do (and still do). Take a look at Manual 1, page 44.

Do you have a breadboard? If so, I'd put the 40X2 on it using page 40 as a guide for minimum connections and test.
 

Hemi345

Senior Member
I have traced all the tracks on the board and then did a shematic and a pcb in express pcb.

I think everything is correct, is it ok to post a copy of my what I have done on here so someone else might be able to check it?

(not real familiar with this forums policies)

Randy
If you used Eagle for the design, I'd be willing to take a look at the schematic/board files.

Opps, you said you used Express PCB's software.
 

Randy5140

Member
ok,,

did the pcb in express pcb then had to walk it thru as a pdf then convert to jpg.

the image is not the greatest,, but I think it clear enough to decipher.


(forgot) I added the screw terminals at each leg incase I ever make one I would have easy connections to use.

Randy


added a print screen from express pcb to get a better pic.


(removed incorrect pcb drawings_
 
Last edited:

Hemi345

Senior Member
I once had a spotty connection that caused the chip to continuously reboot and saw garbage in the serial terminal window. Maybe double check the connections for the reset pin.
 

Randy5140

Member
I once had a spotty connection that caused the chip to continuously reboot and saw garbage in the serial terminal window. Maybe double check the connections for the reset pin.
I did that once, but will recheck again,

rebooting could be going on as when the terminal window was open, the screen showing the garbage just continued to add symbols,, didnt stop!
 

Randy5140

Member
I redrew the connections that were traced from the rkp40 into express pcb

I did this so I could see the connections as the board is covered in black and very hard to see traces.

the pic i posted simply represents the connections on the rkp40 board.


to post a picture of the rkp40 board would not show you anything.

sorry if I didnt make it clear when posting.

tonight when I get home I will take a picture of the rkp40c board and post it,, although I dont think it will do any good.
 

hippy

Ex-Staff (retired)
I redrew the connections that were traced from the rkp40 into express pcb
Okay; I think can understand what you have done.

I would double check the reset button / PICAXE leg 1 tracking because if it is how your diagram shows then the board probably won't work or won't work reliably. You have leg 1 to a pull down R to 0V and that R should be a pull-up going to +V. The reset button is correct ( shorts to 0V when pushed ) and the rest of the tracking looks okay.
 

Randy5140

Member
Well spotted Hippy.

hippy,

OK,, I will check the rkp40 when I get home.

I went ahead and changed the express pcb to reflect the correction.


whoever is capable to do so you might remove the previous pcb pic so no one would mistakenably make one from it. (figured out how to do it myself:) )

picaxehomebrew CORRECTED RESET.jpg
 
Last edited:

Randy5140

Member
Yep, solder them together.

Hey,, went home,, fired up the iron,, soldered em,,

FIXED IT!!!!!!!!!!!!!!!


First thing I did was check the chip type and it came back correctly.

next pushed F8 terminal poped up with "Hello, I am your Picaxe 40x2"

Next did the quick start Led blink program,, Worked OK!

So, since I now have 4 chips,, and over this process I had each one of them in the rkp40 at one time or another,,, I thought I would,, just for the heck of it,, check them to see if any had survived,,

Well we need to change the name of the chips,,,

to timex,, they take a licking and keep on ticking!

yep all 4 chips worked!

programed them, ran the LED program fine.


I really want to thank all of you who offered you time to help me out!

You all are GREAT!

Hopefully,,, someday,, I will be able to help someone out with a problem too!

Until then,, "just learning"


Cant thank you all enough!
 

inglewoodpete

Senior Member
Whoo hoo! What a team!

Good to see your persistence paid off. Happy PICAXEing. You should find it quicker and easier than working with raw PICs.
 
Top