There could be many reasons for this. First thing may be baud rate. Or may be improper schematic.
Show your Micro's code and your schematic.
There could be many reasons for this. First thing may be baud rate. Or may be improper schematic.
Show your Micro's code and your schematic.
"There is no way to peace, peace is the way!"
If you are using Nigels tutorial schematic.
Remove the PIC.
On the MAX232 junper pins 9 and 10 together.
Use a terminal emulator on the PC.
Now anything you type on the PC will come in on MAX232 pin 8
at RS232 levels. It will exit the MAX232 on pin 9 at TTL levels.
Then go back into the MAX232 on pin 10 as TTL and exit on 7
as RS232 and go back to the PC.
With this setup anything you type on the PC should show up on
the PC screen. If it does your MAX232 and cable are OK.
Remove the jumper and replace the PIC.
EDIT: For this test baud rate and parity settings on the PC do not matter,
but I suggest you use whatever you intend to use with the PIC.
Last edited by 3v0; 1st August 2007 at 01:56 AM.
Please post questions to the forums. PM's are for personal communication.
BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)
Instead of using a MAX232, as serial ports are becoming rare on laptop's you might want to consider implementing a USB to serial chip. e.g FT232R or FT232BM
The drivers for these FTDI chips allows you to communicate to the device like any standard serial COM port. So the code you have already implemented will still work.
Cheers
Stolzie
mmm, now thats how to troubleshoot!!Originally Posted by 3v0
Its still not working like this 3v0!
Ok here is what I have going:
Power is 5V
On the DE-9..
Pins 1 & 4 & 6 are connected together.
Pins 7 and 8 are as well.
Pin 5 is going to ground on the MAX circuit.
Pin 2 is going to Pin 7 of the MAX
Pin 3 is going to Pin 8 of the MAX
There is a 47uf by cap on Pin 16 of the MAX.
Between pin 16 and pin 2 is a 22uf cap, + leg is on pin 2
On Pin 6 there is a 22uf cap going to ground, + leg is on ground side.
Between pin 1 and 3 I have (2) 4.7uf caps in parallel, since I dont have (2) 10uf caps. + leg is on pin 1
Between pin 4 and 5 is one 10uf cap, + leg is on pin 4.
and Pin 9 and 10 are jumpered together.
Ground is on Pin 15. Vdd is on 16.
That is exactly how mine is wired.
The VB6 program:
On the Form there is 2 txt boxes.
txtRX and txtTX
I then Copy and pasted this code:
Into the code window.PHP Code:Private Sub Form_Load()
With MSComm1
.Settings = "9600,n,8,1" ' Baud=9600, Parity=None, Data-Bits=8, Stop-Bits=1
.CommPort = 1 ' COM1
.PortOpen = True Open the port
End With
End Sub
Private Sub Form_Unload()
If MSComm1.PortOpen = True then MSComm1.PortOpen = False
End Sub
Private Sub MSComm1_OnComm()
If MSComm1.CommEvent = comEvReceive Then
txtRX.Text = txtRX.Text & MSComm1.Input
End If
End Sub
Private Sub txtTX_KeyPress(KeyAscii As Integer)
Mscomm1.Output = Chr(KeyAscii)
End Sub
When I press 'RUN'
I try to type in the TX text box.. nothing shows up on the RX box.
argh.
"Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post
9vDC Guitar Pedal PSU
PIC16F84a Game Module
I did not sort through the wiring. A schematic would go a long way here. The text version makes my head hurt.
Prior to getting into that lets make sure the PC is doing its job.
Unplug the RS232 cable from the PIC.
Type and you should see nothing.
Short pins 2 and 3 on the RS232 cable (it is still plugged into the PC but not the PIC target). To do this you can makup an DB9 with a wire soldered between 2 and 3.
With the jumper in place you should see what you are typing on the PC.
If this does not work either you did not follow these instructions or the BASIC program has problems. Maybe flow control problems. Others may have talked about that.
Please post questions to the forums. PM's are for personal communication.
BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)
Are you sure you have connected RS232 cable on COM1?
A silly question...but sometimes people make this mistake.
"There is no way to peace, peace is the way!"
This tutorial from SparkFun Electronics might be useful to you.
http://www.sparkfun.com/commerce/pre...p?p=BEE-4-UART
At the bottom of their main tutorial page, under the heading General PIC Tutorials, they have some other serial and UART related information.
I apologize if it's too little too late, but perhaps it can be of some help for others.
Last edited by TekNoir; 1st August 2007 at 05:08 AM.
It appears my problem is bigger then the PIC and the MAX.Originally Posted by 3v0
When I short pins 2 and 3 of the serial cable It still does not work.
Could it be my fire wall?
It is on COM1 for sure.
Why do we jumper 7 and 8?
Why do we jumper 1 and 4 and 6?
I know these are probably the lamest questions but it really will help me solve this.
Does anyone have the VB6 program made?
No need to go and make it, but if have it already..
Well I dont really understand! I am a very consious programmer.. everything in the VB appears to be right..
Fairly new computer.. COM port has never given problems.. worked with my edrum and programmer..
HMMMM![]()
"Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post
9vDC Guitar Pedal PSU
PIC16F84a Game Module
Firewall generally doesn't block COM ports so I guess thats not the problem.
Try this project. Its a terminal program written in VB.
http://www.programmersheaven.com/dow.../download.aspx
"There is no way to peace, peace is the way!"
what should the flow control be set at ?
it is on HARDWARE right now.
"Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post
9vDC Guitar Pedal PSU
PIC16F84a Game Module
It should be NONE. You don't require any hand-shaking in most cases.
"There is no way to peace, peace is the way!"
sweeeeeeeeeeet
I was just messing with the Properties window for MSCOMM and now it working!
Input mode was set to Binary.. changed it to Text.
Dont ask, heh.
Ill try it with the MAX now..
Works.
Ill try it with the PIC now..
Works!
Thank you guys SOOOO much! This has given me so many more circuit ideas!!
Next is USB i guess.. any recommend chips?
See you.
"Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post
9vDC Guitar Pedal PSU
PIC16F84a Game Module
USB is pretty difficult to start with. Its not like Serial or parallel port. It requires lot of coding.
But if you use USB to Serial converter chips like FT232...things become much easier as USB coding is abstracted by using the DLLs supplied by FTDI. www.ftdichip.com
"There is no way to peace, peace is the way!"
Build a few projects with the RS232 serial first.
Then you may want to take a look at
UBW (USB Bit Whacker)
It uses a PIC18F with USB. It may not be the exact application you are looking for but it is fun to play with and quite inexpensive to build.
Please post questions to the forums. PM's are for personal communication.
BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)
Will do.Originally Posted by 3v0
Probably going to use RS232 with VB then JAVA then C++ before I go for USB.
"Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post
9vDC Guitar Pedal PSU
PIC16F84a Game Module