Xmega BitCloud adc HAl_AdcDescriptor_t tty

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

Hi,

I am using ATZB-X-233-Pro and bitcloud, it is hard to understand tty in HAL_AdcDescriptor_t

for this particular board, it has only 4 analog channels A0-A4, in halAdc.h there is a  definition

#define ADC_HW_CHANNEL_AMOUNT 8
#define ADC_HW_A               0x0200
#define ADC_HW_CHANNEL_A0      ADC_HW_A + 0x20
#define ADC_HW_CHANNEL_A1      ADC_HW_A + 0x28
#define ADC_HW_CHANNEL_A2      ADC_HW_A + 0x30
#define ADC_HW_CHANNEL_A3      ADC_HW_A + 0x38
#define ADC_HW_B               0x0240
#define ADC_HW_CHANNEL_B0      ADC_HW_B + 0x20
#define ADC_HW_CHANNEL_B1      ADC_HW_B + 0x28
#define ADC_HW_CHANNEL_B2      ADC_HW_B + 0x30
#define ADC_HW_CHANNEL_B3      ADC_HW_B + 0x38

and the other definition

typedef enum
{
  /** \brief channel ADC0 */
  HAL_ADC_CHANNEL0 = 0,
  /** \brief channel ADC1 */
  HAL_ADC_CHANNEL1 = 1,
  /** \brief channel ADC2 */
  HAL_ADC_CHANNEL2 = 2,
  /** \brief channel ADC3 */
  HAL_ADC_CHANNEL3 = 3,
  /** \brief channel ADC4 */
  HAL_ADC_CHANNEL4 = 4,
  /** \brief channel ADC5 */
  HAL_ADC_CHANNEL5 = 5,
  /** \brief channel ADC6 */
  HAL_ADC_CHANNEL6 = 6,
  /** \brief channel ADC7 */
  HAL_ADC_CHANNEL7 = 7,
  /** \brief ADC0 - ADC1 */
  HAL_ADC_DIFF_CHANNEL0 = 8,
  /** \brief ADC0 - ADC4 with gain 64x */
  HAL_ADC_DIFF_CHANNEL1 = 9,
  /** \brief internal signal connected to the temperature sensor */
  HAL_ADC_TEMPERATURE = 10,
  /** \brief internal signal connected to DAC */
  HAL_ADC_DAC = 11,
  /** \brief internal signal connected to VCC divided by 10 */
  HAL_ADC_VCC_SCALED = 12,
  /** \brief internal signal connected to bandgap */
  HAL_ADC_BANDGAP = 13,
  // max channel number
  HAL_ADC_MAX_CHANNEL_NUMBER
} HAL_AdcChannelNumber_t;

if I want read channel A3 should I put

ADC_HW_CHANNEL_A3

in HAL_AdcDescriptor and

 HAL_ADC_CHANNEL3

in readADC like this

HAL_ReadAdc(&adcDescriptor,HAL_ADC_CHANNEL3);

?, am I right?

 

and if i want to read channel of

HAL_ADC_TEMPERATURE

which parameter should I put in for tty?

 

Thanks you much for you help.

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

First of all BitCloud for Xmegas is no longer supported.

 

Peripheral driver library in BitCloud is not designed to be comprehensive. Just forget it exists and write your own driver.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

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

Thanks.

Should I switch my project to MegaRF or ARM?

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

I'd personally go with ARM. You get more memory options (both Flash and RAM), faster frequency, 32-bit architecture and potential for growth.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.