Shop OBEX P1 Docs P2 Docs Learn Events
Linking a Spinneret to a Quickstart- Suggestions please? — Parallax Forums

Linking a Spinneret to a Quickstart- Suggestions please?

RforbesRforbes Posts: 281
edited 2012-11-15 11:19 in Accessories
Hi all,

I'm running into some trouble and could use your suggestions.

I'd like to run my objects on a Spinneret, but once I have the HTTPServer object loaded up, I'm finding that I don't have enough memory to also add my own objects. I'm exceeding the 32k by about 3k.

So, I was thinking of having the Spinneret communicate with a Quickstart board. By doing this, I should be able to put my objects on the Quickstart, and be able to send the information back and forth between the Spinneret.

Is there a simple way to do this? All I can think of is to use fullduplexserial on the spinneret and quickstart. I've not tried to do this yet... would it work? Or is there a better way to do what I need?

Thanks in advance,
Robert

Comments

  • Mike GMike G Posts: 2,702
    edited 2012-11-09 05:07
    FullDuplexSerial would work.

    There is also HTTPServerBase.spin and HTTPServerMinimal.spin which have a smaller footprint but do not contain all the web server objects.

    Do you need a web server?
  • RforbesRforbes Posts: 281
    edited 2012-11-09 05:16
    Hey Mike,

    I think I need the full HTTPServer version. I'm trying to set up a project that uses Xbee's to turn on and off leds. The spinneret needs to talk to my base xbee, which will grab data from the remote xbee's. The web browser page doesn't have to be anything fancy, in fact something like your tutorial is fine. But my xbee object is too large and I can't minimize the code any better than it is.

    I'm just now starting to dig into your objects so I'm not sure exactly how they all work. Would the HTTPServerMinimal allow me to do what I need? I have no idea how to store a web page without an SD card to stick it in.
  • Mike GMike G Posts: 2,702
    edited 2012-11-09 05:51
    I'm just now starting to dig into your objects so I'm not sure exactly how they all work. Would the HTTPServerMinimal allow me to do what I need? I have no idea how to store a web page without an SD card to stick it in.
    I don't know enough about your project to provide a solid answer.

    If one or two pages are required and the pages are not too busy with fancy images and graphics then yes HTTPServerMinimal would work. Move the HTML to EEPROM.
  • Mike GMike G Posts: 2,702
    edited 2012-11-09 05:52
    You could also remove PST to free up space if you have not done so already.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-11-09 06:51
    Yes, you can use a second Prop and use a serial program to communicate between the two.

    I often run out of memory when using graphics in a program so I sometimes use a second Prop as a graphics slave.

    If you want to have both a debug line and a Prop to Prop line, a 4 port serial object would help save on cogs and memory.

    I think Tracy Allen's version is currently the best 4 port object.
  • RforbesRforbes Posts: 281
    edited 2012-11-09 16:42
    Mike- Ok, I didn't want to remove PST from the HTTPServer, but after doing so I can fit everything on the spinneret with a whopping 496 longs left. I still have a couple methods to write, but I think I'll be fine. Thanks for the tip!

    I'm now stuck again, but I'm going to keep going at it before I throw more questions up here. Hate asking for help when I haven't done everything I can to help myself.

    Duane- Ah, great!! I think I'm still going to use a quickstart with the propeller eventually, so that's a perfect object to work with. Thanks!
  • Mike GMike G Posts: 2,702
    edited 2012-11-09 18:08
    Hate asking for help when I haven't done everything I can to help myself.
    I can appreciate that! I also like to find my own way in the learning process.

    Don't spin your wheels too long. If you need help, ask.
  • RforbesRforbes Posts: 281
    edited 2012-11-14 17:44
    If I use the Extended Full Duplex Serial object - http://obex.parallax.com/objects/31/ to communicate between the Spinneret and a Quickstart, do I need to use pull down resistors?

    I've been reading through forum posts and looking at all the various objects- some show use of pull downs and some don't specify. I'm unclear as to whether they are needed in all circumstances, or just at very high speed comms?

    In my application, the spinneret and quickstart will be wired up less than two inches from each other, both running off the same 3.3V power supply.

    Thanks in advance!
    Robert
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-11-15 00:27
    I've used pull-up resistors with Prop to Prop lines myself. Without the pull-up resistors, I'd get a bunch of zeros being received (when I used a serial drive that didn't check for framing errors).

    Tracy Allen's four port serial driver is the best behaved serial driver I've tried. It checks for framing errors which most of the other serial drivers don't.
  • RforbesRforbes Posts: 281
    edited 2012-11-15 06:24
    Duane- Right on, ok.... I'm not really sure what a framing error is. Can you explain that?

    I like the extended fullduplexserial because of the methods with Timeouts (ie RxDecTime) and it's a little smaller than Tracy's object which is pretty important in my app.

    Also, I only have TWO available pins to use for communicating between the spinneret and quickstart. As it stands, I'll be using pins 26/24 on the spinneret for rx/tx and pins 27/26 on the quickstart. Sadly, I have no room to stick pull up/down resistors in my circuit without redoing most of my protoboard. So was hoping to hear that I can do it without implementing them. I "think" I can, but I really don't want to say "Ah Smile!" When I hook it up let the blue smoke roll out. :)

    Don't get me wrong- Tracy's object seems to be really great. But I think it might be overkill for my little ole project. I don't really need "fast" comms, just "simple" comms in both software and hardware. 19200 would be plenty fast enough for me.
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-11-15 06:42
    When we set up serial links between Propellers to use with PropForth, a 220ohm resistor is put between the two pins to limit current and protect them in case a programming errors. The low values protect the I/O without really affecting the communication. Just a bit of safety.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-11-15 08:08
    Rforbes wrote: »
    Duane- Right on, ok.... I'm not really sure what a framing error is. Can you explain that?

    I like the extended fullduplexserial because of the methods with Timeouts (ie RxDecTime) and it's a little smaller than Tracy's object which is pretty important in my app.

    Also, I only have TWO available pins to use for communicating between the spinneret and quickstart. As it stands, I'll be using pins 26/24 on the spinneret for rx/tx and pins 27/26 on the quickstart. Sadly, I have no room to stick pull up/down resistors in my circuit without redoing most of my protoboard. So was hoping to hear that I can do it without implementing them. I "think" I can, but I really don't want to say "Ah Smile!" When I hook it up let the blue smoke roll out. :)

    Don't get me wrong- Tracy's object seems to be really great. But I think it might be overkill for my little ole project. I don't really need "fast" comms, just "simple" comms in both software and hardware. 19200 would be plenty fast enough for me.

    Tracy explained a little about framing errors to me here. Some of the serial objects don't check for a stop bit so if the communication line is in the wrong state it will be read as a bunch of zeros.

    I don't think it would be hard to add a method one serial object uses to a different serial object. If you start to run low on cogs and you're using more than one instance of a serial object, it might be worth switching to a four port driver.

    If you need a certain method added to a four port object and you're having a hard time making the change yourself, just ask for some help and one of us would probably be able to help you make the desired change.
  • Mike GMike G Posts: 2,702
    edited 2012-11-15 08:36
    @Rforbes, I pretty sure the Full Duplex Serial does not drive the Tx line high when idle. I have not looked at the Extended version. That's a problem for the listener on the other end (Rx).

    The listener is looking for a start bit (low). Which allows the receive to sync and sample the next 8 bits and the stop bit (high). When the listener senses a low on the line, the listener knows the first data bit of 8, bit 0, is X bit ticks away. Where X is a function of the baud rate and system clock. Same goes for bits 1-7 and the stop bit. The bits are all evenly spaced and X bit ticks hits the center of, or close to, the next incoming bit.

    After sending the stop bit (high) and without pullups, the transmitter would have to drive the Tx line high. Otherwise the receiver might detect a low and try to receive 8 bits plus one stop bit.

    I'm pretty sure pullups are required for the default implementation of Full Duplex Serial. You can surly test it to be sure.
  • RforbesRforbes Posts: 281
    edited 2012-11-15 11:19
    Duane and Mike-

    Thanks, guys. Both of you just made a few light bulbs come on.

    Robert
Sign In or Register to comment.