Shop OBEX P1 Docs P2 Docs Learn Events
Serial, USB, ANYTHING! — Parallax Forums

Serial, USB, ANYTHING!

Nicholas BottNicholas Bott Posts: 12
edited 2006-09-06 10:56 in General Discussion
Since getting the Javelin, I haven't been able to consistently communicate with it in any way. I tried Serial on 4 different PCs with varying OS and clock speeds (even as low as 233mhz win98se). I also sent it back to Parallax for testing and they said they can talk to it fine, but I can't (I'm unlucky I guess). I bought a brand new javelin incase that was the issue, and it didn't solve anything.

I just want SOME kind of solution to talk to this stamp! It was working OK with USB, and then suddenly it wasn't. I tried rebooting the PC, the stamp, re-installing the FTBI serial driver, etc.

I'm going crazy!

My latest issue is that I can echo, loopback, but not get status. It says "packet discarded" when attempting to talk to it.

I just want to pay an extra 20$ and get SOMETHING to talk to this stamp once and for all. Does anyone have any recommendations on successfully talking to the Javelin long-term and consistently?

Thanks so much! shakehead.gif

(It seems like this is a pretty ridiculous situation, I'm very dissapointed with tech support, and particularly that the serial driver for USB doesn't allow you to get input back from the terminal, and that's their staple "solution" at this point. I don't understand why they would sell something that doesn't work with "newer" computers. (or any for that matter in my case))

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-09-05 18:54
    What board do you use with the javelin?
    If you use the Javelin stamp demoboard (which is serial) then I assume you
    use an external usb2ser cable.
    Do you have the parallax usb2ser cable? (which is known to work).
    If not, the best option (not just for javelin but other micros also)
    is to get a pci card with serial ports. These come in 1, 2, 4 or 6 ports variants.

    http://sewelldirect.com/Serial-PCI-Controller-Card-1Port.asp
    http://sewelldirect.com/Serial-PCI-Controller-Card-2Port.asp
    http://sewelldirect.com/Serial-PCI-Controller-Card-4Port.asp
    http://sewelldirect.com/Serial-PCI-Controller-Card-6Port.asp

    regards peter
    ·
  • Nicholas BottNicholas Bott Posts: 12
    edited 2006-09-05 19:02
    I use the Professional Board with Javelin.

    I'm using the built in USB port. I don't have the parallax usb2ser cable.

    Why would a PCI card serial port work better than the on-board serial ports on my computer? Have you known this option to work? (I'm not sure why it would make a difference offhand).

    I've tried on-board serial ports on 4 different computers as mentioned previously.

    Thanks very much for the reply! I'm told you're the guy to talk to about Javelin stamps. smilewinkgrin.gif
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-09-05 19:25
    If you do have serial ports then you don't need any pci card.
    I just assumed you didn't have serial ports.
    I know the USB port of the PDB does not allow to read in characters from the PC.
    It must be the onboard usb as I did have this working using an external usb2ser once.

    So I suggest to use the DB9 port using a straight 1:1 cable.
    You say you have echo, loop but not status.
    Have you checked your serial cable (pin to pin, no shorts or breaks)?

    Have you tried the downloader? This is a dos program (runs in dosbox) that downloads a program
    to the javelin using a serial port connection.
    You can find several versions here:
    http://groups.yahoo.com/group/JavelinCode/files/JavelinDirect/
    (version 1.2 is my adapted version that also saves·the jemfile on harddisk)

    There was a thread once about a javelin not accepting downloads anymore (or only partially).
    The attachement holds a javelin program that is supposed to resolve that error.

    regards peter
  • Nicholas BottNicholas Bott Posts: 12
    edited 2006-09-05 20:17
    The serial cable works for the BASIC stamp fine. I tested it with a meter and it seems only 4 pins are used (connected). I'll purchase some DB9 1:1 serial cable like you suggested. Tech support said if it worked for the BASIC stamp, it should work for Javelin; but, I'll try this other cable.

    The DOS program is having the packet discarded messages and unable to connect to the stamp.

    Thanks for the link and attachment. I joined the yahoo group and it looks like it has some useful stuff.

    Maybe I could have saved myself some hair pulling if this DB9 cable works. Thanks for the suggestions, Peter.

    roll.gif
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-09-05 20:35
    The serial cable only uses 4 wires (pins 2,3,4 and 5) and so should work.
    I must say I have never experienced any of those packet errors you encounter.
    You tried several javelins on several computers but this error persists.
    But you also said it once worked using the usb connection.

    Do you recall any environment change lately (like new RF devices, WIFI devices etc).
    I know the javelin is quite sensitive to this kind of interference because I once
    had to move it away from an·burglar alarm system before it would operate correctly.

    I do believe your javelins are ok, also because Parallax has tested them,
    so it must be something in your pc setups or environment.
    What power supply do you use. The javelin·is quite sensible to any
    ripple·on the power supply. Have you tried another power supply?
    I always use a 24V 3A stabilized·DC power supply.
    Edit: that is on the javelin demoboard.
    For the PDB use 12V.

    regards peter


    Post Edited (Peter Verkaik) : 9/5/2006 8:40:54 PM GMT
  • Nicholas BottNicholas Bott Posts: 12
    edited 2006-09-05 21:16
    I'm using the 12V supply that was recommended on the website.

    It was working over USB, then next run, it wasn't. There's no circuitry attached to it. I tried moving it and it didn't help.

    I'm really discouraged with my experience with the Javelin at this point. I like java/c# programming so I wanted to try out this stamp; but, it's given me nothing but problems from the start. Do you have any recommendations for a microcontroller that is similar but from another company? I don't really know what to do at this point other than not use the Javelin.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-09-06 00:09
    Do you use the latest IDE (v 2.03 )? If not download it from the parallax site.
    Also make sure the pc serial port you use is COM1-COM4.
    (ide menu Projects->Global Options, tab debugger)
    Don't give up on the javelin yet. I will check the downloader source
    to see exactly when a corrupt packet is detected. This may point
    us to the source of this erratic behaviour.

    regards peter
  • Nicholas BottNicholas Bott Posts: 12
    edited 2006-09-06 05:37
    I'm using the latest IDE. The serial ports are com1 and com2. Com3 is the virtual port for serial over USB.

    The serial port selection is on AUTO. It can't detect the Javelin on any port (except com3, which is having issues now with discarding packets).

    Let me know what you find. Thanks.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-09-06 10:56
    Here is the routine from the downloader that generates the 'discarded packet' message.

    void __fastcall TSXComm::ReadPacket(unsigned char *packet, int *length)
    {
    ·int startTime, charTime, nowTime, charDelay, packetDelay;
    · int lengthRead;
    · bool gotFlag, escape;
    · unsigned char c;

    · // If the program is running make the delays longer in case the
    · // program calls for a delay.
    · if ( running ) {
    ··· charDelay = 5000;
    ··· packetDelay = 6000;
    · }
    · else {
    ··· charDelay = 1000;
    ··· packetDelay = 2000;
    · }

    restart:

    ·lengthRead = 0;
    · gotFlag = true; // Packets no longer start with a flag.
    · escape = false;

    ·// Get the current time.
    · startTime = GetTickCount();

    · while (true) {
    ··· charTime = GetTickCount();
    · ·while ( !CharReady() ) {
    · ·· nowTime = GetTickCount();

    ··· ·if ( nowTime - charTime > charDelay
    ····· ··· || nowTime - startTime > packetDelay )
    · ·· ·throw EError(kIDE_ERROR, 22 );

    · ·}
    ··· c = GetChar();
    ··· if ( !gotFlag && c == kFlag ) {
    ···· ·gotFlag = true;
    ····· lengthRead = 0;
    ····· if ( gOptions.debugComLevel >= kDebugComBytes )
    ··· ··StatusDebug("First flag - resetting");
    ··· }
    ··· else if ( gotFlag && c == kFlag && lengthRead > 0 ) {
    ····· if ( gOptions.debugComLevel >= kDebugComBytes )
    ··· ··StatusDebug("Flag - end");
    ···· ·break;
    ··· }
    ··· else if ( gotFlag && c == kFlag ) {
    ····· if ( gOptions.debugComLevel >= kDebugComBytes )
    ··· ··StatusDebug("Flag - resetting");
    ···· ·lengthRead = 0;
    ··· }
    ··· else if ( c == kEscape ) {
    ····· if ( gOptions.debugComLevel >= kDebugComBytes )
    ··· ··StatusDebug("Escape");
    ··· ·escape = true;
    ····· continue;
    ··· }
    ··· else {
    ··· ·if ( escape ) {
    ······ ·if ( gOptions.debugComLevel >= kDebugComBytes )
    ······· ·StatusDebug("Escaped data");
    ····· ·c ^= 0x20;
    ····· }
    ····· /*
    ····· else if ( c < 0x20 ) {
    ······· if ( gOptions.debugComLevel >= kDebugComBytes )
    ······· ·· StatusDebug("Received unknown control character 0x%2.2X '%c'", c, c );
    ······· escape = false;
    ······· continue;
    ····· }
    ····· */
    · ·· if ( gOptions.debugComLevel >= kDebugComBytes )
    ··· ··StatusDebug("Receive 0x%2.2X '%c'", c, c);
    ···· ·packet[noparse][[/noparse]lengthRead++] = c;
    ····· if ( lengthRead == *length )
    ····· ·throw EError(kIDE_ERROR,11);
    ··· }

    ··· escape = false;
    · }
    · // If there is still data to retrieve get the next packet. (The SX must only
    · // send one packet at a time.
    · if ( CharReady() ) {
    ··· //if ( gOptions.debugComLevel >= kDebugComBytes )
    ····· StatusDebug("Discarding packet");
    ··· goto restart;
    · }

    · *length = lengthRead;
    }

    It looks as though there remains data in the serial port fifo after reading a packet.
    Try disabling the fifo for the serial ports. Let us know if that solved the issue.
    Try both the IDE and the downloader.

    regards peter
Sign In or Register to comment.