MyMaxim Subscriptions

Introduction

This reference design (RD) describes a 1-Wire® Master with PicoBlaze™ 8-bit embedded microcontroller design implemented and tested on the Xilinx® Spartan®-6 LX9 MicroBoard by Avnet. This example design uses the DS28EA001-Wire digital thermometer with sequence detect and PIO on a peripheral module. This module uses the Pmod™ port standard developed by Digilent Inc.

System Design Block Diagram

The system shown in Figure 1 shows the high-level implementation of the design. The system requires:

Introduction

This reference design (RD) describes a 1-Wire® Master with PicoBlaze™ 8-bit embedded microcontroller design implemented and tested on the Xilinx® Spartan®-6 LX9 MicroBoard by Avnet. This example design uses the DS28EA001-Wire digital thermometer with sequence detect and PIO on a peripheral module. This module uses the Pmod™ port standard developed by Digilent Inc.

System Design Block Diagram

The system shown in Figure 1 shows the high-level implementation of the design. The system requires:

Connect the USB-A to USB micro-B cable to the host PC and connector J3 on the S6LX9 MicroBoard.

Windows 7 will automatically assign a VCP to the board. The Device Manager shows which COM port is assigned. It also allows the user to select a COM port. For example in this system, the default virtual COM port is COM17. Look in the Ports (COM & LPT) listing for the Silicon Labs CP210x USB to UART Bridge item. Note the COM port assigned by the system.

Set Up the S6LX9 MicroBoard

Use the following procedure to set up the application:

Connect the USB-JTAG cable with a pod and ribbon connector between the JTAG connector on the board and a USB port on the PC. P

lug the USB cable into the PC and port J3 on the S6LX9 board. LED D7 will illuminate.

Plug in the DS28EA00 peripheral module with the component side facing the Spartan-6 into J5, the row where pin 1 is marked by the white dot.

Figure 2. The S6LX9 MicroBoard.

The 1-Wire Demo

Using the prebuilt bitstream file called "onewire.bit", the demo can be loaded into the FPGA and run without building the design. The Xilinx tools must be installed on your host PC, and the hardware should be set up as explained by the instructions in the "Set Up the S6LX9 MicroBoard" and "Installing the UART Driver and Virtual COM Port" sections. Here is the quick procedure to follow:

Start a Tera Term or HyperTerminal session. Set the serial port parameters to your VCP, 9600 baud rate, no parity,8 bits, 1 stop bit, and no flow control.

Using your Xilinx platform cable and the Xilinx software loading tool called iMPACT, load the "onewire.bit" file into the Spartan-6.

If the DS28EA00 peripheral module is plugged in correctly, you will see:

Note: If the "romid" shows all zeroes, recheck your connections. The DS28EA00 peripheral module likely does not have correct orientation or is plugged into the wrong row.

You can run the demo by typing "1" at the command prompt. This will display the temperature in 2's complement hex, followed continuously by the temperature in decimal. Also, the two LEDs on the DS28EA00 peripheral module will illuminate to represent the high and low alarms, similar to a thermostat controlling heating and cooling. The high alarm A default threshold is set to turn on at ≥ 29°C and the low alarm B default threshold is set to turn on at < 27°C. To exit at any time, press the Esc key.

You can change the DS28EA00 peripheral module alarm LEDs by inputting a 2's complement threshold. As an example, if you input 1Ch (28d) into the high alarm threshold, LED A will turn on at ≥ 28°C. If you input 1Ah (26d) into the low alarm threshold, LED B will turn on at < 26°C. These new alarms are activated by typing "1" at the command prompt.

Compiling the Design

This design is contained within the PicoBlaze application code and can be updated to work with any 1-Wire slave device. There are key 1-Wire subroutines that should be understood by the designer. The low level 1-Wire subroutines are listed in Table 2. The design is contained within OWP.psm and if desired can be modified for your application.

Table 2. Key 1-Wire Subroutines

Speed

Subroutine

Description

Standard

ow_reset_slow

Resets the 1-Wire slave devices and prepares them for a command.

Standard

write_byte_slow

Sends 8 bits of communication to the 1-Wire slave devices.

Standard

write_byte_slow_power

Sends 8 bits of communication to the 1-Wire slave devices and then supplies strong pullup. The strong pullup will be cleared when the next 1-Wire subroutine is issued.

Standard

read_byte_slow

Receives 8 bits of communication from the 1-Wire slave devices.

Standard

read_byte_slow_power

Receives 8 bits of communication from 1-Wire slave devices and then supplies strong pullup. The strong pullup will be cleared when the next 1-Wire subroutine is issued.

Overdrive

ow_reset_fast

Resets the 1-Wire bus slave devices and prepares them for a command.

Overdrive

write_byte_fast

Sends 8 bits of communication to the 1-Wire slave devices.

Overdrive

write_byte_fast_power

Sends 8 bits of communication to the 1-Wire slave devices and then supplies strong pullup. The strong pullup will be cleared when the next 1-Wire subroutine is issued.

Overdrive

read_byte_fast

Receives 8 bits of communication from the 1-Wire slave devices.

Overdrive

read_byte_fast_power

Receives 8 bits of communication from the 1-Wire slave devices and then supplies strong pullup. The strong pullup will be cleared when the next 1-Wire subroutine is issued.

Recompiling Procedure

The PicoBlaze assembler will produce the needed files for implementing your design. The new files will overwrite older files, so back up your original files before recompiling. Open Windows Explorer by navigating to "source\psm" and double-clicking on the program file called "kcpsm6.exe." You might receive a security warning stating "The publisher could not be verified. Are you sure you want to run this software?" Click run and you will get the following KCPSM6 assembler window:

Type the OWP.psm file name and hit the return key to compile.

The PicoBlaze assembler will begin running. If there are not any errors in the PicoBlaze code, you will see a screen like the one below. If there are errors, you will be alerted with the line number to where the problem is in the code file (i.e., in the OWP.psm file) and prompted to fix the error before rerunning the assembler.

Start the Xilinx ISE Project Navigator and open the file in "ise\OneWire\OneWire.xise" as shown below.

Select the top level file in the design hierarchy (i.e., OneWire – PicoBlaze) in the Hierarchy pane and double-click on Generate Programming File.

Confirm the hardware set of connections as defined in the "Set Up the S6LX9 MicroBoard" section. Start a Tera Term or HyperTerminal session with the serial port parameters set to your virtual COM port, 9600 baud rate, noparity, 8 bits, 1 stop bit, and no flow control.

In the ISE graphical user interface (GUI), select Configure Target Device to download the FPGA design to the S6LX9 MicroBoard. The PicoBlaze application will immediately begin running upon the download completion.

Summary

This RD illustrates how to use the Xilinx PicoBlaze to interface with a DS28EA00 peripheral module. The RD also can be used as a starting point to interface to other 1-Wire slave devices.

1-Wire is a registered trademark of Maxim Integrated Products, Inc.
HyperTerminal is a registered trademark of Hilgraeve, Incorporated.
ISE is a registered trademark of Xilinx, Inc.
PicoBlaze is a trademark of Xilinx, Inc.
Pmod is a trademark of Digilent Inc.
Spartan is a registered trademark of Xilinx, Inc.
Windows is a registered trademark and registered service mark of Microsoft Corporation.
Windows XP is a registered trademark and registered service mark of Microsoft Corporation.
Xilinx is a registered trademark and registered service mark of Xilinx, Inc.

Alert

Thank You for interest in Maxim Integrated. Our free samples program limits the quantities that we can provide to each customer per calendar year.If you feel that you have received this message in error, please contact samples-admin@maximintegrated.com. Alternatively, you can click here to place an order.

Part Number

Description

Key Advantages

Request a Quote

Part*

Minimum Qty

Order in Multiples

Quantity*Quantity rounded to nearest MOQ

Target Price/Unit

Competition

Estimated Annual Usage

Who is the End Customer?*

I'm the End Customer

Add different End Customer

My Profile*

First Middle Lastname
email@mycompany.com
123-456-7890
My Company Name
City, State, Zip/Postal
Country

Profile Information

City*

State/Prov*

Zip/Postal*

End Customer Information

Company*

City*

Zip/Postal*

Projects*

What project(s) will these Maxim parts be used in?

Applications*

What product(s) will you be manufacturing with these Maxim parts?

*Required

We will need the following information in order to respond to your Quote Request. Please provide as much detail as possible in your answers.

1. What application are you planning to use this part for ?*

2. What is the ultimate end use of this device/end product ?*

3. List the country/counties in which the product will be manufactured. *

4. List the country/countries in which the end product will reside. *

5. Identify the ultimate end user(s) (Customer/Target Customers) *

*Required

Your quote has been successfully submitted. You will receive an email within 24 hours with pricing and availability. Visit My Quotes Thank you!