- Posts: 402
Developing a universal module
- blackmoon
- Offline
I just got back from vacations and I already miss the "far niente", good times go away to fast
Please Log in or Create an account to join the conversation.
- btoschi
- Offline
- Posts: 151
The MultiModule is detected, but any RF module besides A7105 is not, pressing OK will let transmitter go stuck - powering off takes some seconds then.
Even when using my 'old' module which has PA-less A7105 and nRF the CYRF is no longer detected when using my custom build. This module was working before (using custom build from around one month ago), besides some issues with V2x2 protocol.
Note that I have double-checked all connections on MultiModule to be fine.
I tried some variations on hardware.ini, but even when disabling all modules (and not enabling MultiModule) it complains about missing MultiModule and missing CYRF (having MultiModule disconnected). Did I miss a change with hardware.ini or default behavior ?
Reprogramming AVR via Devo works, as such the SPI must be working somehow, even that it looks at first glance that MISO is somehow misbehaving (A7105 uses MOSI pin for in and out)
I have local changes, but they should not affect module detection at all (New protocols / options added for testing).
Sadly I'm _very_ low on time right now, but I'll test with older revisions tomorrow (In case my family gives me some spare time )
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
btoschi wrote: Sadly I'm _very_ low on time right now, but I'll test with older revisions tomorrow (In case my family gives me some spare time )
And you have to work on some protocols too : UDI, MJX
Please Log in or Create an account to join the conversation.
- btoschi
- Offline
- Posts: 151
SeByDocKy wrote: And you have to work on some protocols too : UDI, MJX
True.
Luckily the Jiayuan "Guard of Space" Quadcopter I got very cheap is a simple V202 rebrand, as such no new protocol added to my list, same with NincoAir Quadrone (V222 rebrand with huge canopy). *phew*
Please Log in or Create an account to join the conversation.
- btoschi
- Offline
- Posts: 151
I downgraded deviation source to changeset from Apr 17 using
hg checkout 2311:c76900a50e89
Having CC2500 enabled lets TX reboot immediately after pressing "OK" Button.
Disabling CC2500 will lead to TX complaining about missing CYRF and missing NRF, and reboot after pressing "OK" Button.
Someone able to give me a "crash-course" on how deviation boots up / debugging this issue can go on (That's my usual job, when I'm not writing new Bugs. err. Software ) ?
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
btoschi wrote: Update on Deviation issue:
I downgraded deviation source to changeset from Apr 17 usingI have no longer problems with CYRF not being detected and all modules but the CC2500 are detected properly (which is the same status as I had before with this module, the other one has no CC2500 on it).hg checkout 2311:c76900a50e89
Having CC2500 enabled lets TX reboot immediately after pressing "OK" Button.
Disabling CC2500 will lead to TX complaining about missing CYRF and missing NRF, and reboot after pressing "OK" Button.
Someone able to give me a "crash-course" on how deviation boots up / debugging this issue can go on (That's my usual job, when I'm not writing new Bugs. err. Software ) ?
I think, in my first attempt to build the MM, I had such behaviour. Everything was ok until I installed the CC2500. In this case, the TX was rebooting like you after pressing OK. You should check your CC2500 connextion. Do you try the MM with closed devo ? coz I found that the cover was pressing on the MM especially on the CC2500 ....
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
btoschi wrote:
SeByDocKy wrote: And you have to work on some protocols too : UDI, MJX
True.
Luckily the Jiayuan "Guard of Space" Quadcopter I got very cheap is a simple V202 rebrand, as such no new protocol added to my list, same with NincoAir Quadrone (V222 rebrand with huge canopy). *phew*
Good to know. I will add them in the Supported model list
S-2 model
www.toy63.com/cp/html/?5586.html
Please Log in or Create an account to join the conversation.
- btoschi
- Offline
- Posts: 151
SeByDocKy wrote: You should check your CC2500 connextion. Do you try the MM with closed devo ? coz I found that the cover was pressing on the MM especially on the CC2500 ....
I've triple checked all MM connections with my multimeter, all is looking okay to me.
The Multimodule is outside of my devo (case still openede, of course), since I have soldered ribbon cable with motherboard connector into my devo so I can switch MultiModules easily.
On first attempt I only had non-PA RF modules laying around, so I though about an easy way to switch the Multi Module later.
Interestingly when I disable all modules besides the MultiModule, I can use CYRF protocols once
I have even replaced batteries (eneloop, at > 5.1V).
Edit:
Found the "solution":
Having throttle not fully pulled down, the safe value warning screen appears (seems to hinder the other to show up ???)
Edit2:
Found the solution to the "missing CYRF" issue: My USB connection (!)
When having original Walkera USB cable plugged into my PC front panel, I'm getting missing CYRF, simply unplug the cable and all is fine.
MM with RF modules is detected properly (CC2500 still not found).
The TX does reboot when selecting any NRF-based protocol (even when MM is not attached). FlySky is partially working (can toggle lights on my V959), but throttle has no effect at all.
My old MM is sometimes not detected on startup - but A7105 (FlySky/V959) and nRF (V272) are working as expected.
This reduces my issues to my second multi module and the CC2500 plus NRF combination.
Edit3:
Testing with recent version from PB's repository (changeset: 2332:3b623a8d08f5) shows no real difference, besides the reboot when using nRF is no longer there (endless loop waiting for Packet ACK refactored into simple check in callback - great !).
V2x2 bind stays at "0" forever and does not work - nRF seems to be not reacting at all.
I'll attach my LA then ...
Please Log in or Create an account to join the conversation.
- btoschi
- Offline
- Posts: 151
Ground / USB issue again, I guess.
I can see the nRF Module is sent SPI commands E1, E2, FF, 07 FF, 20 08 (which look fine to me) and always returns 20 as status via MISO.
Please Log in or Create an account to join the conversation.
- phantom8
- Offline
- Posts: 109
btoschi wrote: Edit3:
Testing with recent version from PB's repository (changeset: 2332:3b623a8d08f5) shows no real difference, besides the reboot when using nRF is no longer there (endless loop waiting for Packet ACK refactored into simple check in callback - great !).
V2x2 bind stays at "0" forever and does not work - nRF seems to be not reacting at all.
I'll attach my LA then ...
Your V2x2 binding problem is the same as mine. This is because the CE pin of the NRF chip has been mistakenly set to active low when you pressed the bind button. Refer to my previous post for details.
Please Log in or Create an account to join the conversation.
- btoschi
- Offline
- Posts: 151
phantom8 wrote: Your V2x2 binding problem is the same as mine. This is because the CE pin of the NRF chip has been mistakenly set to active low when you pressed the bind button. Refer to my previous post for details.
True.
This issue looks like a regression from change 2231 which introduced reset of modules on initialization.
v202 code never calls NRF24L01_SetTxRxMode(TX_EN), but NRF_Reset() calls NRF24L01_SetTxRxMode(TXRX_OFF), thus radio stays disabled.
Disabling CE_lo() will keep radio "alive" and the config register is written by protocol initialization code, thus all is fine.
Proper fix is to call NRF24L01_SetTxRxMode(TX_EN) in
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
btoschi wrote:
phantom8 wrote: Your V2x2 binding problem is the same as mine. This is because the CE pin of the NRF chip has been mistakenly set to active low when you pressed the bind button. Refer to my previous post for details.
True.
This issue looks like a regression from change 2231 which introduced reset of modules on initialization.
v202 code never calls NRF24L01_SetTxRxMode(TX_EN), but NRF_Reset() calls NRF24L01_SetTxRxMode(TXRX_OFF), thus radio stays disabled.
Disabling CE_lo() will keep radio "alive" and the config register is written by protocol initialization code, thus all is fine.
Proper fix is to call NRF24L01_SetTxRxMode(TX_EN) inv202_init()v202_init2(), the same applies for every other NRF protocol, besides NE260.
Good find
Now on the UDI !!!! protocol
Please Log in or Create an account to join the conversation.
- phantom8
- Offline
- Posts: 109
btoschi wrote: True.
This issue looks like a regression from change 2231 which introduced reset of modules on initialization.
v202 code never calls NRF24L01_SetTxRxMode(TX_EN), but NRF_Reset() calls NRF24L01_SetTxRxMode(TXRX_OFF), thus radio stays disabled.
Disabling CE_lo() will keep radio "alive" and the config register is written by protocol initialization code, thus all is fine.
Proper fix is to call NRF24L01_SetTxRxMode(TX_EN) inv202_init()v202_init2(), the same applies for every other NRF protocol, besides NE260.
Well done! Just tested your fix and it's working well. Thanks for the proper fix.
Please Log in or Create an account to join the conversation.
- victzh
- Offline
- Posts: 1386
btoschi wrote:
phantom8 wrote: Your V2x2 binding problem is the same as mine. This is because the CE pin of the NRF chip has been mistakenly set to active low when you pressed the bind button. Refer to my previous post for details.
True.
This issue looks like a regression from change 2231 which introduced reset of modules on initialization.
v202 code never calls NRF24L01_SetTxRxMode(TX_EN), but NRF_Reset() calls NRF24L01_SetTxRxMode(TXRX_OFF), thus radio stays disabled.
Disabling CE_lo() will keep radio "alive" and the config register is written by protocol initialization code, thus all is fine.
Proper fix is to call NRF24L01_SetTxRxMode(TX_EN) inv202_init()v202_init2(), the same applies for every other NRF protocol, besides NE260.
Do you have a patch I can take a look at?
Please Log in or Create an account to join the conversation.
- btoschi
- Offline
- Posts: 151
I tested V2x2 protocol with my V272, which works fine, and YD717 with my SH6044 (which binds, but control is not accurate due to protocol differences I'll need to figure out) but the general strategy was simple: Place the enable right before PWR_UP bit gets set, so it should do the expected thing.
Note that some registers are written multiple times now (many init2() methods flushes pipes, which NRF24L01_SetTxRxMode(TX_EN) does, too, same with PWR_UP / CRC setup).
But I found that when removing the second write to the config register for V2x2 (after calling TX_EN) the fix no longer works. Maybe a timing issue. But before checking this and cleaning up code, we need ppl to test the other protocols, I'd say.
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
Please Log in or Create an account to join the conversation.
- hexfet
- Away
- Posts: 1891
Builds attached for 7e and 10.
Please Log in or Create an account to join the conversation.
- btoschi
- Offline
- Posts: 151
It seems like in that case we're not talking with MM, but someone/thing else ...
But that is not the only issue here.
Here is a sample printout (Since I've prefixed my output by method name it should be easy to follow even w/o exact source modification) where most MM communication seems to be working, but still chips won't "talk back" properly.
RNG Seed: 3c86bb81
port: ffffffff pin: 0001
port: ffffffff pin: 0003
port: ffffffff pin: 0402
port: 40010800 pin: 2000
Switch port: 40010800 pin: 2000
CYRF6936 port: 40010c00 pin: 1000
SPI_ConfigSwitch(): csnhi 0e csnlo 0e byte1 3c (expected a5) byte2 00 (AVR code version)
PROTOCOL_Load() protocol 1 (module 0) SetSwitch returned 0
num data: 66 data size: 88
SPI_ConfigSwitch(): csnhi 0e csnlo 0e byte1 38 (expected a5) byte2 01 (AVR code version)
SPI_ConfigSwitch(): csnhi 0e csnlo 0e byte1 e3 (expected a5) byte2 f0 (AVR code version)
PROTOCOL_Load() protocol 1 (module 0) SetSwitch returned 0
CYRF_reset(): FRAMING_CFG is 6f
SPI_ConfigSwitch(): csnhi 0e csnlo 0c byte1 a5 (expected a5) byte2 03 (AVR code version)
PROTOCOL_Load() protocol 8 (module 1) SetSwitch returned 3
A7105_Reset(): Reg 0x10 was 9e
SPI_ConfigSwitch(): csnhi 0e csnlo 06 byte1 a5 (expected a5) byte2 03 (AVR code version)
PROTOCOL_Load() protocol 10 (module 2) SetSwitch returned 3
CC2500_Reset(): CC2500_0E_FREQ1 is 2a CC2500_30_PARTNUM is 88 CC2500_31_VERSION is 50
SPI_ConfigSwitch(): csnhi 16 csnlo 12 byte1 a5 (expected a5) byte2 03 (AVR code version)
PROTOCOL_Load() protocol 13 (module 3) SetSwitch returned 3
SPI_ConfigSwitch(): csnhi 0f csnlo 0b byte1 4a (expected a5) byte2 06 (AVR code version)
NRF24L01_Reset(): status1 is c4 status2 is 85
SPI_ConfigSwitch(): csnhi 02 csnlo 02 byte1 a5 (expected a5) byte2 03 (AVR code version)
I wonder why the MM gets programmed for the CYRF (I use the buildin module, but 0e means make PORTA0 on MM low = active, which is CYRF_CSN). May that be the cause for CYRF not being properly detected ?
Edit:
Looking again at the output, the last line looks scary:
SPI_ConfigSwitch(): csnhi 02 csnlo 02
Edit2:
Comparing output when turning TX off and on multiple times, one can see that the "readout" of the modules in the reset method reproduces a part of a sequence, which is shifted around:
CC2500_Reset(): CC2500_0E_FREQ1 is 15 CC2500_30_PARTNUM is 2a CC2500_31_VERSION is 88
CC2500_Reset(): CC2500_0E_FREQ1 is 2a CC2500_30_PARTNUM is 88 CC2500_31_VERSION is 50
(it looks like we're getting the very same sequence starting at some point regardless of what command we send - indicating we're not talking with the RF chip at all)
Edit3:
These are all sequences I was able to find:
CC2500_Reset(): CC2500_0E_FREQ1 is 15 CC2500_30_PARTNUM is 2a CC2500_31_VERSION is 88
50 16 cf 0c c0 20 20 20 20 20 20 20 20 20 20 20
CC2500_Reset(): CC2500_0E_FREQ1 is 2a CC2500_30_PARTNUM is 88 CC2500_31_VERSION is 50
16 cf 0c c0 20 20 20 20 20 20 20 20 20 20 20 20
CC2500_Reset(): CC2500_0E_FREQ1 is 0a CC2500_30_PARTNUM is 15 CC2500_31_VERSION is 44
a8 0b e7 06 60 10 10 10 10 10 10 10 10 10 10 10
CC2500_Reset(): CC2500_0E_FREQ1 is 3c CC2500_30_PARTNUM is 3c CC2500_31_VERSION is 3c
3c 3c 3c 3c 3c 3c 3c 3c 3c 3c 3c 3c 3c 3c 3c 3c
CC2500_Reset(): CC2500_0E_FREQ1 is 10 CC2500_30_PARTNUM is 10 CC2500_31_VERSION is 10
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
Anyone has an idea which chip in Devo8S could always respond with
15 2a 88 50 16 cf 0c c0 20
For reference my hardware.ini (commented lines removed) is
[modules]
enable-a7105 = S1
has_pa-a7105 = 1
enable-cc2500 = S3
has_pa-cc2500 = 1
enable-nrf24l01 = S402
has_pa-nrf24l01 = 1
enable-multimod = A13
Digging deeper into the code ...
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Topic Author
- Offline
- Posts: 4402
As you've probably noticed, I'm currently focused on the single-board universalTx module. All of my programming time is currently going into getting it enabled. I won't leave the multimod stuff hanging though. You'll just likely have to wait until we've got the UniversalTx board up and running.
Please Log in or Create an account to join the conversation.
- rob
- Offline
- Posts: 2
I'm surprised by the quality of the info/work on this forum, hats off to the developers!
Planning to buy a devo 10 for my helis, I like this multimodule.
What I don't like are the multiple antennas... I would need 3 modules so 4 external antennas seems a bit messy
I heard that those modules shouldn't powered without antenna/resistor wired in.
- Is there a dirty way (without programming) to only use one antenna for all the modules wired to the MM? (so just 2 total antennas, one for mm modules and one stock devo)
I mean using some kind of rotary multi pole/ways switch to manually commute them between dummy resistor or antenna?
Or wiring antenna signals through a small not shielded rotary switch is a bad idea? (for signal/interferences)
asking because electronics is not my field
is single-antenna on MM dev plans, like a new rev of board, or should I wait the ultimate single board module in the other topic?
Roberto
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- Developing a universal module