PDA

View Full Version : Serial comms / Bootloader



koossa
- 28th October 2005, 14:41
Good day

I have setup my circuit to be able to do serial comms as well as bootloader software as described at this thread:
http://www.picbasic.co.uk/forum/showthread.php?t=623&highlight=bootloader

And have used Mister_e's code here:
http://www.picbasic.co.uk/forum/showpost.php?p=8601&postcount=11

But everytime I connect or disconnect using hyperterminal it switch my pic off?
Any idea why this happens?

mister_e
- 28th October 2005, 16:06
Probe your MCLR pin when you disconnect the RS232 cable.

What's happen? Should go to GND for XYZ time. Place a pull-down resistor on pin 8 of your MAX232.

koossa
- 28th October 2005, 16:11
Hi Steve

Thx
I don't have instrumentation to do a probe on mclr.
Must I just put a pull down resistor on the max (What size 2k)?

mister_e
- 28th October 2005, 16:44
let's say <10K should be enough. Also... be sure MCLR is tie to VCC with pull-up too.

mister_e
- 28th October 2005, 16:47
a simple probe... use another PIC.


Start:
While PICInput=1 : wend
HIGH LED
pause 2000
LOW LED
goto Start

koossa
- 28th October 2005, 16:49
Thank you!

koossa
- 29th October 2005, 12:53
Hi Steve

Someone told me that the MAX232 has an internal 5K pull down.
It would not be necessary to put a pull down resistor as you have described.

Is this correct?

mister_e
- 29th October 2005, 14:41
If i refer to the Maxim datasheet...
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=573&stc=1&d=1130593189">

there's indeed a pull-down resistor... mmm for the TI one, i guess it's the same.

mmm... Hyperterminal could be the cause...

did you disable the handshaking?
What about if you use MicroCode Studio Serial Communicator instead?
Is your MCLR pin is tied to VCC via resistor?
What about if you use the original solution (resistor instead of capacitor)?


I bet on the Handshake idea now.

koossa
- 30th October 2005, 10:56
-did you disable the handshaking?
<font color="red">Yes</font>
- What about if you use MicroCode Studio Serial Communicator instead?
<font color="red">MicroCode Studio Serial Communicator works!!!</font>
<font color="red">But with visual basic or hyperterminal it does not work?
Any idea what is the difference between the 2?
</font>
-Is your MCLR pin is tied to VCC via resistor?
<font color="red">Yes</font>

mister_e
- 30th October 2005, 13:19
In VB you'll need to disable the DTR line. Here's a usual COM port setting in VB


' Serial Communication Definition
' ===============================
'
With MSComm1
.CommPort = 1 ' Using COM1
.Settings = "9600,N,8,1" ' 9600 bauds, no parity, 8 data bit,
' 1 stop bit
'
.Handshaking = comNone ' no handshaking
.DTREnable = False ' disable DTR line.. avoid PIC stuck if using
' bootloader circuitry
'
.EOFEnable = False ' disable EOF event
.InputMode = comInputModeText ' Get Text from COM port
.RThreshold = 1 ' amount of character to be receive prior to
' generate a CommEvent
'
.InputLen = 0 ' get the whole string
.PortOpen = True ' open COM port
End With

MCS don't use and disable the DTR line for you.. not Hyperterm (wich i stay far of)

Acetronics2
- 30th October 2005, 13:39
Hi, Steve

Have a look there : http://www.beyond-designs.com/PC_ports.htm#VBHexTerm

or :

http://www.synthmodules.com/other/VBHexTerm-Setup.exe

... nice !!!

Alain

Melanie
- 30th October 2005, 14:34
Steve - Before you confuse half the forum readers - that's not a MAX232 jpg...

mister_e
- 30th October 2005, 16:09
Yes it is! comming directly from the Maxim datasheet bellow...
http://pdfserv.maxim-ic.com/en/ds/MAX220-MAX249.pdf
there's some little character to read at the bottom of the picture ;-)

From the Maxim datasheet:

<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=576&stc=1&d=1130688459">
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=577&stc=1&d=1130688459">


From the Texas Instruments datasheet:

<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=578&stc=1&d=1130688459">

Melanie
- 30th October 2005, 18:33
The correct pic is in the datasheet you just posted, but what I'm trying to say is that the jpg you've put up a couple of posts above is not of a MAX232... a MAX232 does not have enable connections on it's inverters. I refer you to Figure 5 on Page 17.

koossa
- 30th October 2005, 18:48
COOL!!

DTREnable is working!!!!
Thank you Steve!!!