Connecting via RS232.

Daveat44

New Member
I'm having some problems connecting the bread boarded PIC to the computer via the RS232 serial port.
I'm running XP.

My device manager says the port is working.

Could you tell me which driver I need for use with this RS232 connection.

Also, when I try to download from All About Circuits it keeps telling me I haven't completed the (Graphic thingy, sorry, forgotten the name), but I don't see one on the page.

Dave.
 

Buzby

Senior Member
Hi Dave,

Welcome to the forum !.

Connecting via RS232 to a PICAXE is very 'Old Skool', but still possible on any PC with a serial port.

See manual 1, page 44 for how to connect the serial to a PICAXE : http://www.picaxe.com/docs/picaxe_manual1.pdf

The programming editor ( PE6 or PE5 ) doesn't need a special driver, it just needs to know what com port to use.

Regarding the Graphic Thingy, I've no idea what you mean, but someone on the forum will sure help,

Cheers,

Buzby
 

inglewoodpete

Senior Member
I'm having some problems connecting the bread boarded PIC to the computer via the RS232 serial port.
I'm running XP.

My device manager says the port is working.

Could you tell me which driver I need for use with this RS232 connection.

Also, when I try to download from All About Circuits it keeps telling me I haven't completed the (Graphic thingy, sorry, forgotten the name), but I don't see one on the page.

Dave.
Welcome to the PICAXE forum.

Your post leaves me with a few questions. Firstly, you mention that you are trying to connect a PIC to your WinXP computer via an RS232 cable. Can you confirm that you are using a PICAXE chip, with has special firmware already programmed into it. If so, what model of PICAXE chip are you trying to use.

Your mention of "All About Circuits" does not ring any bells with me either - I don't recall that "All About Circuits" uses PICAXE chip but I could be wrong.

Finally, can you confirm that the "Graphic thingy" is an application within the PICAXE Programming Editor or some other platform.

Stick with us! If you are using PICAXE, we'll soon have you up and running. (If you're not, we'll get you converted over before you know it :):).)
 

Daveat44

New Member
Thanks for the responses.

I'm having a complete mind blank over 'graphics thingy' or rather the name of it. I see it in my mind but can't name it.

It is the set of distorted text that you have to re-enter in plain text to confirm you're not a Bot.
Isn't old age wonderful.
Any way, turns out it was for another application. so not relevant.

Inglewoodpete,

I have a picaxe -o8m2 in the board. It's a bread board, Rechecked it a few times, appears ok. It is powered via a 5Volt USB cable from a phone charger at 5.1 Volt. I'm just using the + and - leads from the charger.

The board is plugged into a serial cable that is in the COM 1 port of my computer.

As mentioned, the computer's device manager indicates that the port is ok.

I have Editor 6.0.9.3 running.

The workspace explorer shows

Settings Picaxe-08m2
Comport COM 1
simulation Picaxe-08m2.

I can create programs that run on the simulator.

Hope that helps.

Dave.
 

Daveat44

New Member
The 'graphics thingy' is a capcha.

But here was the problem.

I linked to https://www.allaboutcircuits.com/technical-articles/intro-to-picaxe/ (thanks Westaust55) and managed to recreate my initial problem with All About Circuits.
when I try to download the sample program, as they suggest, it goes to a signing in process for AAC.
Now, I registered with them a while back.
But it won't accept the user or password. So I follow the procedure to change them But..

It tells me I haven't followed the capcha verification properly.

There is no capcha on the page.

Just thought I'd bring you up to date.


Anyway, I have Editor 6 on the screen with a short program that works in simulation. What next.



Dave.
 

lbenson

Senior Member
What are you using for a download circuit to connect to your breadboard? Is it effectively the same as in Manual 1?
download circuit.jpg
What kind of cable do you have--is it a real RS232 connection or usb serial?

Perhaps you can give us a clear photograph.

It's often recommended that you use 3 AA batteries for a power supply when testing things out--less likely to suffer destruction if something is miswired.
 

Daveat44

New Member
Ibenson,

It's the circuit with two diodes as in https://www.allaboutcircuits.com/technical-articles/picaxe-programming-basics-part-1/

The power supply has a 'charger doctor' plugged in that feeds to the board. I can monitor both voltage and current.

It shows 5.1 Volt and Zero Amps.

The cable is a real (D9) cable, factory made. I have a small (again factory made) panel with connection terminals plugged in to it on the bench to allow easy access.

Continuity of the three lines has been checked all the way from the computer end to the tracks on the breadboard. All ok.

The chip is in the right way around and shows 5.1 Volt on the appropriate pins.

I have removed the three lines that go to the board for the minute as I have a loop back link across pins 2 and three.
The idea was to use hyperlink to test the port.
But I can't get into hyperlink as it requires me to enter my post code at the wizard. But the wizard will not accept letters, only digits 0 - 9. And my UK code starts with a B.

One can't catch a break with this.

Dave.
 
Last edited by a moderator:

lbenson

Senior Member
Dave--your link has an extraneous "(" in p(icaxe. This one works for me: https://www.allaboutcircuits.com/technical-articles/picaxe-programming-basics-part-1/

You should be able to test the loop-back with any terminal program, for instance, putty. Not sure what you mean about hyperlink requiring a "post code".

This is likely some simple problem (which doesn't mean that it is easy to determine +which+ simple problem it is)--once you solve it, you will be on your way.

Good photograph might still help.
 

inglewoodpete

Senior Member
I second Buzby's suggestion to use PE6's cable test utility. You can also do a data loop-back test using the PE6 terminal program (Press F8 when in PE6).
 

erco

Senior Member
Maybe your serout/serin pins are swapped? The SEROUT from one goes to the SERIN of the other, & vice versa.
 

Daveat44

New Member
Buzby,

It was Pe6 that threw out the error message when I tried to test the com1 line.

I have a 1 Metre 9 pin Serial cable plugged into the computer. The other end is on my bench and has a ETT ET-CON DB9M board plugged into it.
This is just a little pcb with a D9 header on one side and 10 screw headers on the other. There is also a set of 9 pins that can be used. All very neat and compact.
I run three short wires from the headers to the tracks on the bread board. Very little room for error.

But clearly there is one somewhere.

Ibenson.

Thanks or the corrected link.

I'll look up putty and install it.

As you suggest, probably something simple. But finding it....

Forget the Hyperterminal reference. It was a blind ally.

Dave.

Reaches for his coffee. Back to the bread board.
 

Buzby

Senior Member
... It was Pe6 that threw out the error message when I tried to test the com1 line.
Was it the 'Hardware not found' error message ?.

If so, that means you did not use the 'Test cable' function that PE6 provides, as that does not give the 'Hardware not found' message.

As you say, there are only three wires, so can't be too difficult to fix.

A photo is worth a thousand forum posts.

Please post a couple of nice clear photos, and we'll have another go.

Cheers,

Buzby
 

Daveat44

New Member
Just throwing in a few more things I noticed.

Working from Workspace Explorer.

The COM Port section.

Device manager shows COM port 1 to be working. (as does my xp)when clicking 'Check PICAXE type connected' the following message appears in the black box.

Firmware check failed. :Error: Can't open COM1.

And in the black box the following (after the copyright header)

Line# 0, col# 0

Error: can't open port COM1

Now this is different to the format shown in the part two tutorial in that the tutorial, where the test passes, doesn't show a reference to lines and columns.

Is this relevant ?

Erco,

Pins are ok as far as I can ascertain.

Inglewoodpete,

Just tried to open the PICAXE terminal (from file tab) and I get..

Could not open COM port: The given port name does not start with COM/com or does not resolve to a valid serial port.
parameter name: portName

Just got up the Serial terminal page.

Port Settings shows..

COM Port COM1 Communications Port

Baud Rate 4800
Parity None
Data Bits 8
stop Bits One

I suspect these are not the right Baud Rate etc settings , but shouldn't the Com port open anyway ?

Buzby,

I was following the instructions in part 2. It doesn't mention the test cable facility, only tells you to check PICAXE type connected.

I'm off to find and use this test cable facility.

Dave.
 
Last edited:

Daveat44

New Member
Buzby,

That test appears to pertain to the AXE027 Download Cable only.

I am using a DB9 Serial cable directly between the computer and the breadboard.

If I click on Device manager (the next item on the COM1 Communications port) It shows my COM1 port as working properly. With settings Bits per second:9600, Data bits:8, Parity:none,Stop bits:1, Flow control:none.
I have also tried changing the Receive/Transmit buffers to a low speed, as suggested in Advanced Settings for COM1, makes no difference.

I'm off to try running a different device from DOS to check the cable that way. At least that should prove the cable and COM1

If all else fails I may buy the AXE027 cable and use the USB port. But that would really defeat the object.

Dave.
 
Last edited:

Buzby

Senior Member
... That test appears to pertain to the AXE027 Download Cable only....
I'm not so sure about that.

The test won't work with an AXE027 unless the drivers are installed, but after they are PE6 just sees the USB as a new COM port, so I'd expect the test to work with a real COM port just the same.

It really would give us a lot more to go on if you could post a photo of your breadboard setup.

Cheers,

Buzby
 

Daveat44

New Member
Buzby,

I'm going to do a strip down and rebuild of the board, probably old school method on a bit of wood following the schematic layout.; I don't like these modern plug in boards. Then I post a couple of pictures if it doesn't work.

However, see the notes below.

-----------------------------

Ok, quick update.

I restarted my computer in DOS (from a floppy in A) and ran a program called 'TERM'.
It is a small terminal program that drives a Quasar Project Kit#3145 Temperature Data Logger.
It uses a 12C509/PO4 chip to collect data from a DS182 sensor.

This runs via COM1 and uses DTR,RXD and GND (Pins 1,4 and 5 on a Db9)

And it is running happily away taking the temperature off this room (20C).

So it appears that the serial Port is working.


Maybe the chip is faulty ?

Dave.

Thanks for your patience.
 

inglewoodpete

Senior Member
Maybe the chip is faulty ?
Well, never say never. But never (almost). I have handled and programmed hundreds of PICAXE chips and have never had a dead-on-arrival.

We have been focussing on the cable to date.

The download circuit resistors perform a couple of critical functions - 1: Stop the higher voltages of RS232 from damaging the 5v input logic of the PIC (PICAXE) chip. 2: pulls the SerialIn pin low to allow the PICAXE to run normally. The PC's serial port will pull the pin high when a download or chip test is initiated.

Something about the PICAXE chip: From the factory, when powered up with the download resistors correctly in place (very important!), the chip will output (something like) "Hello, I am your PICAXE chip" or something similar from the serial out pin. Check this using the PE terminal program, <F8> key. That tells you that the PICAXE is running and the chip-to-PC leg is connected and working. If the PICAXE chip is new and has never been user programmed, you need to get this step working before going any further.

The next check is to try the "Check PICAXE type connected" test from the PE. This tells us that the download (PC-to-chip) leg is connected and working. If this test fails, use a multimeter between 0v and the SerialIn pin of the PICAXE. Initially, it should sown around 0v. When you try the "Check PICAXE type" test, the voltage on this pin should rise to around 5v.
 

Daveat44

New Member
... Check this using the PE terminal program, <F8> key. That tells you that the PICAXE is running and the chip-to-PC leg is connected and working...

It throws up an error message saying it can't open COM1.

Just wondering.

Maybe I (we) are looking at this from the wrong direction by concentrating on the cable and the hardware.

The problem seems to be that PE6 isn't 'seeing' my COM1 port.

Based on the fact that I can access the port when running another program from the same computer.

Dave.
 
Last edited:

tmfkam

Senior Member
If COM1 is reported as 'unavailable' it would suggest that Windows either believes it to be in use, it is in use by another program or Windows isn't willing to use it for some other reason.

Have you had any other Windows devices or programs use the port in the past? Does Windows not reserve a hardware COM1 port for a serial mouse?

I might try re-assigning the port number to something like COM4 and trying again.

If I recall, DOS programs will issue COM port numbers based on the IRQ set in the BIOS, Windows may not.
 

inglewoodpete

Senior Member
If COM1 is reported as 'unavailable' it would suggest that Windows either believes it to be in use, it is in use by another program or Windows isn't willing to use it for some other reason.

Have you had any other Windows devices or programs use the port in the past? Does Windows not reserve a hardware COM1 port for a serial mouse?

I might try re-assigning the port number to something like COM4 and trying again.

If I recall, DOS programs will issue COM port numbers based on the IRQ set in the BIOS, Windows may not.
Windows may be booting up thinking that the serial port has a serial mouse connected. Try disconnecting the serial cable before booting up and then plug it in.
 

hippy

Technical Support
Staff member
Another thing to watch out for is opening a COM port with a 'DOS program' and then, having closed the port, Windows programs not being able to open it until after a reboot. Doesn't always happen, but I have experienced that.
 

Daveat44

New Member
Texasclodhopper,

..DOS? DOS? What is this DOS thing you speak of? Surely you jest!

Surely tis the one true path.

Dave.
 

hippy

Technical Support
Staff member
Just tried AXEpad.

Gives the same problem.
That's to be expected. If Windows won't let one Windows program open the COM port then it shouldn't let any Windows program open that COM port.

The issue is why Windows thinks the COM port cannot be opened.

Unplug the cable from COM1, reboot and try again without plugging the cable in. Both PE6 and AXEpad should then be able to open the COM port though downloading won't work, should give "Hardware not found errors".
 
Last edited:

westaust55

Moderator
Does Windows not reserve a hardware COM1 port for a serial mouse?
.
Not from my experience.
I have a slightly vintage HP Z400 Xeon workstation with an RS232 port (DB9 connector) as Com1 in the hobby room.
Also Windows 10Pro 64 bit installed.

The serial port is used with with an equally vintage PIC programmer and at other times a model railway LocoNet interface and has always worked correctly.
 
Last edited:

MartinM57

Moderator
..or yes, it does not reserve a COM1 port for a serial mouse :)

I have had multiple devices on COM1 over the years on Windows 7x64 and Windows 10x64 with zero problems.

The problem these days seems to be finding a modern motherboard with a COM port - IME they seem to rarely/never have the socket on the main rear panel nowadays, the best you'll find is a motherboard header requiring a cable and a 9 way socket mounted on a blank expansion board cover
 

hippy

Technical Support
Staff member
Does Windows not reserve a hardware COM1 port for a serial mouse?
Unless explicitly instructed to do so, Windows will not reserve COM1 for a serial mouse.

Unless explicitly instructed not to, Windows will analyse available COM ports to see if they appear to have serial mice, pointing devices and the like attached.

So, by default, Windows won't be expecting a serial mouse on COM1 but, if it determines one is attached, it will allocate COM1 to that serial mouse. The problem comes when what is attached is not a serial mouse but Windows believes it is.
 

The bear

Senior Member
Don't despair, if Windows thinks its a mouse instead of a cable, mine was a mouse for two years on Win 7.
(Supplied cable, not RS232) it worked fine. Eventually it sorted itself out, thanks Win10.

Regards, bear..
 

Daveat44

New Member
Inglewoodpete,

.. Try disconnecting the serial cable before booting up and then plug it in. ..

Doesn't make any difference.

But I didn't hink it would as plugging an DB9 extention only physically moves the COM port to the end of the lead. I.e from the rear of the machine onto my bench.

Remember I am not using a USB/serial adapter. just the DB9 lead.

Dave.
 

hippy

Technical Support
Staff member
.. Try disconnecting the serial cable before booting up and then plug it in. ..

Doesn't make any difference.

But I didn't hink it would as plugging an DB9 extention only physically moves the COM port to the end of the lead. I.e from the rear of the machine onto my bench.
But it does confirm that whatever the issue is lies with the PC hardware or Windows, is nothing to do with your cable or anything else. It removes the possibility that something about the cable was fooling the Windows system into thinking there was a serial mouse attached and removes some other possibilities too.

I would suggest selecting a COM port other than COM1, work your way through them and try to do a download. Don't worry that nothing is connected to that port, don't worry if you get errors though it would be worth noting and reporting exactly what errors you do get.

After trying the first non-COM1 it would be worth switching back to COM1 to see if that gives "Hardware not found" rather than "Cannot open COM1".
 

Daveat44

New Member
Just been investigating the Com ports on my desktop machine; the one I am trying to run PE6 on.

Using 'Device Manager'

I appear to have just two ports.

Communication Port (COM 1)

ECP Printer Port (LPT 1)

So I ran http://www.rttycontesting.com/tutorials/removing-hidden-com-ports/.

To find the hidden ports.

It seems there are none.

So, no nearer.

I think I will just Buy a USB adapter cable and try to run PE6 prom my laptop.

Just out of curiosity, does anyone else here use only a DB9 cable from the COM port, or do you all use USB ?


Today I called in at my old company and asked their network people what they thought about it.

They couldn't see how the PE6 could run with out a driver of some sort.

Dave.
 

inglewoodpete

Senior Member
Just out of curiosity, does anyone else here use only a DB9 cable from the COM port, or do you all use USB ?
I have both. I have used the COM1 port and bare RS232 serial cable on my desktop PCs for the last 10 years.

Come on, Dave. Move into the 20th century and use USB! That old XP has arthritis by now. :D
I was pleased that my latest mother board with an i5 processor, purchased 2 years ago, had an RS232 serial header. I had to buy a header cable to access the port. This machine (Windows 10/64bit) is my primary PC for PICAXE software development.

The AXE027 is a slightly "nicer" cable to use, mainly because it outputs 0v/+5v data logic, more suited to interfacing to a logic-level microcontroller. The AXE027 usually stays with my laptop computer for field work.

Dave, you haven't mentioned the results of booting the PC up without the serial cable plugged in and then opening PE6. What does PE6 report when started after this boot-up sequence?
 

Daveat44

New Member
Inglewoodpete,

same results which ever way I try it. Tells me it can't open the port.

What does ...'the given name does not resolve to a valid serial port.
parameter name: portName'.....

Mean ?

Texasclodhopper,

I would like to stick with RS232.

Karl Marx wrote..

'The production of more clever machines leads to the production of less clever people'.

He was right.

I need to get to the bottom of this problem.

Dave.
 

Daveat44

New Member
A bit more info.

Just done a loop back test via Hyperterminal.

I was given the options of

COM1
TCP/IP(WINSOCK)

Chose COM1

Resultant message.

Unable to open COM1
Please check your port settings.

Dave.
 
Top