6.4.7. The TICTalk file

An example C program using the TICTalk commands is shown in Example 6.5.

Example 6.5. 

#define CT1Load					Counter_Base + 0x00
#define CT1Value					Counter_Base + 0x04
#define CT1Control					Counter_Base + 0x08
#define CT1Clear					Counter_Base + 0x0C 
#define CT1Test					Counter_Base + 0x10 

#define MaskAll     0x00000000
#define NoMask      0xFFFFFFFF
#define MaskControl 0x000000CC
#define MaskValue   0x0000FFFF
#define DUMMY       0x12345678

#include “header.h”
#include “ticmacros.h”

int main()
{
  A(CT1Load)
  W(0x55555555)
  A(CT1Control)
  W(0x000000C0) /* Counter Enabled, Periodic Mode, Prescale 0 */
  A(CT1Value)
  R(0x55555547, MaskValue)
  A(CT1Load)
  W(0xDADADADA)
  B(0xDADADADA, MaskValue)    /* Read CT1Value */
  R(0x000000C0, MaskControl)  /* Read CT1Control */
  A(CT1Value)
  R(0xAAAAAAB8, MaskAll)
  W(0x000000C4)          /* Write to CT1Control */
  W(DUMMY)               /* Write to CT1Clear   */
  L(5)                   /* Repeat last write 5 times */
  E()
}

Example 6.5 shows the TICTalk commands accept 32-bit integers as arguments. These can be specified using the #define directive, immediate values or normal C variables. This C-like approach provides the flexibility to develop more elaborate tests and new extended functions. For example, the basic commands could be used to build a pair of functions for reading and writing vectors that automatically take care of bus turnaround and address vectors.

The ticmacros.h file includes all the macro definitions for each command. These macros are expanded to generate a test input file in a format that can be read by the Ticbox.

The header.h file contains the base address definitions for the different blocks in the system. This is where the Counter_Base constant should be defined. This ensures portability of the test program to other systems with different peripheral address mapping.

Copyright © 2001 ARM Limited. All rights reserved.ARM DDI 0226A
Non-Confidential