ZakKemble / Si446x

Si4463 Radio Library for AVR and Arduino
https://blog.zakkemble.net/si4463-radio-library-avr-arduino/
GNU General Public License v3.0
75 stars 29 forks source link

Carrier wave. #6

Open se5a opened 3 years ago

se5a commented 3 years ago

Trying to get a carrier wave on a si4463 and Arduino UNO, and trying to detect it with a cc308+ I'm successfully talking to the chip and printing to the serial monitor, though when I try to

  si446x_info_t* info;
  Si446x_getInfo((si446x_info_t*)info);

It appears to freeze up at this point, and I stop getting anything printed to the Serial. Other things like Si446x_getState, Temprature, and getProperty apear to work fine. (I added getProperty to Si446x.h). I created a function to setProperty((SI446X_PROP_GROUP_MODEM<<8) | 0x00, 0x18); to the library and I'm calling that from the arduino code, I'm reading the property before and after and can see the property getting changed. however I'm not picking anything up on the cc308+. Do I still need to send a command to start transmitting? if so what command arguments need to be sent? I think I partially understand what's going on with setting properties and the si446x api, ie in the above you're ORing the group (MODEM 0x20) and the index (MODTYPE 0x00) and setting it to 0x18. I'm not quite seeing what the 0x18 is though.

This was helpful: https://cu-taber.github.io/Si4463-API/#details_prop_grp_MODEM but I feel like I'm being dense with understanding what the hex values that we're setting it to are.

ZakKemble commented 3 years ago

Heya, you've defined a pointer to a si446x_info_t struct, but not allocated any memory, so it ends up writing to somewhere random and corrupts the RAM. Have a look here on how to use getInfo().

0x18 is 00011000 in binary. So what you're doing there is setting MOD_SOURCE to 3, which is an invalid value (bit positions 3 and 4 control the MOD_SOURCE value, and binary 11 is decimal 3). I think you should be setting the property value to 0x10 which will select CW for the MOD_TYPE and PSEUDO for the MOD_SOURCE. I'm not sure if that will work though, I've not tried making the radio transmit a blank carrier wave before.

se5a commented 3 years ago

Ah! that makes a lot more sense now, I see how the values work, I wasn't seeing that the numbers represented the position of the binary bits. I still didn't detect anything but at least it's a little less of a mystery now, (I got the 0x18 from a reply to your blog). Cheers and thanks for the reply.

ZakKemble commented 3 years ago

Ohh oops, yeah 0x18 is wrong in that blog comment, should have been 0x10, fixed now :P

I suppose making it transmit a load of data over and over again should get you close enough to a CW that the bug detector might detect it.