Cerebot Nano Reference Manual

修订:2009年2月6日

Note: This document applies to REV A of the board.


概述

Cerebot Nano是Digilent提供的Cerebot线中最小的。板的小尺寸使其可以用作外围,可以直接插入其他数字板,也可以用作微型的独立嵌入式控制板。尽管尺寸很小,但Cerebot Nano仍然充满了功能。

Cerebot Nano的多功能设计和可编程的微控制器使您可以控制不同的外部设备,并为多种用途编程板。董事会有许多I/O连接器,并支持许多编程工具,包括Atmel AvrStudio®4和Winavr。

Cerebot Nano具有多种用于外围设备的连接。Digilent外围模块(PMODS™)包括H桥,模数和数字到Analog转换器,扬声器,开关,按钮,LED,RS232转换器,螺丝端子连接器,BNC连接器,伺服电动机等。有关更多信息,请访问www.digilentinc.com

功能包括:

  • ATMEGA168微控制器
  • one 6-pin and two 12-pin ports for Digilent Pmod peripheral module boards
  • up to eight analog-to-digital (ADC) input channels
  • 四个LED
  • ESD protection for all I/O pins
  • 使用数字平行JTAG电缆或Digilent USB JTAG/SPI电缆的系统内编程支持

Atmega168的功能包括:

  • Master/slave serial peripheral interface (SPI)
  • 可编程串行USART界面
  • ATMEL两个电线串行接口(TWI)
  • Eight channel, 10-bitADC
  • 两个8位计时器/计数器
  • 一个16位计时器/计数器
  • 16KB程序闪存
  • 512字节EEPROM
  • 1KB内部SRAM
  • 模拟比较器
  • 内置8MHz/1MHz时钟源。

For more information on the ATmega168 microcontroller, refer to the data sheet available atwww.atmel.com


1.功能描述

Cerebot Nano设计用于嵌入式控制和机器人应用以及微处理器实验。可以将嵌入式固件(适用于许多应用程序)编程到Cerebot Nano的Atmega168微控制器中。

尽管Cerebot Nano可以用作独立的微控制器板,但它也被设计为使用分布式处理体系结构的较大系统的一部分。连接器J1允许将Cerebot Nano直接插入其他数字微控制器板,例如Cerebot II或Cerebot Plus。Cerebot Nano可以直接插入Digilent的FPGA板上的许多端口,尽管某些板可能需要使用Digilent模块接口板。

Cerebot Nano可以使用固件编程以执行本地控制功能。然后,它可以由主机控制器板中的更高级别的控制器控制并报告给主机控制器板中的更高级别的控制器。例如,可以对Cerebot Nano进行编程以执行闭环运动速度控制。通过从主机处理并控制电动机本身,可以在执行电动机速度控制时,可以减轻主机处理器的额外工作。

1。1。Communication Options

Connector J1 provides access to the master/slave SPI. SPI is a high-speed, synchronous, serial interface used by many serial peripheral devices like ADCs and DACs. The SPI interface is used for programming the ATmega168 and as a user-accessible SPI port. The DigilentPMODAD1andPmodDA1模块使用SPI接口。

连接器JB和J2提供了对ATMEL两线接口(TWI)的访问权限。TWI是中等速度(200-400 kbps)的串行总线,可连接多达128个设备。连接器J2可用于Daisy链条的其他设备到TWI总线。Atmel的TWI接口与Phillips的I2C协议直接兼容。

ATMEGA168微控制器提供了可用于异步或同步串行通信的USART。但是,Cerebot Nano不提供晶体振荡器,并且内部RC振荡器还不够准确,无法进行可靠的异步通信。有时可以使用校准寄存器调整振荡器,以使异步通信起作用。

1。2。6-pin Pmod Ports

这Cerebot Nano has five 6-pin header ports for connecting to general-purpose, off-board digital I/O or to specific ATmega168 features like analog-to-digital converters or pulse-width modulators. Each 6-pin port provides four signals, power, and ground. These ports are specifically designed to work with the Digilent Pmod line of peripheral boards, but can be used to connect to virtually any off-board I/O device.

有关将外围模块和其他设备连接到Cerebot Nano的更多信息,请参见表1。表1显示了具有其设计的基本功能的端口和ATMEGA168 I/O端口的地图。所有I/O端口信号引脚可用于通用数字I/OS。

1.3。电源

Cerebot Nano的外部功率为2.7至5.5伏特DC。Cerebot Nano不具有电压调节器,因此在选择电源时应注意。在此范围之外使用电压可能会损坏Cerebot Nano和连接的设备。

这Cerebot Nano can be powered through any of the board's 6-pin Pmod headers or the J3 connector.

这些连接器中的每一个都提供VCC和地面别针。提供2.7至5.5伏之间的电源可以连接到VCC将这些连接器中的任何一个固定。

When the Cerebot Nano is plugged into another Digilent microcontroller or FPGA board, that board can power the Cerebot Nano through the Pmod port. The host board should be jumpered to provide 3.3V on theVCCpin of the Pmod port being used. The Cerebot Nano will then be powered by the host board’s power supply, and will in turn provide power from the host board to any peripheral boards connected to the Cerebot Nano’s other Pmod connectors.

对于独立应用,Digilent PMODREG1电压调节器模块可用于向板提供3.3伏。

1.4。设备编程

Cerebot Nano具有一个系统内编程(ISP)连接器J1。数字编程电缆连接到J1。可以使用平行的JTAG或USB JTAG/SPI电缆。连接编程电缆时,请确保VCCandgndpin labels from the cable match to theVCCandgndCerebot纳米针。

A power supply must be provided to the Cerebot Nano when programming. The Digilent programming cable does not supply power to the board; the board that it is plugged into powers the programming cable. The Digilent PmodREG1 voltage regulator module can be used, or any appropriately regulated power supply can be connected to J3. If the Cerebot Nano is being used in conjunction with another Digilent board, such as the Cerebot II or Minicon, these boards have connectors that can be used to supply power to the J3 connector on the Cerebot Nano using a two-wire cable.

可以使用Digilent AVRP应用程序来完成编程,该应用程序可通过从Digilent网站免费下载获得。还可以在Winavr版本中配置Avrdude程序员,以使用Digilent Parallel JTAG电缆进行系统编程。有关董事会编程中的更多信息,请参见这些应用程序的文档。

连接器J1均用于系统编程和用户访问SPI控制器。跳线块JP1用于在两个函数之间进行选择。短路块放置在第一个位置,用于系统内编程,以及用于使用用户访问SPI端口的SS位置。

1.5。AVR时钟保险丝设置

AVR微控制器使用称为保险丝的控制位来为设备设置基本操作参数。SPI控制器使用保险丝设置的时钟源为其时钟设置。如果设置了时钟源保险丝以选择板上不存在的时钟源,则SPI控制器将无法使用,并且将不再可以通过系统内部编程协议对微控制器进行编程。Cerebot Nano只能使用内部RC振荡器作为时钟源。

如果选择了外部振荡器或一个晶体/谐振器时钟源,则可以通过将合适的时钟信号应用于连接器JB的引脚1来恢复板。Digilent网站上有一个应用程序注释,该说明说明了Cerebot板的此技术。

另外,最大SPI时钟频率是所选的时钟频率除以四个。如果选择128kHz内部振荡器作为时钟源,则需要将SPI时钟设置为32kHz或更小的频率。Digilent编程电缆不支持低频率,因此,如果为时钟源选择了128KHz内部振荡器,则使用Digilent编程电缆将不再可以编程板。

1.6。两线串行接口

ATMEL TWI接口是中等速度(400 kbps),同步,串行,通信总线。TWI接口在总线上提供多达128个设备的主机或从属操作。为每个设备提供一个唯一的地址,该协议能够将数据包定位到特定设备或将数据包广播到总线上的所有设备。有关配置和使用两线接口的详细信息,请参见Atmega168数据表www.atmel.com

Cerebot Nano有两种连接到TWI巴士的方法。TWI信号SCL和SDA可在6针连接器JB或2针连接器J2上使用。

引脚的连接器JB和两个连接器J2的销钉提供了两个位置,用于连接到TWI信号。通过使用两线电缆(与Digilent分开可用),可以创建Cerebot Nanos的雏菊链或其他具有Twi的木板。

这TWI bus is an open-collector bus. Devices on the bus actively drive the signals low. When no device is driving the lines low, pull-up resistors achieve the high state on the TWI lines. A single device on the TWI bus must provide the pull-up resistors.

这Cerebot Nano provides pull-up resistors that are controlled by software.

I/O port B, bits 6 and 7 (PB6 and PB7), are connected to the pull-up resistors. To enable the pull-ups, configure these pins as outputs and set the I/O port output bits to “1”. To disable the pull-ups, configure these pins as inputs with the internal pull-ups disabled. Both TWI pull-ups should be enabled or disabled together. Only one device on the TWI bus should have pull-ups enabled.

通过在DDR寄存器中设置相应位,将端口位配置为输入或输出。通过编写“ 1”和写入“ 0”,引脚成为输出。当引脚配置为输入时,通过将相应的输出端口位写入“ 1”并将其写入“ 0”来启用内部上拉电阻。有关更多信息,请参见Atmel Atmega168数据表。

1.7。板上用户I/O

Cerebot Nano为用户输出提供了四个车载LED。LED连接到I/O端口D,位2-5(PD2-PD5)。一个LEDis turned on by writing the corresponding DDRD and PORTD register bits to logic 1 and turned off by writing the corresponding PORTD bit to logic 0.

LEDconnections are shared with ports JA and JB as follows:

LED1 JB8 PD5
LED2 JA10 PD3
LED3 JB7 PD4
LED4 JA7 PD2

所有PMOD标头端口引脚均可用于通用I/OS。下表描述了Cerebot Nano头引脚如何连接到Atmega168端口/位。

描述 Pin Function Port/Bit
JA 一个alog Input andPMODHB5连接: JA1 through JA4 can be used as analog inputs in applications and pins JA7 through JA10 are ideally suited for connection with a DigilentPMODHB5电动机控制板。 1 ADC0/PCINT8 PC0
2 ADC1/PCINT9 PC1
3 ADC2/PCINT10 PC2
4 ADC3/PCINT11 PC3
5 gnd
6 VCC
7 INT0/PCINT18 PD2
8 OC1A/PCINT1 PB1
9 ICP1/PCINT0 PB0
10 int1/PCINT19 PD3
11 gnd
12 VCC
JB 连续交流和一般I/O:PIN JB1通过JB4提供对TWI和USART通信接口的访问。引脚JB7和JB10仅限于一般I/O和JB8,JB9提供了对计时器/计数器0的输出比较的访问。 1 ADC5/SCL/PCINT13 PC5
2 ADC4/SDA/PCINT12 PC4
3 RXD/PCINT16 PD0
4 TXD/PCINT17 PD1
5 gnd
6 VCC
7 XCK/T0/PCINT20 PD4
8 T1/OC0B/PCINT21 PD5
9 AIN0/OC0A/PCINT22 PD6
10 AIN1/PCINT23 PD7
11 gnd
12 VCC
J1 SPI界面和系统内编程:当JP1上的短路位于SS位置时,J1用于SPI端口。当JP1上的短块处于第一个位置时,J1用于系统编程。 1 PCINT2/SS/OC1B PB2
2 PCINT3/OC2A/MOSI PB3
3 PCINT4/味噌 PB4
4 SCK/PCINT5 PB5
5 gnd
6 VCC
J2 TWI连接器:可以在此连接器上访问ATMEL TWI接口。 1 ADC5/SCL/PCINT13 PC5
2 ADC4/SDA/PCINT12 PC4
J4 ADCInput Only:模拟数字输入通道6和7是仅输入的,并且具有数字I/O功能。 1 ADC6
2 ADC7