HOLT HI-3110 User manual

AN-175
2 Holt Integrated Circuits
REVISION HISTORY
Revision
Date
Description of Change
AN-175 Rev. New
08-30-11
Initial Release
Rev. A
01-15-13
USB to Serial, External SPI Interface and Two node
demonstration.
Rev. B
04-20-2020
Improve board schematic diagram resolution.
Update Freescale Development Tools information.
Update document to new format.
Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
3 Holt Integrated Circuits
Introduction
The Holt HI-3110 ARINC 825 CAN BUS Controller Evaluation Board can be used to evaluate some of the
features of the HI-3110 CAN Controller IC with integrated transceiver. A Freescale MC9S12XDT512
microcontroller with 512K flash and 20K RAM communicates with the HI-3110 through the SPI interface.
The board includes switches and LEDs to help navigate the operating modes and confirm data and status
information. A Serial UART port is provided to allow debug and data messages to be sent to a PC using
any terminal program such as Hyper-terminal.
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
4 Holt Integrated Circuits
KIT CONTENTS
This Users Guide.
HI-3110 Evaluation Board
HI-3110 Data Sheet
RS-232 Serial Cable
USB to Serial Adapter
Codewarrior™ Demo Software Project
Demonstration Features
Transmit Modes for Standard and Extended Frames
Receive Modes, polled and interrupt driven
CAN bus communication using two nodes
Monitor Mode
LoopBack Mode
Sleep Mode with wake-up from Button press or CAN data
Selectable Bit Rates from 83.3KBPS - 1MBPS
Print out the CAN buffers (64) on the serial console
Print out the status registers on the serial console
Print out the Transmit History FIFOs on the serial console
Print out the Error Status registers on the serial console
Configuring the INT, STAT and GP1 and GP2 outputs
SPI clock frequency selectable from 625 KHz –20 MHz.
Test Mode for cycling GPIOs and LEDs as a board check
CAN Filters and Masks
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
5 Holt Integrated Circuits
Demonstration Set-up
MC9S12XD
16 Bit MCU
HOLT
HI-3110 CAN
Controller
SPI (4)
GP1,GP2,STAT,INT
RS-232 Console
USB Debug Port
DB9
CAN Bus
Connector
LEDs (10)
User Push
Button
Switches (4)
Dip SWs
(4) Dip SWs (6)
Expansion
Headers
(2x14) x 2
RESET Button
CAN
Transceiver
The board requires a +5V (0.5A) power supply applied to TP1 and Gnd to TP6. There are two ways to
connect the CANL and CANH signals to the CAN Bus. The CANL and CANH Bus signals are available on
the two test points on the top right side of the board or from the DB9 connector.
Power On Reset
For normal operation ensure SW2 –4 (MRST) is in the open position otherwise the MCU will be held in
the reset state. The purpose of this MRST dip switch is to allow easy interfacing of an external MCU to
the HI-3110 such that the SPI signals from the Freescale MCU will be forced into high impedance so as
not to conflict with an external MCU. For normal operation keep this switch open and use the RESET
button to reset the MCU during testing.
For Modes 1-6 the MCU will initialize the HI-3110 and check the STATF status register for the default
0x82 value, if the status value does not match 0x82 the program will turn on the Red LED8 and halt.
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
6 Holt Integrated Circuits
CAN BUS Bit Rate selection
The Bit Rate can be selected by configuring the 3 dip switches in SW1. The program fetches the switch
positions once after a power up.
Bit Rate Selection
S3
S2
S1
BIT RATE
0
0
0
1 MBPS
0
0
1
500 KBPS
0
1
0
250 KBPS
0
1
1
125 KBPS
1
0
0
83.3 KBPS
Mode Selection
MODE 2
MODE 1
MODE 0
MODE
0
0
0
Board Test
0
0
1
Transmit Standard Frames
0
1
0
Receive in polling mode
0
1
1
Monitor
1
0
0
Loop Back
1
0
1
Transmit Extended Frames
1
1
0
Receive in interrupt mode
1
1
1
Serial Console Commands
SW2 OPT1 switch (Receiver data frame compare)
Receiver Modes:
If OPT1 is in the open position the receiver mode will check the data frame for an incrementing 32-bit
value. If the data doesn’t match the expected value from the previous transmission it will turn on the
Red LED8 and halt.
Transmitter Modes:
If OPT1 is in the open position a 400us delay will be inserted between each transmission.
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
7 Holt Integrated Circuits
SW2 OPT2 switch
OPT2 is also used in the receiver mode. It enables the FILTON bit(bit4) in the CTRL1 register for CAN ID
filtering. See the Receive Mode description in the software description section for more details.
Buttons1 –Button4 (SW1-SW4)
Depending on the mode these buttons will perform specific tasks.
Serial Port Configuration
The serial port is optional and provides access to additional status and data information:
Software Revision
Current Mode
CAN Frame data
CAN History FIFO data
Status Registers data
Sleep Mode status
Serial Commands Menu
A simple menu of commands is provided for resetting the HI-3110, reading and displaying the HI-3110
status registers, and a demo how to pass input strings to the program. There are provisions for
additional user code to be implemented so custom commands can be developed and easily integrated.
UART Serial Port Setup: 115200 Baud, 8 bits, No Parity, No handshaking.
A USB to Serial adapter is provided in the kit which can be used with PC’s that don’t have a serial port.
At power on reset (POR) the revision of the program will be displayed on the LEDs for two seconds in
binary format where LED1 is the LSB. After two seconds they will be turned off then LED7 will flash every
second as the main MCU “live” operating indicator. A message will also be sent to the Serial Port . For
Receive mode it will be shown as:
Holt HI 3110 Demonstration Software Revision: xx
Receive Mode polled
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
8 Holt Integrated Circuits
Board Jumpers
JP1 - CAN BUS connector shield
JP2 - CANH 60 ohm termination.
JP3 - VDD jumper to U3 VLOGIC. Removing JP3 can be used to measure ICC.
JP4 - SPLIT termination voltage filter.
JP5 - CANL 60 ohm termination.
JP7 - VDD jumper to U3 VDD. Removing JP7 can be used to measure ICC or to operate the
logic section of the HI-3110 at 3.3V while keeping 5V on the VDD pin for the integrated
CAN transceiver. See the HI-3110 Split Voltage Operation section below.
Using the HI-3110 with an external MCU or FPGA
To use the HI-3110 with an external MCU or FPGA close the RESET DIP switch 4 in SW2. This will hold the
Freescale MCU in the reset state and keep the SPI signals from the Freescale MCU in tri-state. This
allows the SPI signals to be driven by an external source without having to remove the Freescale MCU
on the board. The SPI signals to the HI-3110 are available on both J8 header rows or J5 and J6. Refer to
the schematic for the pin assignments. Connect MR, nCS, SO, SI, SCK and optionally STAT and INT to the
external MCU or FPGA. The HI-3110 supports either 5V or 3.3V logic levels depending if 5V or 3.3V is
applied to the Vlogic pin. 5V is needed on the VDD pin for the transceiver outputs to meet ISO-11898-5
voltage levels.
HI-3110 Board Dual Voltage Configuration
It is possible to run the digital logic of the HI-3110 on 3.3V while keeping 5V on the integrated CAN
transceiver on the VDD pin-11. The Freescale MC9S12XD family can operate at either 3.3V or 5V so this
microcontroller can be used to demonstrate this. To setup the evaluation board for dual voltage
operation follow the simple setup instructions below:
Setup instructions:
1) Remove JP7 and connect the right side of the JP7 jumper post to TP2 VDD2. Do not re-
install the jumper shunt.
2) Connect a 3.3V power supply to the board TP1 VDD.
3) Connect a 5V power supply to the board TP2 VDD2.
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
9 Holt Integrated Circuits
Users Guide
Mode-0: Board Test
In this mode the MCU performs a walking pattern on the GPIO pins and cycles turning on all the LEDs.
See the boardtest.c module for details and other options available.
Mode-1: Transmit Mode Standard Frames
This transmits a standard CAN frame with an incrementing 32-bit value in the first 4 bytes of the data –
field, the last four bytes will be 00. After RESET press the Button-1 to start the transmissions. A portion
of the data field will be copied to the LED1-LED4’s. They can be seen counting in this mode.
Press Button-1 to stop transmitting and print out the status registers on the serial console.
Press Button-2 to pause the transmission. Press Button-2 again to transmit one frame again.
Press Button-3 to print out the Transmit History FIFO contents on the serial console.
Press Button-4 to resume transmissions.
OPT1 switch= open, Inserts a 400us delay before each transmission.
Mode-2 Receive Mode using Polling method
To use Receive mode with an external node transmitter, set the OPT1 switch to the closed position to
disable the Receiver data frame compare feature. This will allow any data frame to be accepted.
LED1-4 will reflect the lower nibble of byte3 of the data-field.
CAN Error Detection
While receiving frames if there are any errors detected in the HI-3110 registers, TEC, REC or ERR, they
will be automatically logged on the Serial Port.
For example if ERR has a 01 value it would be shown as: ERR: 01. The other two errors will be shown
similarly.
Button-1 –Stop receiving CAN messages and print the last 64 CAN frames and the status registers on the
serial console. Press Button-4 to resume receiving CAN messages. See a partial listing of this output
below which shows the last two frames.
CAN Frame 62: 00 77 60 47 20 00 00 08 00 00 22 28 04 05 06 07
Standard Filter:0 TTU:77 TTL:60 BaseID:239
[r0,r1,x,x][DLC]: 08 Data-Field: 00 00 22 28 04 05 06 07
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
10 Holt Integrated Circuits
CAN Frame 63: 00 78 61 47 20 00 00 08 00 00 22 29 04 05 06 07
Standard Filter:0 TTU:78 TTL:61 BaseID:239
[r0,r1,x,x][DLC]: 08 Data-Field: 00 00 22 29 04 05 06 07
Button-2 –Stop receiving CAN messages and print the HI-3110 status registers. Press Button-4 to
resume CAN messages.
CTR0 = 00
CTR1 = 00
BTR0 = 40
BTR1 = A7
TEC = 00
REC = 00
MESSTAT=00
STATF = 00
ERR = D8
INTF = 00
INTE = 82
STATFE= 00
GPINE = 00
TIMERUB=98
TIMERLB=95
Button-3 –Put the HI-3110 into Sleep Mode. Press Button-4 or send CAN messages in Sleep mode to
terminate and re-enter Normal mode. A message on the serial console will indicate the Sleep Mode and
the source to the wake-up event.
Holt HI-3110 Demonstration Software Revision: 09
Receive Mode polled
Entering SLEEP Mode
Press Button-4 to wake-up.
Normal Mode Resumed from Sleep Mode
Entering SLEEP Mode
Press Button-4 to wake-up.
Normal Mode Resumed from Monitor Mode
REC: 01 ERR: 04
The last line shows a BUS error that was caused when the HI-3110 was in Sleep Mode and woke up due
to a CAN message coming in.
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
11 Holt Integrated Circuits
CAN bus communication using two nodes
Two-node communications can be demonstrated using two HI-3110 evaluation boards. One board is
configured in Mode-1 as the transmitter and the second board is configured in Mode-2 as the Receiver.
Two-node demo setup:
1. Connect CANH (TP3) from board-1 to CANH of board-2 together using a clip lead. Connect CANL
(TP4) signals together on each board using a clip lead. Optionally, a 9-pin CAN cable can also be
used in place of the clip leads (not provided in the kit).
2. Ensure the bit rate DIP switches S1, S2 and S3 are set for the same bit rate on both boards.
3. Set board-1 to Mode-1 as the Transmitting node. Mode-1 transmits an incrementing data pattern
starting from count zero.
4. Set board-2 to Mode-2 as the Receiver node. Set OPT1 switch to the open position to enable the
Receiver to perform 32-bit data frame compares.
5. Power up both boards and optionally press the Reset button on both boards.
6. To start the data transmissions press S1 on board-1.
Board-1 begins to transmit data frames and the Receiver board-2 will receive the data frames. The
Receive board LEDs 1-4 will reflect the lower nibble of byte3 of the data-field.
When OPT1 switch is open, The Receiver program will compare the 32-bit counter value in the data-field
and turn on the RED LED8 and halt if it does not match the expected value. To exit from the halt
condition, press the RESET button. To repeat the test after a data mismatch, reset both boards and
repeat the test by pressing the S1 on board-1 again. The data-field compare function can be turned off
by closing the OPT1 switch. With the compare function turned off, the Receiver will continue to receive
data frames and update the LEDs 1-4 from the lower nibble of byte3 of the data-field.
Mode-3 Monitor Mode
Monitor mode is a simple version similar to Receive mode but just captures the CAN data without
providing an acknowledge bit on the Bus.
Press Button-1 to stop receiving CAN messages and print the last 64 CAN frames and the HI-3110 status
registers on the serial console.
Press Button-4 to resume reception of CAN Messages.
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
12 Holt Integrated Circuits
Mode-4 LoopBack Mode
LoopBack mode combines a Transmitter and Receiver function similar to the normal Transmit and
Receive modes. The Transmitter will transmit the 32-bit incrementing counter in the data-field and the
receiver looks and compares against this data pattern and will turn on the RED LED the same way as in
normal Receive Mode. No actual data is transmitted to the Bus in LoopBack mode.
Button-2 - Stops transmitting CAN data and prints out the contents of the Transmit History FIFO as
shown below. Press Button-4 to continue.
History FIFO: 04 86 00
History FIFO: 04 87 00
History FIFO: 04 87 81
History FIFO: 04 88 03
History FIFO: 04 88 84
History FIFO: 04 89 06
History FIFO: 04 4D E2
Button-1 –Stop receiving CAN messages and prints the last 64 CAN frames and the HI-3110 status
registers on the serial console. Press Button-4 to resume receiving CAN Messages.
Mode-5 Transmit Extended Frames
This is the same as Transmit Mode-1 but with Extended Frame format.
Mode-6 Receiver Interrupt Mode
This is very similar to normal Receive mode-2 but without Sleep Mode. The main purpose is to
demonstrate how to use interrupts to received the CAN Bus data in the background.
Press Button-1 to stop receiving CAN messages and print the last 64 CAN frames and the HI-3110 status
registers on the serial console.
Press Button-4 to resume reception of CAN messages.
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
13 Holt Integrated Circuits
Mode-7 Serial Commands Menu
After a power on reset, a simple text menu will be displayed on the serial console:
************** HOLT HI-3110 Serial Console Commands
Input String Demo 0
Reset 1
Status Register Read 2
Filter Incrementing 3
Enter Selection:2
Enter “1” to generate a hardware reset to the HI-3110.
Enter “2” for the status register read and display:
CTR0 =80
CTR1 =00
BTR0 =00
BTR1 =00
TEC =00
REC =00
MESSTAT =00
STATF =00
ERR =00
INTF =00
INTE =82
STATFE =00
GPINE =00
TIMERUB =0D
TIMERLB =66
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
14 Holt Integrated Circuits
Software Description
The software project is built with Freescale’s Codewarrior version 5.9.0 using the free version which is
limited to 32K code size. The current code size is approximately 10.5K. The main functions are in main.c
and the lower level HI-3110 drivers are in the 3110Driver.c file. Some program flow charts are provided
to help clarify some of the program.
Project Files
Source Files
main.c Main code
3110Driver.C SPI low-level drivers for the HI-3110
Peripherals.c GPIO, PLL frequency setup and SPI configuration
BoardTest.c Board Test functions
Uart.c Low-level UART drivers
datapage.c Freescale IDE support file
Include Files
Main.h
3110Driver.h HI-3110 header file
Peripherals.h Peripherals header file
BoardTest.H Board test header file
Uart.h Uart header file
Common.h Common defines for the project
Derivative.h Freescale IDE support file
Mc9s12xdt512.h Freescale IDE target part support file
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
15 Holt Integrated Circuits
Main Flow Chart
Initialize GPIOs
GPIO interrupts
Initilize Timer0 periodic interrupt 100us
Display program revision on LEDs
Turn off all LEDs
Display header message on the serial console
Generate a hardware reset to the HI-3110
Test Mode?
Main.c
Transmit
Mode?
Receive Mode?
Serial
Commands?
Read Option Switches
Read Mode switches
Monitor Mode?
Loopback
Mode?
Receive
Interrupt
Mode?
Transmit Ext
Mode?
Test Mode
Transmit Mode
Receive Mode
Monitor Mode
Loopback Mode
Transmit Extended
Frame Mode
Receive Interrupt Mode
Serial Commands
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
16 Holt Integrated Circuits
Interrupt Flow Charts
Timer_ISR
Reload for next interrupt
Decrement g_count100us tick
1 second
handler?
return
Flash LED7
Yes
PortP_ISR
PP2 GP2 Pin?
return
Yes
PP3 GP1 Pin?
For Modes 1, 5
and 6
Fetch RX FIFO Data
Set Ready Flag
Clear Interrupt
Set G_TCPLTIE Flg
Clear Interrupt
Yes
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
17 Holt Integrated Circuits
Receiver Mode 1 Flow Chart
Receive Mode 2
Flash LED2
Initialize the UART
Print out mode on serial console
Initialize 3110? Turn on LED8
Halt
Initialize the GPINE pins
Initialize the STAT pin for RXFMTY
Clear the 64 frame buffer
SW1 button
pushed?
SW2 button
pushed?
SW3 button
pushed?
Get Error Status’
Get Status Flag
RXFMTY?
Stop and display 64
CAN frames
Stop and display
Status Registers
Stop and enter
Sleep Mode
fail
pass
Fetch Frame Data and load into
RXBuffer
Load LEDs1-4 with byte-3 of data-
field
OPT1 switch
open?
Increment 32-bit counter
Increment message count
Message count
= 64?
32-bit counter
compare?
Turn on RED
LED8 and Halt
No
Yes
Yes
No
Yes
Yes
Yes
Yes
SW4 button
pushed to
resume?
No
Yes
Reset Message
count to 0
Yes
No
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
18 Holt Integrated Circuits
Transmitter Modes 1 and 5 Flow Chart
Transmitter Mode 1
Flash LED1
Initialize the UART
Print out mode on serial console
Initialize
3110? Turn on LED8
Halt
Initialize the GPINE pins for
GP1=TXCPLT, GP2=RXFIFO
Clear TXBuffer
Print “Press Button-1 to start”
SW1 button
pushed?
SW2 button
pushed?
SW3 button
pushed?
Print Status
Regs
fail
pass
Yes
Yes
Yes
Wait for
Button-1
Pause
Print History
FIFO
Load 8 Std or Ext
Frames into FIFO
FIFO Empty?
OPT1 SW
open? Wait 100us
Wait for
TXCPLT
Yes
No
Yes
No
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
19 Holt Integrated Circuits
MCU Clock and SPI Frequency
The Freescale MC9S12XDT512 (MCU) uses a 4MHz crystal for operation and the built-in PLL is used to
multiply this by 20 to achieve an 80MHz system clock. This system clock is divided by two for a 40MHz
Bus Clock which is used internally for the MCU peripherals.
The PLL is programmed to multiply by 20 by this line:
SYNR = 9; // 80Mhz PLL system clock
The SPI frequency is set by this line of code:
SPI0BR = SPI_5MHZ; // SPI CLK = 5MHz (see
// “peripherals.c” for other rates)
Timer Interrupt and timings
A 100us Timer0 interrupt supports basic timings. A number of predefined constants are provided to
allow some common delays passed into the Delay100us() function:
#define K_1MS 10
#define K_10MS 100
#define K_100MS 1000
#define K_1SEC 10000
Usage: Delay100us(K_1SEC); // delay for one second
A one second interrupt handler in the TIMER_ISR is provided. Any code placed here will automatically
get executed every second.
if (!count100us)
{ // 1 second scheduler
count100us = K_1SEC;
if(ON==g_ledFlashBool) // Flash the
LED8 ^= TOGGLE; // Alive 1 second blink
}
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

AN-175
20 Holt Integrated Circuits
HI-3110 Interrupts
The HI-3110 can be configured to output status on the INT, STAT, GP1 and GP2 pins which connect to
the MCU PP0 –PP3 inputs. Interrupt handlers are provided for the GP1 and GP1 for servicing TXCPLT
and RXFIFO respectively on the PP3 and PP2 pins which are enabled by calling PortP_Int().
Interrupt 56 void PORTP_ISR(void)
The PP2 interrupt handler is provided to interrupt when the 3110 receives a CAN Bus frame of data. This
interrupt handler is utilized only in Receive Mode Interrupt Mode-6. Once an interrupt occurs the
interrupt handler fetches the frame of data and stores the data into a global buffer (g_RXBuffer) and
then sets a flag “g_RecRdy=TRUE”. The main receiver function looks for this flag and fetches the new
CAN data when this flag is set.
There are two other possible sources for hardware interrupts using the XIRQ and IRQ inputs reserved for
possible future use.
3110Driver.c Drivers
All the HI-3110 SPI drivers are contained in this module for reading and writing to the control registers,
status registers, filters/masks and FIFO’s .
There are several functions to read in a single byte from the 3110 SPI port, write a command to the 3110
SPI port and a few others which read or write a command plus a multiple number of bytes. For example
the function below is the basic function to write out a command plus one byte of data to the 3110 SPI
port.
// Write SPI Command with a Value to HI-3110
void W_CommandValue (uint8 cmd, uint8 value){
uint8 dummy;
SPI0CR1 = SPI0CR1 & ~SPI0CR1_SSOE_MASK; // disable auto /SS output, reset /SS Output
SPI0CR2 = SPI0CR2 & ~SPI0CR2_MODFEN_MASK; // disable auto /SS output, reset SPI0 Mode
SPI0_nSS = 0; // assert the SPI0 /SS strobe
dummy = SPI0SR; // clear SPI status register
SPI0DR = cmd; // SPI command
while (!SPI0SR_SPIF);
dummy = SPI0DR; // read Rx data in Data Reg to reset SPIF
dummy = SPI0SR; // clear SPI status register
SPI0DR = value; // Reset values
while (!SPI0SR_SPIF);
dummy = SPI0DR; // read Rx data in Data Reg to reset SPIF
SPI0_nSS = 1; // negate the SPI0 /SS strobe
SPI0CR1 = SPI0CR1 | SPI0CR1_SSOE_MASK; // enable auto /SS output, set /SS Output
SPI0CR2 = SPI0CR2 | SPI0CR2_MODFEN_MASK; // enable auto /SS output, set SPI0 Mode Fault
}
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.
Other manuals for HI-3110
2
This manual suits for next models
1
Table of contents
Other HOLT Motherboard manuals