Experiences with CYWM6935 as spectrum analyzer

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello!

I'm triying to use a CYWM6935 2.4 GHz data module as simple spectrum analyzer to the 2.4 GHz band, something like this: http://www.elektor-electronics.co.uk/magazines/2007/june/2-4-ghz-wifi-spectrum-analyser.91864.lynkx but with an ATMEGA8 and a graphical LCD.

The problem is I found this module too dificult to use and very erratic. I have found some C snipets around and none of them seems to work fine. My application just draw lines with length equal to the RSSI read from the module, in this way:

while(1){
	// From 2400 to 2483 MHz
	for (unsigned char n=0; n<84; n++){

	// Draw blank line (erase the previous one)
	LCD_Line(n,0,n,31,PIXEL_OFF);

	// Draw a line of RSSI pixels length
	LCD_Line(n,31,n,31-RADIO_RSSI(n),PIXEL_ON);
	}
	// Update the LCD
	LCD_Update();
}

The module datasheet says:

Quote:

To check for a quiet channel before transmitting, first set up receive mode properly and read the RSSI register (Reg 0x22). If the valid bit is zero, then force the Carrier Detect register (Reg 0x2F, bit 7=1) to initiate an ADC conversion. Then, wait greater than 50uS and read the RSSI register again. Next, clear the Carrier Detect Register (Reg 0x2F, bit 7=0) and turn the receiver OFF.

And my implementation:

unsigned char RADIO_RSSI(unsigned char channel){
	unsigned char value;

	// Set channel	
	RADIO_Write(REG_CHANNEL,channel);

	// Turn receiver on
	RADIO_Write(REG_CONTROL,0x80);
	
	// Read RSSI
	value=RADIO_Read(REG_RSSI);

	// Check valid rssi
	if ((value & 0x20)==0){
		// Not valid, force conversion
		RADIO_Write(REG_CARRIER_DETECT,0x80);
		_delay_ms(55);
		value=RADIO_Read(REG_RSSI);
		RADIO_Write(REG_CARRIER_DETECT,0x00);
	}
	// Turn receiver off
	RADIO_Write(REG_CONTROL,0x00);
	return (value & 0x1F);
}

The function always return zero.

I tried the code on http://1010.co.uk/spectrumtest.c and the same, always return zero. I tried also the original code written for the LPT port at http://www.wireless.org.au/~jhec... and again, the function always return zero.

Later, after many searches on the web, I found this page:

http://www.psocdeveloper.com/forums/viewtopic.php?f=3&t=4602

and I implemented it exactly, both initialization and RSSI reading. Again, the function always return zero.

I modified the routine to meet the datasheet, in this way:

unsigned char RADIO_RSSI(unsigned char channel){
	unsigned char value;
	RADIO_Write(REG_CHANNEL,channel); // Set channel
	RADIO_Write(REG_CONTROL,0x90);    // Put radio in receive mode - triggers rssi adc
	_delay_us(200);                   // wait for synth to settle
	_delay_us(35);                    // wait for receiver ready
	_delay_us(50);                    // wait for 5-bit rssi adc to complete
	value=RADIO_Read(REG_RSSI);       // Get RSSI
	while ((value & 0x20)==0){        // Repeat if RSSI is not valid
		RADIO_Write(REG_CARRIER_DETECT,0x80); // force radio to acquire rssi
		_delay_us(50);                        // wait for rssi adc to complete	
		value=RADIO_Read(REG_RSSI);           // Get RSSI
		RADIO_Write(REG_CARRIER_DETECT,0x00); // Clear carrier detect override
	}
	RADIO_Write(REG_CONTROL,0x00);  // put radio in idle mode
	return(value & 0x1F);	
}

I always get a valid RSSI value equal to zero. Of course, I have some strong test signals: Some wifi links, and a pair of carriers from wireless cameras in the same room, so something must be detected...

Any ideas or experiences with this module??

Last Edited: Thu. Sep 13, 2018 - 04:20 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello again!

I solved the problem in a very strange way... in fact I'm still perplexed!!!

The CYWM6935 module is build around the CYWUSB6935, a 3.3 volt device.

Well, fortunately for me, I was using a variable bench power supply instead of a 3.3 volt regulator, and a small mistake solved my problem.

Acording to the datasheet, the CYWM6935 module is rated from 2.7 up to 3.6 volts, being 3.3 the nominal value, and that was the voltage I was using,

But a little mistake made me to supply the module with only 2.5 volts and something changed in the display, so I tested the module at different voltages:

From 2.7 up to 3.0 volts the RSSI output is fixed at 15:

From 3.0 up to 3.4 volts the RSSI output is fixed at 0:

From 3.4 up to 3.6 volts the RSSI output is only random (just noise) with values oscilating from 3 or 4 up to 8 or 10:

From 3.6 up to 4.0 volts the RSSI output works fine, I can see my wifi and wireless camera signal without problems. Ranging from 3.6 to 3.8 seems to have less sensivity to weak signals that working in the range 3.8 to 4.0 volts:

Here you can se a wireless camera signal at 2468 MHz.

The "7" at the lower corner is the value of the REG_ID register, just to check the module is working.

I don't know if my module is a 5V version or something like that but I must admit this is the first time I see something like this. I guess I should mount an adjustable voltage regulator at the final version of the project :o)

I hope my experience to be useful to someone else.

Bye!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Put a meter right at the module and measure the voltage. Perhaps you have a high loss somewhere in your circuit for some reason.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No, voltages are measured at the module pins... Curious, isn't it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you certain of your voltmeter? Do you have another to cross check?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, 3 digital volmeter, and two analog ones plus an oscilloscope and the power supply build-in voltmeter. All of them measures the same amount +/- tolerances (in the 1/100 of volt).

I'm sure this module is damaged in some way... I'll try to get another one in few days and test it at 3.3 volts, so stay tuned...

Byee!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The new module arrived and works nicely down to 2.6 volts.

You can see it working at http://ea4eoz.ure.es/hsa.html

Any ideas will be welcomed. Byeee!!!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice reuse of an old cell phone.

Why did you cut of Antenna2?

ea4eoz wrote:
Any ideas will be welcomed.

How about adding an option to dispaly the 14 different 802.11b/g channels use on the X-axis instead of displaying the frequncy from 2400 kHz to 2495 kHz?
This could be useful if you want to see what channel is best to use when setting up a wireless router.

Here's a couple of examples displaying Channel Use of the different 802.11b/g channels:

http://www.passmark.com/products/wirelessmonitor.htm

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AndersAnd wrote:

Why did you cut of Antenna2?

If you don't cut the TX antenna, the module does not fit in the phone's antenna space.

AndersAnd wrote:

How about adding an option to dispaly the 14 different 802.11b/g channels use on the X-axis instead of displaying the frequncy from 2400 kHz to 2495 kHz? This could be useful if you want to see what channel is best to use when setting up a wireless router.

Nice idea!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

All,

 

Does anyone know where I can purchase these CYWM6935 modules? Or do any of you have any?

 

Let me know, M

Topic locked