This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

sending something else and receiving something else!

Im sending an 8 bit int using my AVR controller as follows:

 static uint8_t* dummy_heart_rate = 6;

  aci_loop();
  
  if (lib_aci_is_pipe_available(&aci_state, PIPE_UART_OVER_BTLE_UART_TX_TX))
  {
	  lib_aci_send_data(PIPE_UART_OVER_BTLE_UART_TX_TX, dummy_heart_rate, 1);
	  aci_state.data_credit_available--;
      PORTD |= (1 << PORTD6);
  }
  
  _delay_ms(100);
  PORTD &= ~(1 << PORTD6);

but im reciving wrong data back in the nordic app , I get 0x00 and when I send 65 I get @ in the nordic toolbox app , then again if I send something else like an 8 then I receive something else instead of an 8 on nodic app I get 0x00? whats happening ?

If I send 45 as a char variable then I get � character with 0xC0 which is correct in the Ascii table, what Im doing wrong?

Parents
  • @Nishant: I have to admit that I don't have much experience with nRF8001 and AVR, but which library did you use. Have you tried the Arduino SDK for nRF8001 ? I was suspecting that the nRFToolbox may interprete it to heartrate value so it may be incorrect, but as you said it's the same with nRFMaster Control Panel.

    Endianness could be the problem here. Could you try with the following value and let me know the result: 127 - 128 - 129

Reply
  • @Nishant: I have to admit that I don't have much experience with nRF8001 and AVR, but which library did you use. Have you tried the Arduino SDK for nRF8001 ? I was suspecting that the nRFToolbox may interprete it to heartrate value so it may be incorrect, but as you said it's the same with nRFMaster Control Panel.

    Endianness could be the problem here. Could you try with the following value and let me know the result: 127 - 128 - 129

Children
No Data
Related