Microchip Studio with ATtiny1627 Curiosity Nano

Prerequisites

Workflow

  1. 1. Launch Microchip Studio 7.0.
  2. 2.The page shown below will appear when ATtiny1627 Curiosity Nano is connected to Atmel Studio 7.0.
    Figure 1. ATtiny1627 Curiosity Nano Page in Microchip Studio
  3. 3. Start creating a new project by clicking New → Project... or by using the Ctrl+Shift+N shortcut, as shown in Figure 2.
    Figure 2. Create New Project in Microchip Studio
  4. 4.Select the GCC C Executable Project template, as shown in Figure 3, type in the name of the solution and project (e.g., GETTING_STARTED and LED_TOGGLE), and click OK.
    Figure 3. New Project Wizard
  5. 5.Select ATtiny1627 as shown in Figure 4, and click OK.
    Figure 4. Device Selection Wizard
    A new project with a main.c file associated will be generated in Microchip Studio.
  6. 6.Replace the main.c file with the following code snippet:
    int main (void)
    {
      /* Configure SW0 as input */
      PORTC.DIRCLR = PIN4_bm;
      /*Enable internal pull up for SW0*/
      PORTC.PIN4CTRL  = PORT_PULLUPEN_bm; 
      /* Configure LED0 pin as output */
      PORTB.DIRSET = PIN7_bm;
    	
      while (1)
      {
        /* Check the status of SW0 */
        /* 0: Pressed */
        if (!(PORTC.IN & (PIN4_bm)))
        {
          /* LED0  off */
          PORTB.OUTSET = PIN7_bm;
        }
        /* 1: Released */
        else
        {
          /* LED0 on */
          PORTB.OUTCLR = PIN7_bm;
        }
      }
    }
    In the code editor, the code will appear, as shown in Figure 5.
    Figure 5. Code Editor Window
  7. 7.Open project properties by clicking Project → Properties or by using the ALT+F7 shortcut.
  8. 8.In the Tool view (see Figure 6), set Selected debugger/programmer to nEDBG and Interface to UPDI.
    Figure 6. Debugger and Interface for ATtiny1627
  9. 9.Build the project by clicking Build → Build Solution or by using the F7 shortcut.
  10. 10. Program ATtiny1627 with the project code and start debugging by clicking Debug → Start debugging and break or by using the ALT+F5 shortcut. The application is programmed onto the device, and program execution will break in the main() function.
  11. 11.Run the code by clicking Debug → Continue or by using the F5 shortcut.
  12. 12.Verify that LED0 is lit when SW0 is pushed on the ATtiny1627 Curiosity Nano.