AVR Data Sampler Enable

Used to enable polling of locations in memory on an AVR target device. Up to 200 locations can be added to the sampling service, but performance will of course degrade as more locations are added. Only AVR devices with UPDI have this capability.

The command will return a handle, which should be used when disabling the polling function afterwards.

Table 1. AVR Data Sampler
Field Size Description
DATA_SAMPLER 1 byte 0x8A
AVR_DATA_ENABLE 1 byte 0x0B
START_ADDRESS 4 byte

Start address to poll, MSB first.

Must be in the range 0x2000 to 0x3FFF.

LENGTH 4 byte

Number of bytes to poll, MSB first.

Must be set to 1.

FLAGS 4 byte
Bits 1:0: destination:
  • b00: send to DGI as data
  • b01: send to HID (reserved)
  • b10: send to DGI as print
  • b11: reserved

Response:

Table 2. AVR Data Sampler Response
Field Size Description
DATA_SAMPLER 1 byte 0x8A
AVR_DATA_ENABLE 1 byte 0x0B
Status 1 byte

Status code

0x00: OK

0xFF: Error

Handle / error code 1 byte

Sampler handle is returned if Status is OK.

Error code is returned if Status is Error.

Error codes:

Table 3. AVR Data Sampler Error Codes
Error code Value Description
ERROR_FULL 0x92 Too many poll locations are enabled
ERROR_SIZE_EXCEEDED 0x94 Buffer memory is full
ERROR_OUT_OF_RANGE 0x91 The poll location specified is not allowed