Shop OBEX P1 Docs P2 Docs Learn Events
Full Duplex Serial Question — Parallax Forums

Full Duplex Serial Question

sharpiesharpie Posts: 150
edited 2007-06-16 19:50 in Propeller 1
So, here's another opportunity for my ignorance to show with the full duplex serial object.· If I have multiple devices connected to one prop, say 5... that use a serial interface, is there a way to use the same fdx object for all devices or perhaps another way to save memory... or do I need to·call the object 5 times in the OBJ section?·

Any help is appreciated =)

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-06-16 13:55
    You need to have a separate instance of the Full Duplex Serial object for each active serial channel. You can declare them separately with different names in the OBJ section or you can declare an array of objects (like OBJ serial[noparse][[/noparse] 5 ] : "FullDuplexSerial"). The compiler produces only one copy of the code, but allocates space for the object's variables for each instance.
  • sharpiesharpie Posts: 150
    edited 2007-06-16 19:50
    Thanks Mike.. That makes sense. Good to hear the compiler only produces one copy with variable space..
    Have you tried sharing one object between multiple routines by switching the pin numbers and restarting the object? (ser.stop, reassign pins, ser.start, etc...) Is there any issues I'm not thinking of with that? Or does it really not gain much of an advantage.. I'm straining for memory space so anything I can eek out right now helps.

    Thanks=)
Sign In or Register to comment.