Categories
ATMEL

Installing AVR Development Tools on an iMac

Setting up an iMac to develop software for the Atmel AVR microcontroller (i.e. Not Arduino) is quite straightforward however you do need to have the Homebrew package manager installed.

If you have not got Homebrew then you can install it by opening up a terminal window and entering the following command:-

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 

The AVR development tools can now be installed by entering the following commands in the terminal window:-

brew tap osx-cross/avr
brew install avr-gcc
brew install avrdude

Once this has been done a single source file containing an AVR program can be compiled for an AVR microcontroller as follows (update microcontroller to reflect the one you are using):-

avr-gcc -std=c99 -O3 -mmcu=atmega32a main.c -o main.elf
avr-objcopy -j .text -j .data -O ihex main.elf main.hex

Now connect the AVR microcontroller to your AVR programmer, and your AVR programmer to your computer. You should now be able to use avrdude to program your microcontroller.

Programming AVR using usbasp

avrdude -p m32 -c usbasp -P usb -e -U flash:w:main.hex

Programming AVR using JTAG and AVRDRAGON

avrdude -p m32 -c dragon_jtag -P usb -e -U flash:w:main.hex
Categories
Raspberry Pi

Using the Raspberry Pi’s built-in VNC Server with iMac

The Raspberry Pi already has a VNC server installed but there are a couple of things that need to be done to use it.

Firstly you must enable it by running sudo rasp-config, selecting Interfacing Options and then making sure that VNC is enabled.

If you are going to use an iMac to access your Raspberry Pi then you must change the authentication mode on the Raspberry Pi VNC Server:-

  • sudo vncpasswd
  • sudo vi /root/.vnc/config.d/vncserver-x11
  • Add “Authentication=VncAuth”
  • For some reason the VNC server won’t send the display with the default screen resolution. Start raspi-config (sudo raspi-config) and select “Advanced Options / Resolution”. Now choose another resolution e.g. 1024×768.
  • Restart VNC Server using: sudo raspi-config

You should now be able to access your Raspberry Pi using your iMac’s built-in VNC viewer:-

  • Open Finder
  • Select “Go / Connect to Server” from the menu.
  • Enter “vnc://raspberruypi/” in the Server Address field and then click on connect.
  • You will be prompted to enter a password. Enter the password you supplied when you executed vncpasswd earlier.