CN1120423C - Interface method between microprocessor and CAN controller - Google Patents

Interface method between microprocessor and CAN controller Download PDF

Info

Publication number
CN1120423C
CN1120423C CN 01103932 CN01103932A CN1120423C CN 1120423 C CN1120423 C CN 1120423C CN 01103932 CN01103932 CN 01103932 CN 01103932 A CN01103932 A CN 01103932A CN 1120423 C CN1120423 C CN 1120423C
Authority
CN
China
Prior art keywords
sja1000
address
cpu
chip
signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
CN 01103932
Other languages
Chinese (zh)
Other versions
CN1300984A (en
Inventor
肖海华
张忠理
刘建飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Electric Power Research Institute of State Grid Zhejiang Electric Power Co Ltd
Original Assignee
SIFANG TONGCHUANG PROTECTION AND CONTROL EQUIPMENT CO Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SIFANG TONGCHUANG PROTECTION AND CONTROL EQUIPMENT CO Ltd filed Critical SIFANG TONGCHUANG PROTECTION AND CONTROL EQUIPMENT CO Ltd
Priority to CN 01103932 priority Critical patent/CN1120423C/en
Publication of CN1300984A publication Critical patent/CN1300984A/en
Application granted granted Critical
Publication of CN1120423C publication Critical patent/CN1120423C/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Bus Control (AREA)
  • Computer And Data Communications (AREA)

Abstract

The present invention provides an interface method between a microprocessor and a CAN controller. The present invention has the technical scheme that P2.7 of a microprocessor M37733 chip is used as a chip selection signal of SJA1000; P2.0 to P2.7 of CPU are orderly connected to D0 to D7 of SJA1000; simultaneously, a read signal R, a write signal W and an address latch signal ALE are orderly connected; P2.7 is connected with CS of SJA1000 through an NOT gate; P2.7 is used for addressing SJA1000, namely that P2.7 is set into the chip selection signal; P2.0 to P2.6 are set into address signals for addressing a ship internal memory of SJA1000. the present invention has the advantages of simple interface and simple and convenient programming; the present invention reduces CPU communication tasks, exerts the advantage of high CAN transmission speed and save a great amount of I/O ports; the present invention is easily extended into occasions that one CPU chip controls a plurality of CAN controllers.

Description

The interface method of microprocessor and CAN controller
Technical field
The present invention relates to the chip interface technical field, relate to the interface method of microprocessor and CAN controller particularly.
Background technology
CAN net (CONTROLLER AREA NETWORK) is a kind of novel serial fieldbus, the configuration gnosis of this bus, support a plurality of main websites, there is nondestructive bus arbitration scheme based on right of priority in each main website according to the right of priority access bus, and transmission speed is the fastest to reach 1MBIT/S, fault freedom is good, antijamming capability is strong, is well suited for industrial control field, is a kind of up-and-coming fieldbus.SJA1000 is the CAN controller that PHILIP company produces, and this controller is supported the CAN2.0B agreement, very strong packet filtering function is arranged, control is flexible, well selects when being expansion CAN network.
7700 series microprocessors (CPU) are 16 high-performance single-chip microcomputers that MIT produces, this serial CPU contains rich in natural resources, timer/counter is arranged, A/D converter, contain ram in slice and EPROM (FLASH), I/O mouth line is many, and processing speed is fast, when selecting the 24MHZ crystal oscillator for use, the short instruction execution time is 166ns.Having many uses of industrial control field.
Therefore, the simple and effective interface that designs between these two kinds of chips has very realistic meanings.
The interface signal of SJA1000 and CPU mainly contains: totally 8 of time-multiplexed address/data lines, address latch signal line, read-write control line, chip selection signal line.7700 serial CPU (is example with M37733) have 24 address wires, and wherein the address wire of most-significant byte can time division multiplex be a data line.Just because of M37733 is a most-significant byte address wire time division multiplex,, can not link to each other with bus so it has been generally acknowledged that them so when linking to each other with bus, be difficult to constitute correct chip selection signal with SJA1000.
Modal connected mode is the I/O mouth with CPU, this mode is actually with I/O mouth emulation bus, principle of work is as follows: as CPU during from certain storer reading of SJA1000, produce chip selection signal, gating SJA1000 earlier, CPU is changed to the way of output to the P7 mouth, the address of output storage produces the ALE of an address latch signal to SJA1000, and changing the P7 mouth then is input mode, produce an effective read signal, at this moment the P7 mouth is exactly needed numerical value.It is also roughly the same to write several processes in the SJA1000, and from as can be seen above, once simple read-write operation deals with very complicated.In fact, this is also very time-consuming, test amount factually, and the time of writing a byte approximately is 16us, the time of writing a frame message like this is 0.17ms.If the communication speed of CAN is set as 1MBIT/S, a frame message transmission time on the net approximately is 0.11ms.
Can see that thus there is following shortcoming in traditional interface mode: 1. the time ratio of writing a frame message passes the time of a frame message and also will grow, so that the interface between CPU and the CAN controller become the bottleneck of communication, serious reduction the speed of communication.Handle communication 2.CPU take much time, be subjected to very big restriction in this application mode of the demanding occasion of ask for something real-time like this.3. this interface mode has taken a large amount of I/O mouth of cpu chip, is unfavorable for further expanding of system.
Summary of the invention
The purpose of this invention is to provide simple and reliable interface method between a kind of microprocessor and the CAN controller, make these two kinds of chips can both bring into play separately advantage, make the work of the least possible processing communication of CPU, the fast advantage of CAN transmission speed can be fully played as far as possible.
Technical scheme of the present invention is to realize like this, by further investigation to SJA1000, the address realm of finding the SJA1000 storer is 00-7FH, and the highest addresses line is invalid, that is to say concerning SJA1000,00H and 80H represent the address of same storer, and the like, n and n+80H represent the address of same storer.According to this thinking, we can come addressing SJA1000 by P2.7 (most significant digit of time-multiplexed address, data line), promptly P2.7 are arranged to chip selection signal, and P2.0-P2.6 is arranged to the on-chip memory of address signal in order to addressing SJA1000.So the specific address of No. 00 storer of SJA1000 is 80 * * * * H (* expression can be any numerical value), the specific address of No. 01 storer of SJA1000 is 81 * * * * H, the address of last storer of SJA1000 be OFF * * * * H.
A kind of microprocessor M37733 chip and a slice CAN controller SJA1000 method of attachment are: with the most significant digit of the time-multiplexed address of P2.7 of microprocessor M37733 chip, the data line chip selection signal as SJA1000, the P2.0-P2.7 of CPU is received successively the D0-D7 of SJA1000, connected simultaneously read signal R successively, write signal W, address latch signal ALE; P2.7 is connected with the CS of SJA1000 through a not gate, and the specific address of No. 00 storer of SJA1000 is 80 * * * * H, * expression can be any numerical value, the address of the 10H storage unit of SJA1000 is 90 * * * * H.7700 serial CPU are when being used for the memory expansion mode, and maximum addressing range is OFFFFFFH, so above-mentioned address is still in the addressable scope of CPU.
In this way, can change a little and just be used in the occasion with a plurality of CAN nets, in use, the part address wire of P2.7 and P0 or P1 mouth be formed chip selection signal through logical combination get final product with a CPU.
The advantage of interface method of the present invention is that interface is simple, it is simple and convenient to programme, and CPU is freed from the task of heavy intervention communication, can give full play to the fast advantage of CAN transmission speed, save a large amount of I/O mouths, be easily extended to the occasion of controlling a plurality of CAN controllers with a cpu chip.
Description of drawings
Below in conjunction with accompanying drawing the specific embodiment of the present invention is described in further detail.
Fig. 1 is the synoptic diagram of the interface method of prior art;
Fig. 2 is the synoptic diagram of interface method of the present invention;
Fig. 3 is the synoptic diagram of the interface method of an alternative embodiment of the invention.
Embodiment
Fig. 1 is the synoptic diagram of the interface method of prior art.Modal connected mode is the I/O mouth with CPU.This mode is actually with I/O mouth emulation bus, principle of work is as follows: as CPU during from certain storer reading of SJA1000, produce chip selection signal earlier, gating SJA1000, CPU is changed to the way of output to the P7 mouth, the address of output storage, produce the ALE of an address latch signal to SJA1000, changing the P7 mouth then is input mode, produces an effective read signal, and at this moment the P7 mouth is exactly needed numerical value.It is also roughly the same to write several processes in the SJA1000, and from as can be seen above, once simple read-write operation deals with very complicated.In fact, this is also very time-consuming, test amount factually, and the time of writing a byte approximately is 16us, the time of writing a frame message like this is 0.17ms.If the communication speed of CAN is set as 1MBIT/S, a frame message transmission time on the net approximately is 0.11ms.
Fig. 2 is the synoptic diagram of interface method of the present invention; The interface instance of 7700 serial CPU and CAN controller SJA1000 is listed below, and CPU is example with M37733.When M37733 chip and a slice SJA100 method of attachment: with the chip selection signal of P2.7 (most significant digit of time-multiplexed address, data line) as SJA1000, the P2.0-P2.7 of CPU is received successively the D0-D7 of SJA1000, simultaneously connected read signal R successively, write signal W, address latch signal ALE; The specific address of No. 00 storer of SJA1000 is 80 * * * * H (* expression can be any numerical value), the address of the 10H storage unit of SJA1000 is 90 * * * * H; During from No. 00 storer reading of SJA1000, with an instruction LDA A, 80 * * * * H is just passable; When counting toward the 10H memory write of SJA1000, with instruction STA A, 90 * * * * H.
Fig. 3 is the synoptic diagram of the interface method of an alternative embodiment of the invention.When needs are controlled two CAN controllers with a cpu chip, on the basis of Fig. 2, revise getting final product a little, as shown in Figure 3, the sheet of first SJA1000 elder generation signal is produced jointly by address wire P2.7 and the P1.7 of CPU.So the address of No. 00 storer of first SHA1000 is 808 * * * H, the address of No. 01 storer is 818 * * * H; The sheet elder generation signal of second SJA1000 is produced jointly by address wire P2.7 and the P1.6 of CPU, so the address of No. 00 storer of second SHA1000 is 804 * * * H, the address of No. 01 storer is 814 * * * H, the address of other storer can and the like.With this connected mode, CPU just can realize with an instruction the read-write operation of SJA1000 internal storage.
When needs when controlling a plurality of CAN controller with a cpu chip, interface and addressing method are basic identical.

Claims (3)

1. microprocessor M37733 chip and CAN controller SJA1000 method of attachment, it is characterized in that: with the most significant digit of the time-multiplexed address of P2.7 of microprocessor M37733 chip, data line chip selection signal as SJA1000, the P2.0-P2.7 of CPU is received successively the D0-D7 of SJA1000, connected simultaneously read signal R successively, write signal W, address latch signal ALE; P2.7 is connected with the CS of SJA1000 through a not gate, and the specific address of No. 00 storer of SJA1000 is 80 * * * * H, * expression can be any numerical value, the address of the 10H storage unit of SJA1000 is 90 * * * * H.
2. according to the method for claim 1, it is characterized in that: described 7700 serial CPU are when being used for the memory expansion mode, and maximum addressing range is OFFFFFFH, so above-mentioned address is still in the addressable scope of CPU.
3. according to the method for claim 2, it is characterized in that: described 7700 serial CPU form chip selection signal to the part address wire of P2.7 and P0 or P1 mouth through logical combination and get final product during with the occasion of a plurality of CAN net.
CN 01103932 2001-02-15 2001-02-15 Interface method between microprocessor and CAN controller Expired - Lifetime CN1120423C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 01103932 CN1120423C (en) 2001-02-15 2001-02-15 Interface method between microprocessor and CAN controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 01103932 CN1120423C (en) 2001-02-15 2001-02-15 Interface method between microprocessor and CAN controller

Publications (2)

Publication Number Publication Date
CN1300984A CN1300984A (en) 2001-06-27
CN1120423C true CN1120423C (en) 2003-09-03

Family

ID=4653559

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 01103932 Expired - Lifetime CN1120423C (en) 2001-02-15 2001-02-15 Interface method between microprocessor and CAN controller

Country Status (1)

Country Link
CN (1) CN1120423C (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100369020C (en) * 2005-01-19 2008-02-13 英华达(上海)电子有限公司 Method of replacing special hardware interface for NAND type flash memory
CN101639692B (en) * 2009-08-31 2011-11-16 杭州华三通信技术有限公司 Method, equipment and system for controlling a plurality of programmable logical components
CN104181828B (en) * 2014-08-12 2017-01-25 北京控制与电子技术研究所 CAN bus controller adaptor
CN104575397B (en) * 2015-02-09 2017-01-25 东华大学 Dynamic LED (Light Emitting Diode) display circuit capable of reducing occupation of I/O (input/output) port of microprocessor
CN105487438A (en) * 2015-11-26 2016-04-13 中国电子科技集团公司第十八研究所 CAN bus controller SJA1000 and DSP interface control method

Also Published As

Publication number Publication date
CN1300984A (en) 2001-06-27

Similar Documents

Publication Publication Date Title
CN103714026A (en) Memorizer access method and device supporting original-address data exchange
US20100017544A1 (en) Direct memory access controller and data transmitting method of direct memory access channel
CN101958152A (en) NAND FLASH controller and application thereof
US20040148606A1 (en) Multi-thread computer
CN1120423C (en) Interface method between microprocessor and CAN controller
CN114610472B (en) Multi-process management method in heterogeneous computing and computing equipment
CN1758208A (en) Method of proceeding access multikind storage on chip select outer unibus
CN106980587A (en) A kind of universal input output timing processor and sequential input and output control method
CN2869992Y (en) Switch-over circuit from high-speed interface to low-speed interface
US7228393B2 (en) Memory interleaving
CN115599719A (en) FIFO interface multichannel DMA controller based on FPGA
CN103389893A (en) Read-write method and device for configuration register
CN112333067B (en) Communication system and method for parallel operation of multiple controller systems
CN201662798U (en) Port mapping device conversion device and control system
CN1333344C (en) Method for reducing software load of system-on-chip (SoC)
CN101989241B (en) Read-modify-write processing system and method
CN1191530C (en) PCI bridge with improved structure
SU1072054A1 (en) Multiprocessor grate-controller
CN1365058A (en) General asynchronous serial port controller
CN106874235B (en) Analog DPRAM communication system and method based on SPI serial link
JPS592058B2 (en) Storage device
CN109542836A (en) A kind of SOC chip and embedded system of integrated dual processor
CN215526657U (en) High-speed communication module and variable frequency controller of ARM chip and FPGA chip
CN2197694Y (en) Digital controller with multi-microprocessor memory
CN205540213U (en) Numerical control IO bus control system

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
ASS Succession or assignment of patent right

Owner name: SIFANG TONGCHUANG PROTECTION AND CONTROL EQUIPMEN

Free format text: FORMER OWNER: BEIJING HADEWEI SIFANG PROVENTION AND CONTROLLING EQUIPMENT CO., LTD.

Effective date: 20010622

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20010622

Applicant after: Sifang Tongchuang Protection and Control Equipment Co., Ltd.

Applicant before: Hadewei Sifang Protection and Control Equipment Co Ltd, Beijing

C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: BEIJING SIFANG JIBAO AUTOMATION CO., LTD.

Free format text: FORMER OWNER: SIFANG TONGCHUANG PROTECTION AND CONTROL EQUIPMENT CO., LTD., BEIJING

Effective date: 20040514

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20040514

Patentee after: Beijing Sifang Jibao Automation Co., Ltd.

Patentee before: Sifang Tongchuang Protection and Control Equipment Co., Ltd.

EE01 Entry into force of recordation of patent licensing contract

Assignee: Nanjing Sifang Epower Electric Power Automation Co., Ltd.

Assignor: Beijing Sifang Jibao Automation Co., Ltd.

Contract fulfillment period: 2007.10.15 to 2013.9.30

Contract record no.: 2008320000072

Denomination of invention: Interface method between microprocessor and CAN controller

Granted publication date: 20030903

License type: Exclusive license

Record date: 20080813

LIC Patent licence contract for exploitation submitted for record

Free format text: EXCLUSIVE LICENCE; TIME LIMIT OF IMPLEMENTING CONTACT: 2007.10.15 TO 2013.9.30

Name of requester: NANJING SIFANG YINENG POWER AUTOMATION CO., LTD.

Effective date: 20080813

ASS Succession or assignment of patent right

Owner name: CHINA RESEARCH INSTITUTE OF ZHEJIANG ELECTRIC POWE

Effective date: 20141115

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20141115

Address after: 100085, No. four, nine street, information industry base, Haidian District, Beijing

Patentee after: Beijing Sifang Jibao Automation Co., Ltd.

Patentee after: State Grid Zhejiang Electric Power Corporation Research Institute

Address before: 100085, No. four, nine street, information industry base, Haidian District, Beijing

Patentee before: Beijing Sifang Jibao Automation Co., Ltd.

CX01 Expiry of patent term

Granted publication date: 20030903

CX01 Expiry of patent term