Problem with Basic Atom Pro and serial

Hi guys,
I would like to make a program with my Basic Atom Pro that receive commands from the serial DB9 and send them thru the hardware serial port.

I tried to test the db9 serial but it seems not to work.

I tried this simply program

main gatto serout S_out, i9600, "text"] goto gatto end

But on hyperterminal I don’t see anything.

I connected Hyperterminal, set it on the right com and the right baud rate but on the screen I don’t see anything.

I tried also the opposite, send thru HT a character and see if my board receive it but HT doesn’t let me write.

[code]main

dati var word
loop
	serin S_IN,N9600,[dati]
	if dati=48 then
		low p4
	endif
	
	;hserout [dati]
goto loop

end[/code]

any hints?
thanks
bye
Janine

The root of the problem is that the DTR line on the DB9 connector is used as a reset line to the module. With most windows based communication programs like hyperterminal the DTR (and RTS) lines are asserted even if you do not have hardware handshaking enabled. If you use the Terminal1 tab in the IDE and set it to the correct port and baud it should let you see your output. The only way to use hyperterminal is to disconnect the DTR line in the serial connection.

I have the same issue. I want to use a regular terminal program to log the output from WALTER. The IDE clears have the terminal window, which is just plain not helpful to say the least. I’'ve asked for the ability to log output several times, but there has never been a response to those requests. I need to see a steady stream of output I can analyze for debugging. It does not work with Minicom in Linux either.

This does not work for a lot of things because the IDE clears half the terminal window. This should not be done. It should just be a continuous scrolling of data from the robot, with ability to log the output to a file.

8-Dale

Thanks!
I tried to use the terminal tab but it doesn’t work either, the Atom-Pro IDE freeze…

I set the correct port and baud rate.

I use the same port I use to program the card, could this be the problem?
Do I have to disconnect something?

Thanks
Bye
Janine

yeah I live the IDE freeze thing too, usually when debugging. odd kind of karma there huh?

anyway, the simplest thing to do may be to modify your serial cable to disconnect the DTR signal. You will not be able to use the modified cable to program of course but you could wire a switch inline with the DTR signal and then you would just have to flip the switch to determine which communications mode you are in.

Thanks!
I reinstalled the ide and it’s not freezing anymore, and I can see the output!!

Now works also the input function, for other who has a problem I modified the program I posted before so:

before: serin S_IN,N9600,[dati]
now: serin S_IN,i9600,[dati]

Thanks EddieB!

New Question:
Now I’m trying to use the hardware serial

[code]main

enablehserial
sethserial H9600,h8databits,hnoparity,h1stopbits
dati var word
loop
	hserout "text "]
goto loop

end[/code]

but on the terminal window instead of "text text text text text text " I see “ªzºú»ªzºú»ªzºú»ªzºú»ªzºú»ªzºú»ªzºú»ª” :open_mouth:

Preferences in the terminal tab are : 9600 - com1 - no parity - no flow ctrl - no echo

thanks!!!

how did you get the hardware serial pins (P14 and P15 I think it was) to the PC? You would need an RS-232 buffer/inverter generally speaking, such as a MAX232 or DS14C88/DS14C89 pair or any number of other fairly common devices.

I took 3 wires (rx,tx,gnd), attached at a rs232 connector (pin 3,2,5), and then to the serial port on my pc.

I don’t know, nor did I ever use the Atom, but I can say that overall you’ll need a RS-232 converter as said before.

This would convert the signals from the Atom (0-5V) to RS-232 signals (-13 to 13V or something thereabouts…)

Signals going downstream (pc to Atom) might work if the atom has an onboard level converter (like the Basic stamp2 used to have?) but upstream might be a problem, and most likely explains why you’re getting garbage input.

That does not work electrically for two reasons, as ScuD posted there is a voltage level translation, and also the signals get inverted when they get translated.
You can do this with a pair of transistors and a couple diodes but it is much simpler to just use a device like a max232.

ok perfect.
thanks to both!!!

bye bye
janine