Lab #5 EEPROM Programming

Introduction:

After this lab, the user will have gathered basic knowledge on how to program the EEPROM on the Super Stepper controller module and gain the flexibility of modifying application specific Boot Time parameters.

Objectives:

What is a Boot Time Parameter?

The topic we are studying in this tutorial we have introduced on the previous Memory Read/Write section. However, the importance of this topic is such that we have decided to go really deep into it in order to teach the user the tools needed to go into more advanced topics such as Advanced Rotations.

A Boot Time Parameter is that which is utilized after reset to configure the controller module. All of these parameters can be modified after reset at the user’s will. However, althoug data has been programmed into EEPROM, changes will not function until the controller power is switched off and on back again (a reset). The user should not worry about this apparent lack of flexibility since these parameters are expected to be modified only once, usually before the first time the controller is used.

Lets analyze the SS-ST68 EEPROM parameters. The user is exorted to check EEPROM parameters for any other Super Stepper module purchased.

EEPROM Address

Contents

EEPROM Address

Contents

0x00

SS BAUD Rate

0x04

Accel Decel Time Base

0x01

SS Address

0x05

Starting Speed (Hi)

0x02

Accel Decel Rate (Hi)

0x06

Starting Speed (Lo)

0x03

Accel Decel Rate (Lo)

0x07 to 0x7F

User defined

The SS-ST68 contains 128 EEPROM memory locations from which 121 are meant to be used by the user as general purpose memory. The first seven are not to be played with without expecting adverse results. Understanding how these bytes affect the application is very important. Programming them becomes the user responsibility as soon as the factory defaults fail to function as desired (i.e an acceleration rate may not work with the user’s desired profile).

SS-BAUD Rate (EEPROM address 0): This parameter specifies the communication link speed. Serial Communication ports require the speed to be close to identical if messages from both devices are to be properly decoded. Failing to choose the proper BAUD Rate guarantees poor to no communication. Please choose a value from the table below and program it in address 0.

 

Baud Rate

EEPROM (0)

Baud Rate

EEPROM (0)

2400

103

28800

8

4800

51

38400

6

9600

25

57600

3

14400

16

76800

2

19200

12

115200

1

SS Address (EEPROM Address 1): This byte contains the controller specific Super Stepper address. The address is vital when working with multi node systems. If a controller is programmed to have address 15, messages going to any other address will be totally ignored by it. Only messages addressed to 15 will be accepted and executed. The user is responsible of programming each controller with a different Super Stepper address. The value ranges from 0 to 31.

Accel Decel Rate (EEPROM Address 2 and 3): This word parameter (16 bits) constitutes the stepper acceleration deceleration rate. When acceleration or deceleration is specified (either from motor start or motor stop), the stepper speed is modified from a starting value until reaching the desired speed. The acceleration rate represents how much the speed is increased whenever is turn to increase the speed. The same applies for deceleration. Refer to the picture above for a better understanding of acceleration and deceleration profiles.

Accel Decel Time Base (EEPROM Address 4): This byte specifies how many ms will happen before the speed is increased or decreased again. In the picture above, the speed is increased with the Acceleration Rate and decreased with the Deceleration rate. How often this happens is proportional to the Time Base. The parameter can hold values from 0 to 255 which represent a number of milliseconds, where 0 means 1 millisecond and 255 equals 256 milliseconds.

Starting Speed (EEPROM Address 5 and 6): This word parameter (16 bits) specifies how fast the stepper starts to move when the Turn CW Speed or Turn CCW Speed commands are sent with the acceleration option enabled.

The BAUD Rate and SS Address parameters are transferred to appropriate registers in the controller operating system. Once there, they are used to configure the serial communication engine. If the user changes these two parameters, they will not take effect until next power up.

These are the two more important bytes as failing to program them with good values practically guarantees no functionality (i.e. programming the baud rate with a value other than 12 will make it impossible for the module to receive commands on a 19200 BAUD Rate serial bus)..

Remaining application specific parameters are transferred to RAM after reset. The idea is having a set of values in the controller without having to send a variety of Write RAM commands before actually start using the module. The user can change the EEPROM defaults or simply work with the values in RAM

Since BAUD Rate and SS Address are the most important parameters for controller operation, we will learn how to program them. Whatever we discuss in this section apply for all remaining parameters and equally to the free EEPROM space.

Programming the BAUD Rate and SS Address parameters

A paradox may arise. If the BAUD Rate and Address are the most important bytes necessary for system functionality, how are we supposed to program them with correct values if we don’t know what the board is configured to when we buy it?

Two points are important here. First, the controllers are always shipped with BAUD Rate of 19,200 and address 0. But even if that were not true, there is a way in which the BAUD Rate and SS Address are always fixed and unchangeable. This is achieved thru the SS Mode Bits:

Hence Lets start with our tutorial by:

Lets now test the new system functionality:

The reason for the observed behavior was that the controller was no longer responding to messages on address 0, but would receive and execute commands on address 1. You can now modify all EEPROM bytes as needed.

NOTE: In this tutorial we programmed the EEPROM BAUD Rate and SS Address bytes with the jumpers off. There is no need to always have the jumpers off when programming EEPROM. This was done just to ensure there was communication with the board. There will be instances in which the configuration bytes on EEPROM will be unknown and hence this will be the only way to gain access to the board resources.

Congratulations!!! You have successfully completed the fifth lab on the Super Stepper Architecture. You are now capable of reading and writing data from and to the memory inside the super stepper controller module.

Last Updated on Jan 10, 2008

Other Avayanic Web Sites