Hardware not found!

RNovember

Well-known member
#1
Hi, I am very new to picaxe, and have just recieved my first chips. But when I tried to program them, there was a dialog box that said "Hardware not found".
I am using PE6, on windows ten, and I am using a homemade programing cable connected to the serial port.

I have checked my breadboard setup, and also checked my cable to see if I built it wrong, but I don't see anything.
If anyone has an idea, I am open for suggestions.
 

Flenser

Senior Member
#2
If you can post a picture of your breadboard setup it will allow people to inspect it. All you need connected are power, ground, SERIN with the download circuit resistors and SEROUT.
Which chip are you using in your breadboard?
As you are using a homemade programming cable measure the voltage between ground and the SERIN and SEROUT pins when you are _not_ doing any download so that we can check these.
 
#3
If you can post a picture of your breadboard setup it will allow people to inspect it. All you need connected are power, ground, SERIN with the download circuit resistors and SEROUT.
Which chip are you using in your breadboard?
I agree with Flenser - it is difficult to diagnose a fault with so little information.

Some things you could try for yourself. If the PICAXE is new and has never been programmed it will output (something like) "I am your PICAXE 08M2" or whatever model you are using. To detect this, open Programming Editor 6 and press <F8> to open the PE6 Terminal. With data speed set to 4800 (M2 chips) or 9600 (X2 chips) and the PICAXE powered up with the serial cable connected, your should see that messaged repeated on your screen. That will prove the return path PICAXE ---> PE6.

If the return path is working, I suggest that you go to PE6's Workspace Explorer>Options(Spanner icon)>Com Port>Test Download Cable and follow the instructions there.
 

RNovember

Well-known member
#4
Hi,
I am using a picaxe 08m2 chip, and it has never been programmed before.
I will try to get a picture of my circuit by this afternoon.
The computor I am using is password protected, and I don't know the password, so I won't be able to test anything out until after school.
I have seen this problem with the hardware not found elsewhere on the forum, but in every case, they were using the AXE027 cable. In fact, in some cases, once they tried to use the serial cable, it worked. I started out with this cable, and it hasn't worked from the beginning.

Thanks,
RNovember

Edit
I think that as I was trying to get the chip working, I might have done a hard reset. So it might not say "I am your PICAXE 08M2" anyway.
 

hippy

Technical Support
Staff member
#5
I think that as I was trying to get the chip working, I might have done a hard reset. So it might not say "I am your PICAXE 08M2" anyway
A hard reset should not have erased the 'welcome' message, only getting past "hardware not found" would do that.

The most likely cause of the problem, other than the more obvious like not having selected the correct COM port, not plugging things in, or not turning the PICAXE on, is a simple mis-wiring or a dodgy connection, having not used the correct wiring for the home-made serial cable, or a mistake in the download circuitry for the PICAXE.

Plugging a 3.5mm jack socket directly into a breadboard can be very unreliable if that's how you are connecting. The socket's pins are smaller than the breadboard holes so may not make a connection. It is easier to use the AXE029 breadboard adapter or to connect flying leads to the socket if building your own. The 'ring' of the socket and plug isn't 0V as it is with headphones and microphones which can also catch people out.

Photos of your download cable and the breadboard setup will enable members to check if they look right.
 

RNovember

Well-known member
#6
Hello,
I took a picture of the breadboard setup, and here it is.

The green jumper wires are serial in, and the yellow ones are serial out. Blue wires are ground.
Thanks.
 

RNovember

Well-known member
#11
Okay, I think that worked. Here is a picture from a different angle.
breadboard2.PNG
As I said before, yellow is serout, green is serin, and blue is ground.
 
Last edited:

lbenson

Senior Member
#12
Can't see anything wrong with your breadboard wiring. What's at the other end of your Blue-Green-Yellow cable?

What does Device Manager report as the COM port?

If the other end of your three wires is a USB serial module, is it idle-high or idle-low? Most USB/serial modules that I know of support idle-high, but the picaxe requires idle-low. If yours is idle-high, you would need to invert the TX and RX signals.

Does your cable have RS232 or TTL level voltages? Does it support BREAK, which the picaxe requires?
 

RNovember

Well-known member
#13
At the other end of the blue green yellow cable is the 9 holed serial plug. I made it from scratch by cutting one end off a serial cable, and then I used my DMM to test for continuity between holes 2, 3, and 5, and the wires out the end. I then used the wires that connected to the right holes for serin, serout, and ground.

I think I am using the right COM port because I hooked an LED up to it, and when it was searching for hardware, the LED lit up.

I do not know what RS232 is, as with if it supports BREAK.
 

lbenson

Senior Member
#14
Does your serial cable (with a 9-pin DB9 connector) plug directly into the PC or does it plug into a usb/serial module? It's been a long time since I had a laptop with an actual serial port.

If the cable you cut had a DB9 connector on it, then it most likely uses RS232 voltage levels instead of TTL--that is, instead of logic levels of 0V and 5V, it has a greater range--traditionally around +15V and -15V, though in many instances now in a range from +/- 7V up to the traditional +/- 15V. This cable is almost certain to idle low, and that is correct for your PICAXE connection. It is also very likely to support the BREAK signal which is used to initiate a download. (The "RS232" voltage level is the reason you need the 22K resistor which you have--it protects the nominally 5V PICAXE from the higher voltage by limiting the current.)

Have you tried reversing the serial-in and serial-out lines? It's easy to mix up RX and TX.

To test that you have the right COM port and that the wires have continuity, you could do a "loopback test". Plug your green and yellow wires into the same row on the breadboard, not connected to anything else. Then open a serial terminal on the PC (the PE6 terminal or, for instance, putty) for the COM port. Anything you type should be visible in the terminal (because you have "looped back" the PC TX to the PC RX).
 
#15
1. With a LED+Resistor between Leg 8 (0v) and Leg 1 (+ve), does the LED light? (Cathode pin of LED, closest to the flat side on 0v)

2. With the LED+Resistor between 0v (Leg 8) and Leg 2 (SerIn) of the 08M2, does it light when you try to Check PICAXE Type or download to the chip?
 

RNovember

Well-known member
#16
To answer Ibenson first, the cable plugs directly into the PC. I do have the 22K resistor. I tried swapping serin and serout with no result. I also didn't get any result from the loopback test.

Now to answer inglewoodpete. The LED does light in the first test. The LED in the second test flashes once when I first click program, and then as soon as the Hardware not found box pops up, it starts flashing 2 HZ, ~10% duty cycle, although it isn't very bright.
 
Last edited:

RNovember

Well-known member
#17
Hello,
I solved the problem! It seems that my serial cables pins are backwards. After doing the loopback test, I decided to see if there an LED would flicker if I connected it between serin and serout and did the test. It didn't. So I connected the LED between the serin and ground. I did the test, and the LED flickered. I thought maybe I had lost connection on the serout part of the cable. I tested it, and it was fine. Then on a sudden whim, I thought that maybe the serout was conected to the wrong wire on the cable. I switched the serout from pin 2 to pin 4, and the loopback test worked!

I then tried to download a program. It still failed. I then thought that because the serout had been swapped, maybe the ground did to. I switched the ground from pin 5 to pin 1 and I was able to download a program. As I said before, my cable is backwards!

Thank you all for your input. Sorry for the miss information about my serial cable being correct.
RNovember
 

lbenson

Senior Member
#19
Glad you got it working, and IP is right--good skills in tracking it down. First-time use of a self-wired cable can provide puzzling results. As you found, a working loopback test is needed to assure that everything is good on the PC and cable side.
 

RNovember

Well-known member
#20
Thank you for all your help with this problem. I am really exited to try this picaxe thing out.

Now I'm off to experiment!

RNovember
 

RNovember

Well-known member
#22
Hello, I am having a problem with this again. Yesterday I was able to program picaxe chips just fine, and this morning with the same homemade cable that I have been using, and the same circuit, I get the Hardware Not Found error.

I have checked my circuit, and I have checked the cable, and both are working. I think that it is my jack on my computer. Is there any way to make sure? Is there some sort of test you can do on a PC to check to see if your ports are working?

Thank you.
 

hippy

Technical Support
Staff member
#23
"Hardware not found" means the PICAXE is not responding to a download initiation. It does not necessarily mean there's a fault with the cable or anything else, It most often just means the PICAXE needs a Hard Reset in order to get it to accept a new download.

Needing a Hard Reset is usually because the program last downloaded does something which prevents the PICAXE from seeing a download initiation; if it's waiting for IR or serial input which doesn't arrive and similar things.

Try a Hard Reset to see if that fixes things. If not then you can check things from PE6 right up to the download cable connector or jack plug using the Serial Cable Test included in PE6.
 
Last edited:

RNovember

Well-known member
#24
Needing a Hard Reset is usually because the program last downloaded does something which prevents the PICAXE from seeing a download initiation; if it's waiting for IR or serial input which doesn't arrive and similar things.
Thank you.
The chip I am trying to program is waiting for an IR signal. I'll try a Hard Reset.
 

Flenser

Senior Member
#25
Yesterday I was able to program picaxe chips just fine, and this morning with the same homemade cable that I have been using, and the same circuit, I get the Hardware Not Found error.
There are some circumstances where the code you are running on the chip can prevent the download. Under these circumstances there is nothing wrong with your wiring or your download circuit but a "hard reset" is required to give the PICAXE firmware a chance to delect the start of the download.

Can you post the code that is running on the chip? Note that I don''t mean the code you are trying to download.
 

RNovember

Well-known member
#26
Try a Hard Reset to see if that fixes things. If not then you can check things from PE6 right up to the download cable connector or jack plug using the Serial Cable Test included in PE6.
Okay, first I tried a hard reset, and it didn't fix the problem. Then I tried to find how to do the Serial Cable Test, but the only thing I could find was the test for the USB cable.

I tried hooking up my oscilloscope between the serin line and the ground line of the cable, and I definitely see a signal when I send data with the terminal, but when I tried the loop back test, it didn't work.
IMG_1348.JPG This is a protion of the signal I saw on my oscilloscope (sorry about the bad quality) The middle of the screen is 0 volts, despite what the markers say.

Can you post the code that is running on the chip? Note that I don''t mean the code you are trying to download.
These are the different codes that I have tried to download. I have tried three different chips (two 20M2, one 20X2), all with different initial codes in memory.
 

Attachments

lbenson

Senior Member
#27
If loopback test doesn't work, not much chance of programming the chip. Sure it's the right COM port? I'd try the loopback test on another usb port--check device manager to make sure you're looking at the right serial port.
 

RNovember

Well-known member
#28
I forgot to mention that the baud rate for the ocsiliscope reading was 1200 baud (it is easiest to see clearly).
I'd try the loopback test on another usb port
I'm using the DB9 serial port. I can only access COM port 1 and 3. I have tried both, with no success. If I saw a waveform on the serin line directly after I pushed the send button in the terminal, I assume that the signal was getting there.

I thought that maybe the signal wasn't getting back, but I tested the cable with my DMM, and it seemed to be connected on all the pins.

That is why I thought it was the Serial port, but I looked at the device manager, and it says that it is working properly.
 

hippy

Technical Support
Staff member
#29
Then I tried to find how to do the Serial Cable Test, but the only thing I could find was the test for the USB cable.
The USB cable test also works with RS232 COM ports.

I definitely see a signal when I send data with the terminal, but when I tried the loop back test, it didn't work.
Sounds like the transmit to PICAXE wire is okay but the receive from PICAXE into PC wire is broken.

These are the different codes that I have tried to download
It won't make a blind bit of difference what you try to download if the signal into the PC isn't there. Anything and everything you try, download, clear hardware memory, identify firmware, will fail.
 

hippy

Technical Support
Staff member
#30
I thought that maybe the signal wasn't getting back, but I tested the cable with my DMM, and it seemed to be connected on all the pins.

That is why I thought it was the Serial port, but I looked at the device manager, and it says that it is working properly.
Device Manager cannot actually determine that data sent into the port will get into the PC.

Device Manager effectively checks if there's a telephone present on the desk. It doesn't check if it can actually receive any calls.
 

Flenser

Senior Member
#31
I tried hooking up my oscilloscope between the serin line and the ground line of the cable, and I definitely see a signal when I send data with the terminal, but when I tried the loop back test, it didn't work.
If you are seeing a signal on the serin line than I think that demonstrates that the COM port is working and any other checks that you do for the COM port will only be successful.

If the loopback test did not work then that points to a problem in the serout line to the PC, as Hippy pointed out in post #29.

You can also try looking at the signal on the serout line at the picaxe end.
If you see a signal on the serout line "replying" to the serin signal then that indicates:
  • There is likely a problem with the wiring connecting to the serout line
  • This will completely eliminate my suggestion in post #25 that you need to do a hard reset because it demonstrates that the program that is running on the chip _is_ replying to the download start signal.
If you do not see a signal on the serout line "replying" to the serin signal then that I think that indicates you need to keep trying with the hard reset.

I've had a look at the code you uploaded in post #26 and I can't see the sort of code I have used which has made it difficult to start a download and required me to use the hard reset.

Your code does spend a lot of time running irin, irout, pause and pulseout commands and I think that all these these could block a download. If I'm right then this would mean that starting a new download would become a case of chance were the download would have to be sending something on serin during the small window when other code, like the if tests, we running between each of these blocking commands, or else it would fail.

Perhaps someone else on the forum could confirm whether my understanding about these commands blocking a download is correct?
 

Buzby

Senior Member
#32
Whenever I have a problem connecting, the following two procedures always find the solution.

(1) The paper clip loopback test, found in PE6 under 'Configure and Test'.

This tells me if the computer and cable are working properly.

If this fails then I know the problem is with the PC or the cable, and I can ignore the PICAXE until I've got this test working.

Note: This test works with any correctly configured USB or Serial cable, both commercial and home-brew.

HNF_COM4b.PNG

(2) Hard Reset

The most important part of the Hard Reset procedure is to turn the PICAXE power on during the 'Seaching for hardware on COMx' phase.

Only during this phase will a 'locked up' PICAXE respond.

I'll try this a few times, and if it still doesn't work then I know its time to check deeper into the construction of my board.

The problem then usually is one of the following :

(a) I've crossed the serial in and serial out signals over. ( Even after years of using PICAXE, sometimes I do this ! )
(b) I've got a short circuit or open circuit from the jack socket to the chip.
(c) I've not got power on the chip.

HNF_COM4.PNG

If you've got a scope, then it's easy to check that the signals are on the right pins, but make sure to check the signal actually on the pin. It can be, especially on well-used breadboards, that the pin is not actually connecting to the contact strip inside the breadboard.
 

RNovember

Well-known member
#33
Okay, now I feel silly. The solution was pretty simple.

In post 17, I said that my download cable's pinout was backwards and that that was the reason for the Hardware not found.

Now it seems that the pinout is now correct, and since my cable was built to accommodate the backward port, it no longer works!

Just this morning I unhooked the cable, and just attached wires to the pins of the serial port. It worked when I hooked it up the opposite way that my cable is hooked up.

I don't know why my computer would be changing the way that its ports worked, but that is what appeared to have happened.

Thank you everyone for all the advice, and I hope my computer doesn't change its mind again.
 

RNovember

Well-known member
#35
Okay, so if this is the circuit I had before:
Code:
 .-----.
| *  1* |            .---.
| *  2*-|---serout--|  P  |
| *  3*-|---serin---|  I  |
| *  4* |           |  C  |
'--. 5*-|---ground--'.....'
    '''''
Then if it flips upside down, serin is now connected to pin four, and ground is connected to pin one. The only one that stays connected to the computer is serout. So at the beginning, the connecting pin 2 and 3 worked for the loopback test, but then after the computer switched the pins, hooking 2 and 3 together was actually hooking 3 and 4 together.
 
Last edited:
#36
I've seen this before. Some cheap USB-to-serial cables coming from China have a female DE9 connector on the serial end. This goes against the convention of having a male connector on the cable. By having a connector with the opposite gender, the pin numbering is reversed.

Perhaps you could clarify which gender of connector is used on the offending cable.
 

RNovember

Well-known member
#37
I've seen this before. Some cheap USB-to-serial cables coming from China have a female DE9 connector on the serial end. This goes against the convention of having a male connector on the cable. By having a connector with the opposite gender, the pin numbering is reversed.

Perhaps you could clarify which gender of connector is used on the offending cable.
I'm not using a USB to DB9 converter. My computer has a DB9 port that I use. I just took apart a Serial cable and found the lines that hooked to pins 2, 3, and 5 of the computer. This worked for a while, and then pin 2, 3, and 5 on the computer changed to pins 1, 3, and 4.

The serin line was always connected to the picaxe, and so I was able to see the waveform. But the computer didn't see it because the ground line or serout line weren't connected.

The computers DB9 connector is female.
 

hippy

Technical Support
Staff member
#38
I just took apart a Serial cable and found the lines that hooked to pins 2, 3, and 5 of the computer. This worked for a while, and then pin 2, 3, and 5 on the computer changed to pins 1, 3, and 4.
It is hard to imagine that the computer somehow switched over signals which would normally be hard-wired and impossible to change. I would strongly suspect it's something else.

The computers DB9 connector is female
Which is very odd, because all the 9-way COM port connectors on the back of all my PC's are 9-way male.

One would then take a 9-way female socket, wire that to a 3-way header as below, then connect that directly to the PC or using a male to female straight through cable -
Code:
       .---.                                                         .---------------.
      /    |              .------.     .----.                        |               |
GND  |   O |--5-----.  .--|   ===|  1  | O  |------------------------| Serial Out    |
     | O   |        |  |  | .----|     |   ||             .---.      |               |
     |   O |     .--|--|--| | ===|  2  | O ||--------.----|   |------| Serial In     |
     | O   |     |  |  |  | `----|     |   ||        |    `---'      |               |
TX   |   O |--3--'  `--|--|   ===|  3  | O  |---.   _|_    22K    .--| 0v            |
     | O   |           |  `------'     `----'   |  |   |          |  |               |
RX   |   O |--2--------'                        |  |   | 10K      |  `---------------'
     | O   |                                    |  |   |          |        PICAXE
     |   O |                                    |  `-.-'          |
      \    | 9-Way Female                       |    |            |
       `---'   socket                         --^----^------------^-- 0v
 

RNovember

Well-known member
#39
One would then take a 9-way female socket, wire that to a 3-way header as below, then connect that directly to the PC or using a male to female straight through cable -
Yes, that is what I have set up.
It is hard to imagine that the computer somehow switched over signals which would normally be hard-wired and impossible to change. I would strongly suspect it's something else.
I also think it is wierd, but all I had to do was to hook my wires into the port so that what had been going to pin 5 was going to pin 1, and what had been going to pin 2 was going to pin 4. My computer just survived another Windows update, so maybe that changed it somehow!??!?!!!?!?!!?
 

hippy

Technical Support
Staff member
#40
My computer just survived another Windows update, so maybe that changed it somehow!??!?!!!?!?!!?
You're going to struggle to convince anyone that has happened and it's not something else. A PC mysteriously changing its hardware configuration, changing its 0V to be somewhere else would be unheard off.

How long ago was this cable last used and was working ? Are you entirely sure it's the same cable ?

My suspicion is, that with all the confusion which can come about with wiring RS232-to-header connectors, something got changed to make it work but not everything changed. When you come back to it, what you thought was now right wasn't.

That you could have just rotated the header and it would have worked suggests to me it's something related to that rather than inside the 9-way D or the PC having rewired itself.
 
Top