Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 1st August 2007, 01:52 AM   (permalink)
Default

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!"
kinjalgp is offline  
Reply With Quote
Old 1st August 2007, 01:53 AM   (permalink)
Default You can check the MAX232 independantly of the PIC.

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.
3v0 is online now  
Reply With Quote
Old 1st August 2007, 02:41 AM   (permalink)
Default

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
stolzie is offline  
Reply With Quote
Old 1st August 2007, 03:14 AM   (permalink)
Default

Quote:
Originally Posted by 3v0
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.
mmm, now thats how to troubleshoot!!

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:

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 
Into the code window.

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
Peter_wadley is offline  
Reply With Quote
Old 1st August 2007, 04:29 AM   (permalink)
Default

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.
3v0 is online now  
Reply With Quote
Old 1st August 2007, 04:41 AM   (permalink)
Default

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!"
kinjalgp is offline  
Reply With Quote
Old 1st August 2007, 05:03 AM   (permalink)
Default

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.
TekNoir is offline  
Reply With Quote
Old 1st August 2007, 01:00 PM   (permalink)
Default

Quote:
Originally Posted by 3v0
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.
It appears my problem is bigger then the PIC and the MAX.

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
Peter_wadley is offline  
Reply With Quote
Old 1st August 2007, 01:05 PM   (permalink)
Default

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!"
kinjalgp is offline  
Reply With Quote
Old 1st August 2007, 01:13 PM   (permalink)
Default

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
Peter_wadley is offline  
Reply With Quote
Old 1st August 2007, 01:15 PM   (permalink)
Default

It should be NONE. You don't require any hand-shaking in most cases.
__________________
"There is no way to peace, peace is the way!"
kinjalgp is offline  
Reply With Quote
Old 1st August 2007, 01:22 PM   (permalink)
Default

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
Peter_wadley is offline  
Reply With Quote
Old 1st August 2007, 01:27 PM   (permalink)
Default

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!"
kinjalgp is offline  
Reply With Quote
Old 1st August 2007, 02:43 PM   (permalink)
Default

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.
3v0 is online now  
Reply With Quote
Old 2nd August 2007, 04:17 AM   (permalink)
Default

Quote:
Originally Posted by 3v0
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.
Will do.

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
Peter_wadley is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Visual Basic for Electronics Engineering Applications ThermalRunaway Electronic Books 22 27th August 2008 07:40 PM
Serial Communication Interrupt in PIC Basic Pro TheMaccabee Robotics Chat 5 12th April 2007 07:52 AM
K8055 USB Interface Visual Basic Help Sudonon General Electronics Chat 6 11th September 2006 12:24 AM
visual basic program for parallel port interface group_x3m Micro Controllers 5 26th May 2006 01:48 AM
Newcomers, please read! (PIC regarded) Upd. 0xD Jay.slovak Micro Controllers 0 17th April 2005 01:04 PM



All times are GMT. The time now is 11:16 PM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.