PDA

View Full Version : BS1 new DEBUG window refuses to work



Paulo
04-11-2007, 07:29 AM
After closing the DEBUG window that opens when I run my code, a new DEBUG with the same configuration of the former one don't work. I'm leaving the BS1 connected and supposedly running the same code just downloaded to it. The first window shows what it is expected to with blinking green lights and all, but the new one seems totally dead.

I am using this code:

SYMBOL· square········· = B2··········· ' FOR/NEXT counter
SYMBOL· stepSize······· = B3··········· ' step size, increase by 2 each loop

Setup:
· stepSize = 1
· square = 1
Main:
· FOR square = 1 TO 250 STEP stepSize·· ' show squares up to 250
··· DEBUG square······················· ' display on screen
··· stepSize = stepSize + 2············ ' add 2 to stepSize
· NEXT································· ' loop until square > 250
· GOTO Main
· END

I set the new DEBUG window to 2400,n,8,off and it is mapped to COM5. What am I doing wrong?

Paulo
04-11-2007, 07:32 AM
actually, wichever baud rate I use produces the same result

Chris Savage
04-11-2007, 09:48 AM
Paulo,

This is normal behavior for the BS1…Unlike the BS2 which is sending out formatted data, the BS1 is sending raw register streams of data. The DEBUG window only knows the configuration of this data at program time. If you then close the window that information is lost. I hope this explains the confusion. Take care.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

Paulo
04-11-2007, 09:37 PM
Thanks for the explanation, Chris.

Does this means the BS1 stops sending DEBUG data when I close the window? If this BS1 is disconnected from the PC wich loaded its code and connected to another serial inport, maybe in another PC, should this new receiver get any data? If so, may I use HyperTerminal to get it?

I wanted to use the BS1 as a "talker", sending a continuous steam of bytes, any bytes, to a serial port. Does DEBUG and programming line do the job?

Mike Green
04-11-2007, 10:05 PM
The BS1 sends data whenever it executes a DEBUG statement whether or not there's something listening. The data is not in convenient form for reading. There's a Nuts and Volts article on the format of the data and how to extract information from it (www.parallax.com/dl/docs/cols/nv/vol7/col/NV131.pdf (http://www.parallax.com/dl/docs/cols/nv/vol7/col/NV131.pdf)).

If you want a continuous stream of bytes, you would need a BS1 program that just sits in a loop doing a DEBUG statement. If it does anything else in the loop, there will be a pause in the stream when the BS1 is doing the "something else".

Chris Savage
04-11-2007, 10:07 PM
Paulo,

You really have two options…It’s not that the BS1 stops sending the data…It’s that the Editor/DEBUG Window doesn’t know anymore how to interpret the raw data coming in. The BS1 is always sending out all registers when debugging. So your first choice is to leave the DEBUG screen open.

Your second choice, which would work better but would require slightly more code, and I/O pin and some parts would be to send your debug data through an I/O pin using SEROUT. You would need a line driver such as a MAX232 to get the signals to RS-232 levels, or it is possible to use the BS1 Serial Adapter, but the point is you’d be using an I/O pin in place of the PCI/PCO programming pins.

Instead of DEBUG you would use SEROUT and manually format your data going out. An advantage to this is you could use any terminal program such as HyperTerminal and reconnect at any time and the data would still be there. I hope this helps. Take care.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

Paulo
04-15-2007, 10:23 AM
Thank you both for the advise, I'll go for the SEROUT option, it seems more appropriate. And I do have a home-made BS1 Serial Adapter, so my question now is about the pins used to interface the PC: right now PCO is connected to the base of the adapter output transistors; I guess it is not allowed to parallel the other output pin to PCO since·both are·outputs and that would generate a conflict; or is·there a way to configure PCO as input?

It seems I'll have to hack my adapter...