[quote author="krishnak"] I followed your advise and connected the remote with the 3.3V power output of the buspirate. [/quote]
Not quite what I suggested, but if it didn't damage your hardware then it proves the power domains are not the problem.
[quote author="krishnak"] However between MOSI and GND it shows 125K. [/quote]
Just to be clear this is the resistance MOSI to GND on the target board, without BP attached.
125K is fairly ''weak'. One would normally have pull ups, but they might be using pull downs (or relying on the inherent input resistance of the RF24L01).
A 'stronger' pull up might be interacting with the pull down and preventing the remote/micro being able to drive the signal low. I still suggest that you use some form of buffer between the MOSI signal and the BP.
[quote author="krishnak"] Does the remote employ some anti snooping mechanism? [/quote]
Most unlikely, vendors don't normally care and engineers are lazy..... Simon
Hi krishnak, you has PM'ed me regarding my previous testing with RF24L01. I was sniffing a USB dongle (cyprus micro driving RF24L01) and from what I remember I had no problem with link dropping when sniffing.
I would suggest that you check the power supply voltages. You might find that your target is using a lower voltage that the BP and therefore having problems when the BP is connected. You may need to buffer the signal(s) before connecting them, I'd suggest a non-inverting O/C driver with input connected to target and output to BP (pulled up to BP's supply with 10K or so).
You should also look at upping the baud rate or you might loose data, I think you can get close to 921K if you use the custom baud rate value (check my older posts). Simon (PM me again if you need more info, as I'm not routinely on this forum)
here are a couple of patches to implete the higher speed connection and clean up the code. You will need to add an include path to the framework directory.
Bugger! I figure out how to get the higher serial speeds working under Linux and then static zap my target board killing the micro's MOSI pin.... just shows 0V with no data :-(
As a side note it would appear that higher speed serial coms is possible with some applications.... 460,800 = 8 (-3.55%) 500,000 = 7 (0%) 576,000 = 6 (-0.79%) 921,600 = 3 (+8.51%) 1,000,000 = 3 (0%)
Under Linux I was able to get Minicom working at 576,000 and 1,000,000 but both Screen and Spisniffer fail. Under Windows I was able to get SerialTerminal working at 576,000 and 1,000,000 but both Hyperterminal and Spisniffer fail.
I guess there must be something in the way different applications setup the serial port. Simon
[quote author="ian"] The 4 byte buffer is just an entry point to the 4096 ring buffer. It takes almost no time to go from SPI->ring buffers, it's the transfer through serial that's really slow. [/quote]
Overall the data rate is low as there is a lot of time between 'packets', however I am focusing on the burst of 35bytes which come at quite a rate. It may take no time to actually perform the transfer between SPI buffer -> ring buffer, but presumably this is on an interrupt and it must some time to service it.
Would it be an option to stay in the 'empty SPI buffer' interrupt until the CS line is de-asserted. That way we could ensure that we'd be as fast as possible, with the side effect of halting the rest of the functions. Obviously this would only work if the ring buffer did not overflow. [I would do this with separate blocks of interrupt code, so there wouldn't be extra comparisons being done when not really needed]
There is a 'raw SPI sniff' commands available, ie. # 00001101 – Sniff all SPI traffic # 00001110 – Sniff when CS low # 00001111 – Sniff when CS high
# 00001100 – Sniff aggressively (lock into SPI interrupt)
[quote author="ian"] I think you already mentioned increasing the serial port speed with a custom BRG setting. [/quote]
Yes I am using '8' to get 460800 baud on the serial link. This works when I sniff the PC end of the link (which is running at a byte period of 16us), but fails at the wheel end (which is running at a byte period of 6.3us).
The next thing for me to try is to sniff the Wheel end of the old (Wii) wheels to see if that fails in the same manner as the new (PS3) wheel, but I might not get to that until after Christmas. Cheers, Simon
On my previous scope traces (on the Dongle end of things) the clock rate was 3.5us between clocks, the period of the bytes was around 16us. On the latest scope traces (the wheel end) the clock rate is still 3.5us between clocks, but the gap between bytes is smaller. The period of the bytes is around 6.3us, meaning that perhaps the PIC can not keep up with micro (on wheel end).
I think that Ian mentioned that there is a 4byte SPI buffer in the PIC, this is obviously no good if you have a burst of 35bytes coming at high speed.
Is there anything which can be done to improve the rate at which bytes can be removed from the SPI buffer? Even if this holds up other functionality on the PIC (as there's plently of dead time between bursts on SPI activity)... I'd even be OK with only seeing data in the IN or OUT direction... Simon.
I did some more thinking on this. Using the data sent from the other end (PC Dongle) of a very similar wheel.... I don't want to mod this wheel's dongle as the wheel was more expensive and I only have 1.
So (if I can count properly) that would be encoded as 180 bytes in the binary format, sent in the course of 8ms. At a baud rate of 460800, that is basically 46080 characters per second = 368 characters in 8ms, which should be (and is) OK.
Even if the new wheel adds a few more bytes to the registers, this would still be under 368character/s and no where near the 4096 bytes of the ring buffer... so why would it fail?
Does this mean that it must be related to the SPI capture speed.... which is dependant on PIC clock. Simon
OK here are some screen caps from a scope. Ch1 Enable, Ch2 Clock. Every 8ms the device sends/rends a short packet (RF config/hop), a medium packet (wheel position) and a long packet (force feedback state).
Clock period = 0.5us Maximum burst rate = 35 bytes in 222us
So it would seem that this is too fast for the BP. Comments? Simon
I did a bit more poking around. If I connect the CLK input to one of the data pins I get a continuous stream of data (fragmented into CS blocks), ie it does not turn off the LED.
Ian suggested that if the capture system overflows then the BP falls out of sniff mode to SPI mode, at which point it would assert the CLK/data lines..... which would explain the failure in the RF link to the PC. This is probably a BAD idea as it will effect the system you are snopping.
I should also mention that I'm runing the serial link at 460800 (custom baudrate = '8'), couldn't get anything higher to work. Is there a way to have the BP just drop the data (not send via serial) so that it can be confirmed whether it is the capture or TX which is too slow?
Brain is completely dead, so I'm going home. I'll try to get a scope on the board tomorrow to confirm the CLK speed. It may be too fast for the BP. :-( Simon