SPI Interrupt help needed

Started by adlai15 in 68HC1212 years ago 1 reply

Hi, I'm using a 9S12NE64 and am trying to communicate throught the SPI port. For some reason, the SPI's SPTEF interrupt is never...

Hi, I'm using a 9S12NE64 and am trying to communicate throught the SPI port. For some reason, the SPI's SPTEF interrupt is never clearing. I'm initializing the SPI with the following code: SPICR1 = 0xD4; // Enable SPI, SPI Interrupt, Disable Transmit Int, Master Mode, Active low SCLK, MSBit first SPICR2 = 0x00; // Normal


MC9S12A256 I/O ports configuration

Started by chen_xuesong in 68HC1214 years ago 1 reply

Hello friends, When I am using the 16bit MCU MC9S12A256, I found Port P and Port H can both be configured for SPI 1 and SPI 2....

Hello friends, When I am using the 16bit MCU MC9S12A256, I found Port P and Port H can both be configured for SPI 1 and SPI 2. So if I enable SPI 1 and SPI 2 functions, which port is working as SPI signals? I think it should be one port for SPI and the other port for genera


SPI

Started by RUDY CEPEDA in 68HC1212 years ago 2 replies

Hi all. I'm trying to comunicate a HC912B32 with an Analog Devices ADIS16003 Accelerometer through SPI. I wrote the code that follows,...

Hi all. I'm trying to comunicate a HC912B32 with an Analog Devices ADIS16003 Accelerometer through SPI. I wrote the code that follows, for the initialization of the SPI and comunication woth de peripheral: void inicia_SPI(void){ /*************************************************** * Funci?n de inicializaci?n del m?dulo SPI, act?a * * sobre los registros de control del SPI p


SPI Bug (undocumented) on 9S12DG128B - Mask 0L85D

Started by Sam Saprunoff in 68HC1212 years ago 3 replies

Good day Everyone! Here is an undocumented SPI Bug that I came across yesterday... Device: MC9S12DG128BCFU (80 pin QFP) (Mask 0L85D) ...

Good day Everyone! Here is an undocumented SPI Bug that I came across yesterday... Device: MC9S12DG128BCFU (80 pin QFP) (Mask 0L85D) SPI Port: SPI0 Problem: The SPI0 pins/system becomes clobbered when the Data direction register associated with the shared SPI pins is set (in particular when Bit 3 is set). According to the SPI sp


Honywell HMR3200 Digital Compass on SPI?

Started by polyphon1890 in 68HC1214 years ago 5 replies

Hi, Have any of you people hooked one of these up to the SPI? I got it working through it's UART mode by putting it on SCI1,...

Hi, Have any of you people hooked one of these up to the SPI? I got it working through it's UART mode by putting it on SCI1, but I'd rather have it on the SPI. Nothing I've tried works. It is supposed to spit out an 0x73 ('s') when it wakes up but the closest I get is an ex


Help with SPI Setup!

Started by adax3 in 68HC1212 years ago 7 replies

Hello: I am using (well, trying to) the 9S12DP256B to simply get the output of an SPI Analog Devices 8bit SPI ADC (AD7823YR). I'm...

Hello: I am using (well, trying to) the 9S12DP256B to simply get the output of an SPI Analog Devices 8bit SPI ADC (AD7823YR). I'm not sure if I'm setting it up right, as I am NOT getting a clock signal out. My init code is as follows (using Codewarrior 5.5 IDE): PTS = 0; // port S zero DDRS = 0x00; // port S direction (0-7 inputs)


SPI on S12E128

Started by Andrew Lohmann's New Email Server in 68HC1214 years ago 5 replies

Hi, My SPI interface hooks up waiting for (SPI.spisr.byte & SPIF) to clear. The software I am trying to run a very simple spi...

Hi, My SPI interface hooks up waiting for (SPI.spisr.byte & SPIF) to clear. The software I am trying to run a very simple spi interface base on:- // File: S12_SPI.C - V1.00 // Rem.: The ACPRD Project Page on the Web -> http://hc12web.de/acprd


Re: SPI with PNI V2XE

Started by lane...@gmail.com in 68HC1210 years ago

I have the exact same problem using an MSP430 board. Any help would be greatly appreciated. > > > > I am using PNI's Vector 2XE...

I have the exact same problem using an MSP430 board. Any help would be greatly appreciated. > > > > I am using PNI's Vector 2XE compass with a DP256B. This device uses > the SPI, I am using P&E to set up the SPI, and all I can do is Send > data, I receive nothing back? Has anyone used this device before and > if so help? > > > > >


Re: Multiple SPI ports

Started by Mike Elphick in 68HC1214 years ago

Bruce says:- > Boy, I sure would like a second SPI port right now. In some instances you don't really need an SPI...

Bruce says:- > Boy, I sure would like a second SPI port right now. In some instances you don't really need an SPI port, as one can use general purpose i/o lines to do the same thing. For example interfacing an AD7705 is not too difficult. Slower, agreed, and


SPI on MC9S12DP256B

Started by Andrew Lohmann in 68HC1213 years ago 4 replies

Hi, I have been using the spi port on MC9S12E128 successfully for some time. I am now working on another target which uses...

Hi, I have been using the spi port on MC9S12E128 successfully for some time. I am now working on another target which uses MC9S12DP256B instead. Unfortunately the spi does not work on this other target, which I have two of. I have worked through the erratas for silic


Multiple SPI ports, absurd? Well, no.

Started by Bruce McMillan in 68HC1214 years ago 2 replies

User feedback. The SPI port is designed to multiplex many peripherals in a polling fashion. So why would you want more than one? ...

User feedback. The SPI port is designed to multiplex many peripherals in a polling fashion. So why would you want more than one? Well, I have found it useful in the past where I have needed to have the SPI bus go into sensitive parts of the board, to say control digital


SPI errata - do I have this problem?

Started by Ron Dolling in 68HC1214 years ago 4 replies

SPI errata - SPTEF flag set erroneously. MUCts00741 I think that I may be having the problem described in this errata with ...

SPI errata - SPTEF flag set erroneously. MUCts00741 I think that I may be having the problem described in this errata with my SPI port, but I am not sure. I'm trying to run code on a 9S12DJ256 that was running without problems on a 68HC912B32. I've made changes


pb with spi

Started by Pascal in 68HC1213 years ago 1 reply

Hello, I use 9s12A64. I want to use the SPI. I configure it like this SPI0BR=5; SPI0CR2 = BIDIROE|SPISWAI; SPI0CR1 =...

Hello, I use 9s12A64. I want to use the SPI. I configure it like this SPI0BR=5; SPI0CR2 = BIDIROE|SPISWAI; SPI0CR1 = SPE|MSTR|CPOL|CPHA; I write data like that : BYTE WriteSPI0Byte(BYTE abyte) { //Caractere dans le BufCardMem SPI SPI0DR = abyte; //Attend le transfert des donn?es while((SPI0SR &


Problem with SPI bus in XIRQ interrupt

Started by ymliao in 68HC129 years ago

Hi! I use MC9S12E128 micro in my application, and XIRQ interrupt to handle power fail. In the XIRQ interrupt, I need to save data to memory...

Hi! I use MC9S12E128 micro in my application, and XIRQ interrupt to handle power fail. In the XIRQ interrupt, I need to save data to memory via the SPI bus. And I notice that sometimes the SPI bus is not working properly: 1) data appears on the bus is not what's being sent by the micro 2) SPI bus clock becomes scrunched up (before power fails, there is some idle time between each group...


S12E128 SPI CPHA logic inverted?

Started by Bruce McMillan in 68HC1214 years ago 3 replies

User feedback. Porting code from DP256 to E128, it seems that the CPHA logic may be inverted from that described in the SPI module...

User feedback. Porting code from DP256 to E128, it seems that the CPHA logic may be inverted from that described in the SPI module documentation (and inverted from the standard implementation of the SPI port on various versions). It's possible that the problem is noise o


HCS12 SPI Problem

Started by johann_zimmermann in 68HC1212 years ago 4 replies

Hello, I use 9s12dg256B, CW3.1 pro compiler, void SPI1_SendChar(unsigned char Chr) { while(!SPI1SR_SPTEF); SPI1DR = Chr; } ...

Hello, I use 9s12dg256B, CW3.1 pro compiler, void SPI1_SendChar(unsigned char Chr) { while(!SPI1SR_SPTEF); SPI1DR = Chr; } void SPI1_Init(void) { SPI1BR = 0; // CR2 Init SPI1CR2 = 0; // CR1 Init SPI1CR1 = 0; // SPI 1 Master/Slave Mode Select Bit SPI1CR1_MSTR = 1; // SPI


Pb with SPI1SR and SPIF

Started by Pascal in 68HC1212 years ago 6 replies

Hello, I have this code for spi. BYTE WriteSPI1Byte(BYTE abyte) { //Caractere dans le BufCardMem SPI SPI1DR=abyte; ...

Hello, I have this code for spi. BYTE WriteSPI1Byte(BYTE abyte) { //Caractere dans le BufCardMem SPI SPI1DR=abyte; //Attend le transfert des donn?es while((SPI1SR&SPIF)==0); //retourne la valeur renvoy?e par l'esclave return(SPI1DR); } My problem is that if i have no spi slave SP


Problem with 9S12C32 SPI input

Started by Maria A. Lobo in 68HC1212 years ago 1 reply

Hello all , We are having a problem with SPI read from an external EEPROM We are using the SPI in polling mode . What is...

Hello all , We are having a problem with SPI read from an external EEPROM We are using the SPI in polling mode . What is needed is a write to EEPROM at a single address . and then at some other point read back the data from that address. The EEPROM used is AT 25160A . What happens here is that the write is successful an


Maximum SPI bus speed

Started by Anonymous in 68HC1215 years ago 5 replies

p 83 of the MC(S12A256 Device Guide V01.00 states that the maximum value of the Spi bus is 1/4 of the bus frequency. Page 17 of the...

p 83 of the MC(S12A256 Device Guide V01.00 states that the maximum value of the Spi bus is 1/4 of the bus frequency. Page 17 of the SPI Block Users Guide V02.06 states that the maximum frequency can be Bus clock /2. Which is correct?


SPI write MOSI ilde low?

Started by Mongkol sent by Nabble.com in 68HC1212 years ago 1 reply

Hello all, I am using the 9S12DP256 to the output signal of an SPI Analog Devices 16bit SPI ADC (AD7708) void init_spi(){ ...

Hello all, I am using the 9S12DP256 to the output signal of an SPI Analog Devices 16bit SPI ADC (AD7708) void init_spi(){ IO_PORTS_8(DDRS)=0x60; //MOSI ,CLK ouput IO_PORTS_8(SPI0BR)=0x47; //clk 20.1 kHz IO_PORTS_8(SPI0CR1)=0x58; //MSTR=1 ,CPOL =1,CPHA =0 ,SPE =1 IO_PORTS_8(SPI0CR2)=0x00; } void spi_wr(unsigned int code){char