spirilis 1,265 Posted May 20, 2013 Author Share Posted May 20, 2013 I collapsed LM4Bits.h into Enrf24.h and included the new #include's for the platform. Can you guys verify this works--it builds just fine for me with board set to Stellaris LaunchPad: Enrf24_v1_5.zip Changes: Version promoted to v1.5 #include's for Stellaris LaunchPad BITx defines for Stellaris LaunchPad Enrf24_ChannelScan example modified to use while(1); to halt CPU instead of LPM4 since that isn't available on Stellaris LaunchPad. AStelTXdemo example included. The original Enrf24_* examples only need the pin names changed in the constructor up above to work. (Haven't actually tested these myself on the Stellaris LP though) Past changes not included in the prior zip file in this thread: Subsequent hits to .available(1) will return TRUE until data is actually read. Normally .available(1) (only reports data available if RX IRQ present) will report false after the first hit b/c the IRQ is cleared behind the scenes. .write() auto-sends only when you try to send a 33rd byte into the buffer A .lastTXfailed variable exposed to the user so they can test if the last write() or flush() performed failed (only available with AutoACK, and only at 1Mbps & 2Mbps) reaper7, OzGrant and Pradeepa 3 Quote Link to post Share on other sites
OzGrant 22 Posted May 20, 2013 Share Posted May 20, 2013 Yup, Works great(or should I say just the same) Will now have a play getting to scan my ten temperature sensors. Grant Quote Link to post Share on other sites
Pradeepa 1 Posted May 21, 2013 Share Posted May 21, 2013 Thank you very much L293D and Spirilis... You guys are the best!!! Great!!! Quote Link to post Share on other sites
spirilis 1,265 Posted May 21, 2013 Author Share Posted May 21, 2013 Can someone guide me on pin mapping... Not sure what you mean ... Pin mapping for what? If you mean the transceiver, track where you put the CE, CSN and IRQ pins from the transceiver module and see which port they correspond to on the LaunchPad, then specify those in the Enrf24 constructor parameters. E.g. in the new AStelTXdemo he specified: Enrf24 radio(PE_1, PE_2, PE_3); // P2.0=CE, P2.1=CSN, P2.2=IRQ Comment wasn't updated, think I'll go edit that now but he's using PE_1 for the CE pin on the nRF24, PE_2 for CSN, PE_3 for IRQ. That's on the Stellaris LaunchPad. Quote Link to post Share on other sites
Pradeepa 1 Posted May 22, 2013 Share Posted May 22, 2013 Not sure what you mean ... Pin mapping for what? If you mean the transceiver, track where you put the CE, CSN and IRQ pins from the transceiver module and see which port they correspond to on the LaunchPad, then specify those in the Enrf24 constructor parameters. E.g. in the new AStelTXdemo he specified: Enrf24 radio(PE_1, PE_2, PE_3); // P2.0=CE, P2.1=CSN, P2.2=IRQ Comment wasn't updated, think I'll go edit that now but he's using PE_1 for the CE pin on the nRF24, PE_2 for CSN, PE_3 for IRQ. That's on the Stellaris LaunchPad. I got it spirilis. It's using SPI module 3 for SPI. And other pins as you mentioned here Now I'm trying to convert this to 'C' so that I can use it in Code Composer Studio. I hope i'll get help on this too. Thank you very much. Quote Link to post Share on other sites
OzGrant 22 Posted May 25, 2013 Share Posted May 25, 2013 G'day. Have got the Stellaris sending to the 430 OK, led flashing and all that. I'm now trying to get data back from the 430. The 430 is normally in RX mode, so when I want to send data back to Stellaris I do a radio.flush() then have a radio.enableRX() as the next instruction (also put a delay in but made no difference) . But the data not sent, and the 430 can no longer Rx Stellaris commands What noob thing am I doing. Grant. Quote Link to post Share on other sites
OzGrant 22 Posted May 25, 2013 Share Posted May 25, 2013 G'day, Seems whenever I do a post I often find the answer. My problem was solved by a radio.autoAck(false). This turns auto ack off. Anyway all is good in the land of Oz. Quote Link to post Share on other sites
spirilis 1,265 Posted May 25, 2013 Author Share Posted May 25, 2013 Weird, what data rate? Sent from my Galaxy Note II with Tapatalk Quote Link to post Share on other sites
OzGrant 22 Posted May 25, 2013 Share Posted May 25, 2013 Not sure, just used all the default settings and let the lib set them up. Now that I have got good comms will start to play around with some of these settings. Quote Link to post Share on other sites
hawwwran 2 Posted May 28, 2013 Share Posted May 28, 2013 Hello, I have a small problem with the library. I need to understand how radio.setRXaddress(); works. I mean, I don't understand, why the address in examples is { 0xDE, 0xAD, 0xBE, 0xEF, 0x01 } What I need is loop going through some number of addresses and send message to each of them. For example: I have 100 of devices waiting for "start" message. I want the main unit to call each of the devices separately and send the "start" command. I need to know how to incrementaly set the address and call the devices. And of course those devices would have set the RX address permanently on exact address. But my point is, I don't know how to work with the addresses. could someone show me example code of loop going through some number (256) or all possible addresses? what is the address structure, are all five bytes arbitrary or are some of them fixed? Thank you Quote Link to post Share on other sites
OzGrant 22 Posted May 28, 2013 Share Posted May 28, 2013 G'day Am sure there are smarter guys than me (heck there always is) but do have a few RF remotes talking to me. I put a hex switch in each slave that sets the last byte in the address array.. The other address bytes don't matter, as long as radio.setTxaddress in master (in my case have a stellaris polling the slaves) is the same as radio.setRXaddress in the 430. A simple for loop incrementing the LSB address then polls each slave. There is also an option to reduce the total number of byte in the address, but have not bothered with that at this stage. Grant hawwwran 1 Quote Link to post Share on other sites
hawwwran 2 Posted May 28, 2013 Share Posted May 28, 2013 Ok, so you are saying what I thought, that this approach would work? Ok, I'll use it. Thank you const uint8_t rxaddr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x01 }; . . . for(uint8_t i=0x01; i<0xff; i++) { txaddr[4]=i radio.setTXaddress(txaddr); } . . . Still would be nice if someone would describe how the addressing works. Quote Link to post Share on other sites
OzGrant 22 Posted May 28, 2013 Share Posted May 28, 2013 just make sure radio.setRXaddress(txaddr) is the same.; Quote Link to post Share on other sites
spirilis 1,265 Posted May 28, 2013 Author Share Posted May 28, 2013 Addressing is quite simple, it's 5 bytes. Incoming packets are continually filtered to find packets whose address matches the 5 byte RX address configured on the transceiver. There is more to it under the hood but this library is intentionally designed for you to ignore them. Btw since the .setRXaddress() and .setTXaddress() methods just take a pointer, you could pass a string to it and that would work. Just be sure it is 5-chars long. Sent from my Galaxy Note II with Tapatalk hawwwran 1 Quote Link to post Share on other sites
hawwwran 2 Posted May 28, 2013 Share Posted May 28, 2013 Great! So, let's say I plan to have maximum 20 devices (in fact about five, but just to be sure). That makes an alphabet enough big to use it as ID's like this to go through ids from dev-a to dev-z to make the addresses easy to remember. const uint8_t txaddr[] = "dev-a"; . . . for(uint8_t i='a'; i<='z'; i++) { txaddr[4]=i radio.setTXaddress(txaddr); } . . . and of course on the RX side (for example) const uint8_t rxaddr[] = "dev-a"; So you say it's valid? Thank you Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.