AVR DA and DB series boards

This year Microchip announced two new ranges of AVR chips called the AVR DA series and AVR DB series, which take the AVR architecture to a new level. The DA and DB series parts run at up to 24 MHz and have up to 128 Kbytes of flash and 16 Kbytes of RAM. They include a DAC and 12-bit analogue inputs, in addition to the new features introduced with the ATmega 0-series such as the event system and Configurable Custom Logic. 

The DB-series parts include all this, plus:

  • Eight I/O pins with Multi-Voltage I/O (MVIO), allowing them to operate at a different voltage from the positive supply.
  • Analogue OPAMP peripheral with three op amps that can be used as amplifiers, unity gain buffers, programmable gain amplifiers (PGAs), or instrumentation amplifiers.

The naming of the new parts follows a new scheme, which is more logical than the earlier AVR naming conventions. Each device is named AVRmmmDApp or AVRmmmDBpp, where mmm is the amount of flash, and pp is the number of pins.

Microchip has made Curiosity Nano evaluation boards available for the AVR128DA48 and AVR128DB48, both based on the 48-pin chip with the largest amount of flash memory, and uLisp now supports both of these.

Installing uLisp from the Arduino IDE

  • First download the latest AVR version of uLisp from the Download uLisp page.
  • Install Spence Konde's DxCore from GitHub, as described in DxCore – Installation.
  • Connect the Curiosity Nano to the computer with a USB cable.

CURIOSITY drive will be mounted on your desktop.

  • On the Board menu, under the heading DxCore select AVR DA-series (no bootloader) or AVR DB-series (no bootloader) as appropriate.
  • Check that the subsequent options are set as follows (ignore any other options):

Chip: "AVR128DA48" or "AVR128DB48"
Clock Speed: "24MHz internal"

Currently Spence Konde's DxCore doesn't support uploading programs via USB using the Curiosity Nano's built-in debugger, but instead you can easily upload a binary by dragging it to the CURIOSITY drive, as follows:

  • Select Export compiled Binary from the Arduino IDE's Sketch menu.

This will create a .lst and a .hex file in your Arduino project folder for the uLisp source.

  • Drag the .hex file into the CURIOSITY drive to upolad uLisp.

You should then be able to select Serial Monitor from the Tools menu, and enter Lisp commands.

AVR128DA48 Curiosity Nano

Microchip's AVR128DA48 Curiosity Nano evaluation board [1] makes a very low-cost platform for running uLisp.

The board includes a debugger, providing a USB-to-serial interface, which is connected to Serial1:

AVR128DA48.jpg

It's available from suppliers such as Farnell [2].

LED

The Curiosity Nano has a yellow LED connected to pin 20 which you can flash with the following program:

(defun blink (&optional x)
  (pinmode 20 :output)
  (digitalwrite 20 x)
  (delay 1000)
  (blink (not x)))

Run it by typing:

(blink)

Exit from the program by entering ~.

You can save the blink program to EEPROM by typing the command:

(save-image)

You can now load it again after a reset by typing:

(load-image)

Note that there's not much EEPROM on the AVR128DA48, so you will be limited in the size of program you can save with save-image.

Button

The Curiosity Nano has a user button connected between pin 21 and GND which you can test with the following program:

(defun test ()
  (pinmode 21 :input-pullup) 
  (loop
   (print (digitalread 21)) 
   (delay 1000)))

I2C

I2C is available from pins PA2 (SDA) and PA3 (SCL) on the Curiosity Nano edge connector (not the two TWI0 pins shown on the pinout diagram in the Curiosity Nano User Guide). External I2C devices can be powered by connecting them to VBUS and GND on the Curiosity Nano edge connector.

Note

You can use the note function with Arduino pins 38 and 39, which are available on the edge connector pins PF4 and PF5 respectively. The following example plays the scale of C on a piezo speaker connected to PF4 and GND:

(defun scale () 
  (mapc 
   (lambda (n) (note 38 n 4) (delay 500))
   '(0 2 4 5 7 9 11 12)) 
  (note))

Analogue inputs

The AVR DA series chips support 12-bit analogue readings with analogread. By default they are 10-bit for compatibility with other Arduino boards, but you can select 12-bit with:

(analogreadresolution 12)

The analogue reference voltage can be selected with analogreference. For example:

(analogreference :internal2v048)

The options are :vdd or :default:internal1v024, :internal2v048, :internal4v096, :internal2v5, or :external.

In addition to specifying a pin number to analogread you can also specify one of the following keywords:

  • :adc-dac0 reads the value being output by DAC0.
  • :adc-temperature reads the internal temperature sensor.

AVR128DB48 Curiosity Nano

Microchip's AVR128DB48 Curiosity Nano evaluation board [3] makes a very low-cost platform for running uLisp.

The board includes a debugger, providing a USB-to-serial interface, which is connected to Serial3:

AVR128DB48.jpg

It's available from suppliers such as Farnell [4].

LED

The Curiosity Nano has a yellow LED connected to pin 20 which you can flash with the following program:

(defun blink (&optional x)
  (pinmode 20 :output)
  (digitalwrite 20 x)
  (delay 1000)
  (blink (not x)))

Run it by typing:

(blink)

Exit from the program by entering ~.

You can save the blink program to EEPROM by typing the command:

(save-image)

You can now load it again after a reset by typing:

(load-image)

Note that there's not much EEPROM on the AVR128DB48, so you will be limited in the size of program you can save with save-image.

Button

The Curiosity Nano has a user button connected between pin 21 and GND which you can test with the following program:

(defun test ()
  (pinmode 21 :input-pullup) 
  (loop
   (print (digitalread 21)) 
   (delay 1000)))

I2C

I2C is available from pins PA2 (SDA) and PA3 (SCL) on the Curiosity Nano edge connector (not the two TWI0 pins shown on the pinout diagram in the Curiosity Nano User Guide). External I2C devices can be powered by connecting them to VBUS and GND on the Curiosity Nano edge connector.

Note

You can use the note function with Arduino pins 38 and 39, which are available on the edge connector pins PF4 and PF5 respectively. The following example plays the scale of C on a piezo speaker connected to PF4 and GND:

(defun scale () 
  (mapc 
   (lambda (n) (note 38 n 4) (delay 500))
   '(0 2 4 5 7 9 11 12)) 
  (note))

Analogue inputs

The AVR DA series chips support 12-bit analogue readings. By default they are 10-bit for compatibility with other Arduino boards, but you can select 12-bit with:

(analogreadresolution 12)

The analogue reference voltage can be selected with analogreference. For example:

(analogreference :internal2v048)

The options are :vdd or :default:internal1v024:internal2v048:internal4v096:internal2v5, or :external.

In addition to specifying a pin number to analogread you can also specify one of the following keywords:

  • :adc-dac0 reads the value being output by DAC0.
  • :adc-temperature reads the internal temperature sensor.

Multi-Voltage I/O

The AVR128DB48 provides eight I/O pins with Multi-Voltage I/O (MVIO), allowing them to operate at a different voltage from the positive supply.

To use the MVIO you need to change the MVIO on PORTC option on the Arduino IDE Tools menu to Enabled, and do Burn Bootloader to configure the fuses. You can then provide a voltage on the VDDIO2 pin which will act as the high level voltage for pins on PORTC, corresponding to Arduino pins 14 (PC0) to 21 (PC7).


  1. ^ AVR128DA48 Curiosity Nano User Guide on Microchip.
  2. ^ DM3164151 - Evaluation Board, Curiosity Nano, AVR128DA48 on Farnell.
  3. ^ AVR128DB48 Curiosity Nano Hardware User Guide on Microchip.
  4. ^ EV35L43A - Evaluation Board, Curiosity Nano, AVR128DB48 on Farnell.