PDA

View Full Version : BS1USB serial control over its USB with terminal



spamer
02-18-2010, 04:41 PM
Hello,

I like to control BS1USB using USB serial port. I found, that there is no connection from USB serial to software using SERIN.
So I connected the USB serial output to P3 with 10K resistor. See attachement. Warning - changing the board voids warranty.
It receives the data, but after about 1 second of data been received the CPU restarts itself.

Is there some solution how to control software with USB serial terminal?

Juraj

Mike Green
02-18-2010, 11:18 PM
Using a 10K resistor between the USB serial output and an I/O pin is a valid way of doing this. There's nothing in what you've done that would cause a reset, so it must either be a bug in your Stamp program or your PC program that's causing the reset.

spamer
02-19-2010, 12:08 AM
I have two modules with same "reset" behavior (V1.4).

Simple program:
Main:
LOW 4 ' connected led between VDD and P4 light on
GOTO Main

When send e.g. "00" to terminal on 1200, then led gets dark for about 1 second and then get light back. BS1USB is probably restarted.
Terminal reads every char sent - received data "5B 5B 5B 5B 5B 5B 5B 5B 5B 5B 5B 5B 5B 5B 5B 5B F9". Probably some debug mode is activated.
I think, that CPU is still is debug mode, that expects only new firmware on the serial line. When incorrect char comes ("0"), then it is automatically reset, what is not really expected. There should be added some magic sequence to activate CPU reset, not just single char "0".

avicenne
09-26-2011, 08:00 PM
Hi

I used the same transformation of spamer aading the resitor 10K , serin works fine but serout send full of control caracters to the computer !
do you have idea what's wrong?

Mike Green
09-26-2011, 08:19 PM
spamer,
You're probably forcing the Stamp to reset by short-circuiting the power supply. If you connect an ordinary LED between an I/O pin and, say, Vdd, the LED will short circuit between the I/O pin and Vdd. The Stamp's I/O pin (if it doesn't burn out) will supply at most 20-30mA to the LED. That still may be enough to cause a drop in Vdd to below the point where the Stamp will automatically reset (about 4.2V). Solution: Use a 470 to 1K resistor in series with the LED to limit the current to something reasonable.

avicenne,
You really have to supply a copy of your program and a diagram (schematic) of your circuit. Otherwise, we're really just guessing what's wrong. See below:

http://forums.parallax.com/attachment.php?attachmentid=78421&d=1297987572 (http://forums.parallax.com/showthread.php?129690&p=978076&viewfull=1#post9780 76)

avicenne
09-29-2011, 01:25 AM
Hi Mike

Thanks for your quick reply

the program i use for test is just the template on parallax CD



' SEROUT.BS1
' This program transmits the string "ABCD" followed by a number and a
' carriage-return at 2400 baud, inverted, N81 format.

' {$STAMP BS1}
' {$PBASIC 1.0}

SYMBOL SOut = 1
SYMBOL Baud = N2400

SYMBOL value = W1


Setup:
value = 1

Main:
SEROUT SOut, Baud, ("ABCD", #value)
value = value + 1
PAUSE 250
GOTO Main
END

When i connect the BS1 thrue PIN1 to serial cable and then to the computer evrything works fine
Computer receive the data correctlly
But when i do the transformation of spamer With the resistance 10K the data pass by FTDI chip on USBBS1 , then by a USB cable is connected to the computer.In this case the data received by the computer is wrong full of 8c and 9c are received by the computer.
In my opinion the solution is on the FTDI chip . am i wrong?
the other solution is DEBUG Viewer but it replace serout not serin.
I am going to try to find a solution for this communication .
Otherwise i think We must completly migrate to the BS2.
If you have idea about this communication it will be appreciate
With my thanks from France

Mike Green
09-29-2011, 02:29 AM
spamer is trying to send data from the PC to the BS1USB. The BS1USB I/O pin is an input and it won't affect the output data from the FTDI chip. You are trying to go the opposite way and that won't work. The connection to the PC via the FTDI chip is for programming the BS1. This programming is bidirectional. There's a signal from the BS1's PIC microcontroller to the FTDI chip to the PC. If you connect a BS1 I/O pin to the FTDI chip, it's competing with the signal from the PIC programming pin.

You can use the DEBUG statement to send data via the programming connection to the PC. The Nuts and Volts Column #20 describes the format of the data packet that is sent to the PC.