need object for parallax 433 MHz RF Receiver
chris jones
Posts: 391
Hello
is there a small exmpale of a object for a parallax 433 MHz RF Receiver and Transmiter
is there a small exmpale of a object for a parallax 433 MHz RF Receiver and Transmiter
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
50 72 6F 6A 65 63 74 20 53 69 74 65
·
Also
Mike will this work i still need to disable the output mode i see
BS2.Pulsout(E, 1200)
BS2.Serout_Str(5,string("Spin-Up World!",13),9600,1,8) ' send string to rf device
PUB Transmit(value)
Repeat
BS2.Pulsout(E, 1200)
BS2.Serout_Str(5,string("Spin-Up World!",13),9600,1,8) ' send string to rf device
BS2.Pause(1000) ' 1 second pause
PUB Recive(value)
Repeat
BS2.Serin_Str(5,@myString,9600,1,8) ' Accept string passing pointer for variable
BS2.Debug_Str(@myString) ' display string at pointer
BS2.Debug_Char(13) ' CR
BS2.Debug_Char(myString) ' show 6th character
return mystring
lcd.gotoxy(12, 1)
lcd.decf(value, 8) ' print right-justified decimal value
lcd.gotoxy(11, 2)
lcd.Recive(myString, 8)
BUT I GET THIS ERROR
Expected subroutine name on /// Recive
NOTE: i have 2 boards and i want to transmit between both i think i am close but i hit a snag
Post Edited (chris jones) : 10/30/2009 2:50:12 PM GMT
Using simple_serial means to start the receiving always in time before the other end starts sending.
If you switch over to FullDuplexSerial you only need ONE cog for send and receive.
That's exact what fullduplex means: Send AND receive at the same time.
Second advantage as FullDuplexSerial (short-name FDX) does the send and recive in the backround
you NEVER drop data as long as you check the receivebuffer before it is filled up completely.
If you need a bigger buffer than 16 bytes you can increase
the buffersize. With serial-mirror you can pump up the buffersize to kilobytes
For sending call on of the send methods and the data is transferred to the send buffer very quickly and FDX does the rest in the backround
So you are quicker back from sending as the sending needs time to be done.
Most of the methods of simple_serial have the same name as in simple_serial. maybe not all
But FDX provides the same functionality.
If you need more functionality like receiving strins and store them right away use
FullDuplexSerialPlus wich ist located at C:\Program Files\Parallax Inc\Propeller Tool v1.2.6\Examples\PE Kit\6 - Objects Lab\FullDuplexSerialPlus.spin
To post my very personal opinion about simple_serial: simple_serial is so simple that more complexe tasks get complicated
(as send and receive at the same time. simple_serial needs two cogs for this)
best regards
Stefan
Post Edited (StefanL38) : 10/30/2009 4:35:14 PM GMT
You are defining stack variables as BYTE when they should be LONG.
You are referencing the stack variables from within the routines. Don't do that, you will overwrite the stack and things will go pear shaped.
If you posted your complete code, either in-line or as an attachment you may get more suggestions.
Personally, I'd suggest you start with the Propeller Tutorials that accompany the Propeller Tool software and dispense with the BS2 compatibility library. Learn how the chip actually works and build it up slowly.
Stefan is right also, you can use FullDuplexSerial and do the whole lot in one cog.
Are you using 2 pairs of identical TX/RX units, and trying to transmit full Duplex? That won't work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you always do what you always did, you always get what you always got.lt's not particularly silly, is it?
1. so i should not use the BS2 library?
2. and i am allowed to post my full code ?
3. i have been through the tutorials and there is nothing showing how to use a serial lcd exept the bs2 library whats your suggestion?
4. why will 2 pairs of identical TX/RX units not work( i have 2 boards and i want each board to have an id to send first to make sure its not the same unit onboard.
5. can you help me use the fullduplex library ?
6. do you know of any exmpales i can follow that use the RF units in question ?
Declare clock settings in Constant Settings
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
if you are using a 5Mhz XTAL
ok a few questions
1. so i should not use the BS2 library?
you can use it but it keeps you away from learning spin REALLY
2. and i am allowed to post my full code ?
You can do so best thing to do is to use the post reply button instead of the QUICK-reply form
for providing your COMPLETE code use the archive-function of the propeller-tool see attached picture
3. i have been through the tutorials and there is nothing showing how to use a serial lcd exept the bs2 library whats your suggestion?
look into C:\Program Files\Parallax Inc\Propeller Tool v1.2.6\Examples\Library\Parallax Serial Terminal Demo.spin
4. why will 2 pairs of identical TX/RX units not work( i have 2 boards and i want each board to have an id to send first to make sure its not the same unit onboard.
two pairs of HARDWARE will work. MagIO meant if you try to to two simple_serial-objects to use on the same two pins (meaning SOFTWARE) wil not work
5. can you help me use the fullduplex library ?
see C:\Program Files\Parallax Inc\Propeller Tool v1.2.6\Examples\PE Kit\6 - Objects Lab\HelloFullDuplexSerial.spin as a start
Parallax Serial Terminal Demo.spin has the same methods with same method names as FullDuplexSerial.spin
6. do you know of any exmpales i can follow that use the RF units in question ?
no
@Parallax: Parallax Serial Terminal Demo.spin shows how to use the PST.EXE but is its own object instead of using FullDuplexSerialPlus
The only difference is that the IO-pins are hardcoded. In my opinion this difference is so small it does not need another object.
Please add a demo or a Lab-chapter that shows ALL details about the FullDuplexSerialPLUS-object emphasizing --PLUS-object
as if you use FDX instead of FDX+ the newbees will come up with questions like how do I receive a string etc. etc. etc.
This demo should show ALL of the thumble-stones laying around as it starts with
best regards
Stefan
Start the BS2 Object
" To use include in code:
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
OBJ
BS2 : "BS2_Functions" ' Create BS2 Object
PUB Start
BS2.start (31,30) ' Initialize BS2 Object timing, Rx and Tx pins for DEBUG
' **************************************************************************************
' * NOTE: YOU MUST START THE OBJECT as it sets up the timing for many functions *
' **************************************************************************************"
(As found in the BS2 Functions Library Object)
Also the new transceiver web page states a range of 250 feet, but the PDF file says 2500 feet...which is it?
is this how i start the two objects?
BS2.start (2,1) ' Initialize BS2 Object timing, Rx and Tx pins for DEBUG
cognew(Transmit, @nstr) 'Starts a Cog,
cognew(Recive, @myString) 'Starts a Cog,
but i will have to use cogs sooner or later so i will read up on the chapter before i test agian.
http://forums.parallax.com/showthread.php?p=853681
...It's in the early stages of having the RF modules wrapped around this object, but I thought I'd throw it out there so people might report back any findings or further ideas.· Please respond to the link posted above for any detailed information.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
CRC_polynomial DEMO TX.spin
CRC_polynomial DEMO RX.spin
These files are just to get you started. The main file to focus on is the CRC_polynomial.Spin. I am working on an RF transceiver object that will wrap both the TX and RX demo abilities together and use the CRC_polynomial.Spin object as one of it's main objects.
The syntax might be something like this...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 11/5/2009 3:34:22 PM GMT
Post Edited (chris jones) : 11/7/2009 3:55:16 PM GMT
can you tell me if i am headed in the right dirtection i am trying to create an object for my RF units.
this is the RF_Units file i am includeing in my main program
Post Edited (chris jones) : 11/8/2009 8:47:30 AM GMT