ZKit-ARM-1769 Samples

Zilogic Systems


Keys

This NuttX sample demonstrates the access of keys KEY1-KEY5. When the program is executed, the keys are scanned and the pressed key is displayed on the console.

Download: For Windows, For GNU/Linux

Serial

This NuttX sample demonstrates the use of secondary serial port. When the program is executed, a welcome message is sent through this port which can be seen at the terminal program running on the host. Also any message typed at the host side is received through this port and printed on the target board’s console.

Setting up the connection
  • In addition to the Mini-B cable used for flashing the program, you would also require a ZKit-51 RS232 Transceiver.
  • The RS232 Transceiver must be connected to the UART-I²C connector of the board at one end and to the RS232 port of the host system at the other end.
Host-side setup
  • The terminal consoles corresponding to the Mini-B cable and the RS232 port are opened using picocom with 115200 baudrate, 8 data bits, no parity, 1 stop bit, using the following command. When done, use Ctrl-A Ctrl-X to exit picocom.
$ picocom -b 115200 /dev/ttyUSB0
  • The welcome message will be displayed on the RS232 port. Any message sent through the RS232 port will be read by the board and displayed on its terminal console i.e the port corresponding to the Mini-B cable.

    Download: For Windows, For GNU/Linux

I²C

This NuttX sample demonstrates I²C usage. The sample was tested using NXP’s PCF8591 8-bit A/D and D/A converter. When the program is executed, the value at the ADC Channel 0 is continously displayed on the console.

Download: For Windows, For GNU/Linux

SPI

This NuttX sample demonstrates SPI usage. The program was tested using a SPI interfaced Seven-segment display. When the program was executed, the seven-segment display shows Hex values from 0x00 to 0xFF with a delay of 1 second.

Download: For Windows, For GNU/Linux

ADC

This NuttX sample demonstrates ADC usage. The sample simply prints the value of the voltage at the ADC Channel. When the program is executed, the samples from the ADC Channels are continously displayed on the console.

Download: For Windows, For GNU/Linux

DAC

This sample demonstrates DAC usage. An LED is connected to external connector pins AIN3 and GND with a series resistor of 1k. When the program is executed, the 1Hz square wave generated drives the LED.

Download: For Windows, For GNU/Linux

CAN

This NuttX sample demonstrates the use of CAN. When the program is excecuted, the data sent from CAN Port 1 to CAN port 2 is looped back and read from CAN Port 1. All these CAN messages are displayed on the terminal console.

Setup
  1. Connect pins 3,4 and 5 of CAN Port 1 to the corresponding pins i.e 3,4 and 5 pins of CAN Port 2 respectively.
  2. Open picocom, and specify 115200 baudrate, 8 data bits, no parity, 1 stop bit, using the following command. When done, use Ctrl-A Ctrl-X to exit picocom.

    $ picocom -b 115200 /dev/ttyUSB0

    The CAN messages will be displayed on the console.

Download: For Windows, For GNU/Linux

Ethernet

This NuttX sample demonstrates the use of ethernet. The board is a client which connects to a server through a TCP connection. The client receives the message sent by the server and displays it on the console.

Connecting to the Network
  • You can connect the zkit-arm-1769 to a modem in a LAN.
  • Alternatively, you may connect your PC/Laptop directly to zkit-arm-1769 using a ethernet cable.
Linux host
  1. Create a sample text file hello.txt.
  2. Add sample text to the file:

    $ echo "Hello! Welcome to Zilogic Systems" > hello.txt
  3. Install the netcat package and use the following command to send message to the client:

    $ nc -l -p 5471 < hello.txt
Windows host
  • Install the netcat package for windows and use the following command to send the message from the DOS-prompt:

    $ nc -l -p 5471 < hello.txt
  • Netcat for windows can be downloaded from the following link: http://joncraton.org/files/nc111nt.zip
  • Please run the above command on the Host system before running the program on the board or else there will be a socket connection error.
IP Configuration
  • You can specify the IP address of the host by changing the SERVER_IP macro in the file app_main.c.
  • Similarly, you can specify the IP address of the board, netmask and gateway of the network using the IPADDR, NETMASK, and GATEWAY_IP macros.
  • In case of any connectivity problems, try disabling the firewall on your host machine.

    Download: For Windows, For GNU/Linux

USB Serial

This NuttX sample demonstrates the usage of USB. The program demonstrates the emulation of USB as a serial device. When the program is executed, a welcome message is sent to the USB port. This message can be seen by opening the corresponding terminal on host machine.

Host-side Configuration
  1. Connect the Mini-B plug to the host.
  2. Check the ttyUSB* port to which the cable is connected using the command "dmesg".
  3. Open picocom, and specify 115200 baudrate, 8 data bits, no parity, 1 stop bit, using the following command. When done, use Ctrl-A Ctrl-X to exit picocom.

    $ picocom -b 115200 /dev/ttyUSB0

    The welcome message should get displayed after opening the port.

    Download: For Windows, For GNU/Linux

EEPROM

This NuttX sample demonstrates EEPROM usage. The sample implements a reboot counter. The reboot count is stored in location 0 of the EEPROM. When the board is reset (soft or hard), the reboot count is read from the EEPROM, incremented and written back to the EEPROM. The reboot count is displayed on the terminal console.

Download: For Windows, For GNU/Linux

SDCard

This NuttX sample demonstrates SD-card usage. When the program is executed, it reads the contents of the file specified in the program and displays its contents on the console.

Setup
  1. Format the SD card as a FAT file system.
  2. Create a file test.txt in the root folder of the sdcard and type some sample text.
  3. Before powering up the board, insert the SD card into the SD-card slot.
  4. Power up the board, and open picocom, and specify 115200 baudrate, 8 data bits, no parity, 1 stop bit, using the following command. When done, use Ctrl-A Ctrl-X to exit picocom.

    $ picocom -b 115200 /dev/ttyUSB0

    The contents of the file test.txt will be displayed in the console.

    Download: For Windows, For GNU/Linux