Silicon Laboratories Stepper Machine Bedienungsanleitung Seite 5

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 40
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 4
AN428
Rev. 0.6 5
4.1. Firmware Description
The full code listing of this example is available in the appendix as well as online at www.silabs.com. To download
the source code, type “AN428” in the keyword search box, and download the AN428 Jumpstart Software from the
result list.
1. The Si5338 data sheet has more details on writing a custom configuration to the Si5338's RAM. See section
3.5.3. The example code as seen in the appendix implements this procedure.
2. The F301 has eight digital I/O signals configured as open-drain with weak pull-ups. Initially, all the signals are
set to logic 1.
3. The I
2
C master state machine is adapted from Silicon Laboratories “AN141: SMBUS Communication for Small
Form Factor Device Families” for use with the F301 (see “6.3 EEPROM Example” in AN141). SDA is on P0.0,
and SCL is on P0.1 of the MCU using the SMBus. Timer 1 is configured to be the SMBus or I
2
C clock source
and is set to 400 kbps. Timer 2 is configured to be a timeout detection that the SMBus automatically uses
during the state machine operation. Use of this timer is optional (see section 13.4.1 in the C8051F30x data
sheet and section 3.1.2 of AN141 for more information).
4. The I
2
C address of the Si5338 is set to the default of 0x70 (hexadecimal). The I
2
C read and write functions will
left-shift the address and fill in the I
2
C R/W bit correctly.
4.2. Encoding the Register Map
For this example, the Si5338-EVB kit and ClockBuilder Desktop program are used to develop a frequency plan
configuration and to save the plan to a register map text file.
The goal is to take a line formatted like this from the register map text file format:
<address>,<data>h
to the register map array format in the MCU firmware like this:
{<address>,0x<data>,0x<mask>},
The address field represents the register address and is in decimal. The data field is the value to be sent to the
register located at the corresponding register address. The mask denotes which bits are used and which are
ignored in the register data. Any bits in the mask field that are a one are used, and any bits that are a zero are
ignored. The data and mask fields are in hexadecimal. All three fields are eight bit integers with the range being 0
to 255 (0xFF).
After the formatting is complete, open the file register_map.h in the JumpStart project, and paste the register map
data into the array declaration called Reg_Store between the curly braces. Update the NUM_REGS_MAX
definition to be the number of elements in the array. Note that not all registers need to be written to the Si5338
depending on what features are used; see the Si5338 data sheet for more information on the register categories
and masks.
Seitenansicht 4
1 2 3 4 5 6 7 8 9 10 ... 39 40

Kommentare zu diesen Handbüchern

Keine Kommentare