BasicMicro - Forums

www.basicmicro.com
It is currently Sun May 20, 2012 10:46 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Atom and 232 comm
PostPosted: Mon Jul 27, 2009 3:49 pm 
Hi Mike,

here's my $.02

I did a project with the Lassen SQ about four years ago, so this is all from memory. The SQ was I believe a 5v GPS device so I didn't have to do any level conversion.

Here are some things I thought of:

1) Delete the level shifters all together

You should be able to run the signals directly between the GPS and the Atom - no level shifting required. I looked at the IQ datasheet and the IQ inputs are CMOS, so the GPS' RX pin should be able to take a 5v signal from the Atom with maybe a 10K series resistor in the line to the GPS RX pin. The GPS TX pin does not need a series resistor as a 3.3v high to the Atom will not damage the Atom pin. You may have to play around with the value of the series resistor. 10K might be too big, maybe a 4.7K or even down to 1K. It might not need a resistor at all but it would not hurt to have one in series. If you have a scope then you could look at the high level of the signal at the GPS RX pin and adjust the value to get an appropiate level.

As far as programming goes you should not have to invert the signal into the Atom.


2) Use a RS-232 chip with a PC/PDA

When using one of the Atom's pins (other than Sin/Sout; like P0 or P1 which you are using) to connect them to either the PC or PDA you would need to use a RS-232 chip like the max3232 or the like. The RS232 chip inverts the signal (low becomes a high; a high becomes a low) so you have to allow for that in the programming by inverting the signal.

Some of the modern RS-232 logic found on PCs can read 5v signals, so it is possible to run the Serout from the Atom directly into the PC's serial port pin 2 (if I recall correctly) but require a 22K series resistor between the serin pin and pin 3 of the PC's port. This was documented in an earlier Atom manual.

You did just that with the code you posted on July 20th at 8:50PM as:

Test 1:

main:
serout p1, i9600, ["TEST 1234"]
pause 1000
goto Main


Now using S_in / S_out with the PDA/PC you do not need the RS232 chip as it is built into the Atom. I don't remember if signal needs to be inverted or not when using the S_in or S_out pins, ie. i9600 or n9600. You use that in the expanded test 1 and so I guess it is inverted - i9600


3) Possible issue with the string syntax

Being that you output correctly using S_out in your test 1 using "dec new" I'm thinking there is some syntax issue with the serout statement you had in your 1st post as shown below:

serout S_OUT, i9600, [str Version40,13] 'Send version out hardware serial port

I looked in the MBASIC manual as it has some good examples on serout (page 174). It shows the str characters in caps as in STR. Not sure if that would be the issue.

You could try this:

serout S_OUT, i9600, ["Version = ", STR Version40, 13] 'Send version out hardware serial port

and see if you get any portion out of the port onto the IDE or PDA.

You first post showed 5 lines of garbage. Is the version information that comes from the GPS that long?

You might want to clear the array "Version" to all zeros each time through the loop. It is automatically done on the first time through but would get changed on input.

----

I also notice that in your BS2 code that you used true signal (84) rather than inverted (16468) for all three serial statements. Are you absolutely sure that in your Atom code that you need to use inverted signals (i9600) as in your first post. Maybe you are not actually querying the GPS for version. If in doubt, you could output ">QVR<" from the Atom to the GPS, and output from the GPS to the PDA. Just a thought.

I hope this helps.

- Bob -


Top
  
 
 Post subject: Re: Atom and 232 comm
PostPosted: Sun Aug 09, 2009 3:00 pm 
Offline
Master

Joined: Sun Oct 05, 2008 9:40 am
Posts: 111
I have been able to get all three ways of interfacing to work.
1. ICL3232
2. Level shifter
3. With no translation circuts.

What I did was take the Atom off the lab board and placed it in an old perf board I had. This was programed using the actual serial port with DB9. To my surprise it worked. I then switched the moduel back to the lab board without reprogramming and connected to the lab boards USB. This also displayed what I wanted to see. I then tried to reprogram the Atom with the USB connection. This showed the same junk as before. Switching back to the perfboard setup without reprogramming I see junk again.

I have a FT232R breakout board so I tried to recreate the problem. I used Mprog to read the settings of the FT232 on the lab board and programed the one on the breakout board to match. When this was used to program the Atom I got the junk again. When the FT232 was bypassed with the serial port and programmed the data displayed was what it was supposed to be.

In short if programed with the DB9 and serial port everything works fine. Data can be read with usb and displayes correctly. But if programmed with USB I get garbage no matter what I use (USB or serial).

Another problem I discoved is that I can not program the Atom on the lab board using the DB9 connection. The programming status bar reaches 100% the first time then shortly into the second time through I get the

Could not connect error
1. Check comport settings
2. Check serial cable connection
3. Check power connection

Again I only get this error if trying to program on the lab board. If I program the Atom on the perf board it works and I do not get this error.


Top
 Profile  
 
 Post subject: Re: Atom and 232 comm
PostPosted: Sun Aug 09, 2009 5:30 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
Hello Mike. Sounds like problem is at the Lab Board. How old is this Board? What is the Rev Number? (I have the latest, a RevD). What is the voltage at the module? I am doing voltage testing today and have found 4V and below with an Atom 28M module is problematic for programming. Surprisingly, once programmed, it runs fine down to 2.5V. It starts to reset internally under that, then dies at 2.1V.
BTW, did you download and install the custom drivers from BasicMicro?
Later!

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Atom and 232 comm
PostPosted: Sun Aug 16, 2009 12:06 pm 
Offline
Master

Joined: Sun Oct 05, 2008 9:40 am
Posts: 111
The Lab board does not have a version number. It is almost a year old.

I pulled out the old XP computer and reinstalled the drivers. I then reconnected using usb and programmed the moduel with the GPS program. The terminal window started displaying the correct information.

I then went back to the Vista 64 computer and can not get the drivers to install correctly. Any suggestions?


Top
 Profile  
 
 Post subject: Re: Atom and 232 comm
PostPosted: Mon Aug 17, 2009 1:01 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
AH HA! My programmer says you must ingratiate yourself to the Vista Gods by enabling your UAC, User Access Control. Here is a MS site that explains how to do that:
http://support.microsoft.com/kb/922708
It also has warnings about problems about using this in a generic fashion. The OS becomes more vulnerable to MalWare. So, turn it on, install the drivers and get them to work, then disable UAC.
Take care.

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Atom and 232 comm
PostPosted: Mon Aug 17, 2009 3:47 pm 
Offline
Master

Joined: Sun Oct 05, 2008 9:40 am
Posts: 111
I tried this and it did not work. I am running Vista 64. The error I receive states I need to run the 64 bit version of DPInst.exe.


Top
 Profile  
 
 Post subject: Re: Atom and 232 comm
PostPosted: Tue Aug 18, 2009 12:26 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
Sounds like you need this address:
http://www.ftdichip.com/Drivers/VCP.htm

This is FTDI's Virtual Comm Port driver, which includes Vista64. One driver does it all. Remove the old driver. Download and install the driver, 2.04.16. You'll have to open the advanced settings for the USB Serial Port this creates in the device manager. You want to change the Latency Setting from "16" to "1". If you don't do this, it will program very slowly.
Take care.

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Atom and 232 comm
PostPosted: Tue Aug 18, 2009 8:18 pm 
Offline
Master

Joined: Sun Oct 05, 2008 9:40 am
Posts: 111
Updated the drivers and this did not change the garbage in the terminal window.


Top
 Profile  
 
 Post subject: Re: Atom and 232 comm
PostPosted: Sun Sep 13, 2009 11:42 am 
Offline
Master

Joined: Sun Oct 05, 2008 9:40 am
Posts: 111
I downloaded Studio and now everything works :mrgreen: :mrgreen:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO