Shop OBEX P1 Docs P2 Docs Learn Events
Serial comms to and from PC to Propeller via USB — Parallax Forums

Serial comms to and from PC to Propeller via USB

Toby SeckshundToby Seckshund Posts: 2,027
edited 2013-01-03 10:28 in Propeller 1
Hi all,

I know that this will probably draw a collective sigh from you all, but here I am with another "cannot find Prop ..." question.

I have made up (yet) another simple copy(ish) of a DemoBoard but just because I have so many I decided to try an AVR as the USB->serial (http://www.recursion.jp/avrcdc/cdc-232.html#schematic) usung the mega8 one as it has the DTR bits. Eventually I would have tried the 8 pin tiny45 version.

As half expected the Prop Tool doesn't spot the Prop on the Virtual Port 3 that the AVR sets up although I have tried a loop back with just the AVR on the board and that worked, I even tried reversing the RX and TX leads just in case.

The port reports that it is trying to do 9600,8,n,1 and no flow control, at this point I realized that as I have always used Comm1 via transistor or Max 232 interfaces I have never paid any attention to what the signalling rates or protocols are.

Anybody have any suggestions? (Prop related :-)


Both chips are at 3.3Volts reg from the USB Port

Comments

  • kwinnkwinn Posts: 8,697
    edited 2012-12-29 13:54
    Did you provide a reset signal to the prop chip?
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-12-29 14:07
    Yes it is the same 10n cap and 10K res to a npn transistor driven off of the DTR signal from the AVR. I have looked at it with a very simple 'scope and I think it fires off, but I see that it is normally low and goes high so the edges could be the wrong way around. I know that Dr_Accula had some thoughts on that a while back. I seem to be getting a 2mS high pulse as the DTR.

    My main question is does the "packaging" of 8,n,1 ... get in the way and how flexible are the speed settings, I have just pushed real serial (Comm 1) back and forth up until now and every thing worked, fortunately. Presumably what I am trying to do is much the same as a USB -> Serial and then serial to Prop. I have a FT232 type chip here somewhere but the pin pitch puts me off.

    Thanks for the reply

    Alan

    I see that when I put another Prop onto a real serial port the DTR is -VE going +VE but is a lot longer (20 mS?) and there is some extra activity after that, probably the acknowledgements going on when it does spot that board (my old "lunchbox")

    I have swapped over the Props between boards to make sure that it wasn't a dead chip, any way it had a nice pinout label on the other one.
  • kwinnkwinn Posts: 8,697
    edited 2012-12-29 18:27
    Yes it is the same 10n cap and 10K res to a npn transistor driven off of the DTR signal from the AVR. I have looked at it with a very simple 'scope and I think it fires off, but I see that it is normally low and goes high so the edges could be the wrong way around. I know that Dr_Accula had some thoughts on that a while back. I seem to be getting a 2mS high pulse as the DTR.
    A pulse that goes high then low should still reset the prop on the negative edge. It could be a timing problem with the reset
    coming 2mS later than expected. An inverter between the AVR DTR and the capacitor would correct that. It could also be the rise time of the AVR signal so a larger (100n) capacitor might do the trick.
    My main question is does the "packaging" of 8,n,1 ... get in the way and how flexible are the speed settings, I have just pushed real serial (Comm 1) back and forth up until now and every thing worked, fortunately. Presumably what I am trying to do is much the same as a USB -> Serial and then serial to Prop. I have a FT232 type chip here somewhere but the pin pitch puts me off.

    AFAIK the prop boot firmware automatically adjusts for the download speed of the connected computer, and the 8,n,1 is the standard setting of the comm port when the propeller software is installed on the PC.

    First check if I were troubleshooting this issue would be to go to a larger capacitor on the DTR, and if that did not work then use an npn transistor to invert the DTR signal.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-12-30 02:19
    I tried the 100n bit and that didn't help. As to the 8,n,1 stuff you have described exactly what I thought was going on, according to Device manager the COMM 1 port is at 9600,8,n,1 before and after Prop Tool goes to work. I remembered that there was some clever bit banging going on to get the speed right automatically.

    The DTR from COMM 1 is -ve and goes briefly to +ve (at rs232 levels) so my inital thoughs of it being the wrong way around might be false. The "improvements" to the Atmega45 version of the software made a thing about it but as I haven't got around to sticking the AVR software on the computer yet I thought that I would go for the mega8 one which had the RTS, CTS and DTR signals implimented even if it was 4 time bigger, I have a few of those kicking about and there was space in the box.

    I'll have another go at it later on.

    Alan
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-12-30 07:32
    I have put a preprogrammed EEPROM int the board just to prove that the Prop is running at all. It is chearfully sticking out Graphics Demo (PAL) via the usual pins and does pause if a F7 ident is sent from Prop Tool, so the reset is getting through, perhaps at the wrong time though.

    I tried removing the 10/100nF cap to the reset transistor and putting in a resistor instead. I even stopped trying to cheat by using the same Xtal as the AVR (12MHz) and gave it its own 5MHz rock to play with (not that that should affect the boot). Still no Prop detected :-(
    1024 x 768 - 84K
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-12-30 11:22
    I have just been reading this-

    http://forums.parallax.com/showthread.php?140901-Why-can-t-you-use-a-cheap-USB-dongle-to-program-the-Propeller-You-can-but...

    -from about 6 months ago. I may be treading the same ground, I will have to try other IDEs and see if that changes anything. The delay changer 60-500 mS doesn't help in the present Prop Tool and the oldest "old" version I have a copy of is 1.2.6.

    EDIT

    Great, BST gives me a BSOD if I point it at the Comm 3 Virtual port that the AVR appears as. I am so glad that the local river is heavily flooded, I won't have so far to walk, and chuck it in!
  • jmgjmg Posts: 15,173
    edited 2012-12-30 17:23
    I have looked at it with a very simple 'scope and I think it fires off, but I see that it is normally low and goes high so the edges could be the wrong way around.

    Can you capture the relative timing of RST and Serial ?
    If your scope is too simple, there are sound card scopes that should do 9600 bd ?
    I noticed the Tiny45 was only spec'd to 1200 - 4800bps, 8N1 ?

    USB in HW is also pushing down in price, I see a ATmega8, is actually more expensive than a ATXMEGA16A4U.
    ( Pity those Xmegas do not come in smaller packages yet.)
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-12-31 06:29
    Good point about the speed of the '45 version. I didn't get around to giving the board any swimming lessons last night, but I am seriously thinking of making up a small FT232 board and removing the AVR. I wanted to get a fairly well protected board that I could take out on the road with me (a new job) so all of the sockets etc were aligned for a defuncted VGA extender box. The 'scope is a 20MHz twin channel one so I could do some more investigations (if I had time).

    One thing that I did notice whilst comparing the working three transistor interface and the USB attempt was that the level on the Prop's RX pin went higher than the 3.3 V level. It went up about a protection diodes worth, so something must be bleeding through from the RS232 interface levels. It has been working OK for over 3 years so it can not be too bad.

    Happy new year to all those over near Australia.

    Alan
  • jmgjmg Posts: 15,173
    edited 2012-12-31 12:16
    Good point about the speed of the '45 version. I didn't get around to giving the board any swimming lessons last night, but I am seriously thinking of making up a small FT232 board and removing the AVR. I wanted to get a fairly well protected board that I could take out on the road with me ...

    The Modules are getting quite cheap, and UM232H is ~ $20 (DIP) and physical variant UM232H-B (2mm) is ~$16, and those have the large buffers, and very fine baud granularity and Xtal precision of the 232H series. (even if you never use the high speed )

    I see EXAR also have a ~$20 module, with RS485 options, and some interesting handshake and 9 bit support.
    I've not tried one yet, but it looks to have a good embedded slant.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-12-31 14:30
    I have weakened. To get something up and running by the weekend I have started a FT232 board to replace the AVR (hopefully).

    Perhaps another day/month ...
    1024 x 768 - 84K
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2013-01-03 10:28
    I have given up on the AVR bits, for now, and gone for the usual FT232 route.

    It didn't want any extra driver software (which supprized me) and spotted the Prop on Com4 without any fuss. I F11'd in Graphics Demo which went through all of the wanted verifications. Should have done that in the first place, I suppose!

    With that blue transfer plastic and the usual ironing of the toner, 0.65mm pitch was quite easy (I have managed a QFP100 0.5mm before).

    Right stick it in a case and pretend that it was all planned that way ...
    1024 x 768 - 85K
Sign In or Register to comment.