HOLT HI-3110 Скачать руководство пользователя страница 20

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.

Содержание HI-3110

Страница 1: ...AN 175 Rev B Holt Integrated Circuits ADK 175 User s Guide HI 3110 Evaluation Board April 2020 Downloaded from Arrow com...

Страница 2: ...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 To...

Страница 3: ...2XDT512 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 a...

Страница 4: ...ake 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 Tran...

Страница 5: ...set 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...

Страница 6: ...op 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 rece...

Страница 7: ...o 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...

Страница 8: ...hematic 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...

Страница 9: ...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 accepte...

Страница 10: ...nter 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 Mod...

Страница 11: ...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 tur...

Страница 12: ...N 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...

Страница 13: ...110 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 A...

Страница 14: ...tion 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 Bo...

Страница 15: ...ceive 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 Y...

Страница 16: ...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...

Страница 17: ...EDs1 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 b...

Страница 18: ...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 Arro...

Страница 19: ...e 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...

Страница 20: ...ead 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 V...

Страница 21: ...ilable in the define statements Uart c Serial Port RS 232 The drivers to support the serial port are contained in this module There are some function drivers to allow messages to be sent and received...

Страница 22: ...VE MODE Select receive mode from the SW1 dip switches and the program will go directly into this mode after a power on reset The receive mode reads in a frame by first examining the receive FIFO empty...

Страница 23: ...0 W_MASK2 0xFF 0x00 0x00 0x00 0x00 0x00 W_MASK3 0x00 0x00 0x00 0x00 0x00 0x00 Accept everything with filter 3 W_MASK4 0xFF 0x00 0x00 0x00 0x00 0x00 W_MASK5 0xFF 0x00 0x00 0x00 0x00 0x00 W_MASK6 0xFF 0...

Страница 24: ...uments may still refer to the old debugger shown below PN USBMULTILINKBDME A suitable replacement is the PE Micro USB Multilink Universal A more advanced option is the PE Micro USB Multilink Universal...

Страница 25: ...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 Download...

Страница 26: ...2 OHM 1 1 8W 0805 R9 R10 311 4 02CRCT ND 30 2 Res 60 4 Ohm 1 4W 1 1210 SMD R15 R19 RHM60 4BDCT ND 31 1 Res 0 ohm 1 8W 5 0805 SMD R7 RHM0 0ARCT ND 32 1 Res 1 5M 1 8W 5 0805 SMD R39 RHM1 5MARCT ND 33 1...

Страница 27: ...V C3 10uF 10V R7 0 OHM R7 0 OHM J2 DB9F J2 DB9F 5 9 4 8 3 7 2 6 1 L1 F BEAD 1 4A L1 F BEAD 1 4A R18 3 3K R18 3 3K R14 680 R14 680 C28 1uF C28 1uF R1 680 R1 680 C24 01uF C24 01uF LED8 LED8 JP3 JUMPER J...

Отзывы: