Diferences between IIC1C1 and IIC1C - JM128

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Diferences between IIC1C1 and IIC1C - JM128

4,500 次查看
mauricio2346
Contributor II

Hi folks.

i benn trying to make work IIC module on JM128 core.

first, using a routine from AN3291, requires to poll over a flag.  it's supposed that polling over a flag doesn't need an interruption routine, but, i need that interrupt routine to clear a flag....

 

also, i need to know the diference between IIC1C and IIC1C1 registers... header files shows that they're exactly the same, but, i've my doubts.  plus, BUSY flag doesn't seems to work...

 

any help????

 

Regards; 

标签 (1)
0 项奖励
回复
19 回复数

4,013 次查看
TomE
Specialist II

There is no IIC1C register in the manual. It meant something to whoever wrote the header. Ignore it.

 

What do you mean "Busy doesn't work"? It only sets DURING a transfer.

 

Read section "13.6 Interrupts". That should give you enough informaiton to start writing test code.

 

Tom

 

0 项奖励
回复

4,013 次查看
mauricio2346
Contributor II
Im asking qbout that register, because compiller adds this "phantom register". i was wondering if that register would cause troubles with module or even the mcu. ibeen trying also to use busy flag to check the buffer. Its supposed that this flG is set when start condition is injected into the bus, and resets when stop condition is generated. I cant make this bit to "work".
i've also another question. I could reqd and write data from a 24LC01B eeprom. Why mcu works fine when started from simulator (step by step running during two cicles, then continous running). But not by itself, at bus clock as standalone device?
0 项奖励
回复

4,013 次查看
TomE
Specialist II

I can't see your header files from here, so I can't tell what it means by IIC1C and IIC1C1. I suspect IIC1C1 might be used to make a byte access to that register, whereas IIC1C might perform a 16 or 32 bit access. Post just the lines defining the IIC registers from the header and we'll see.

 

Forget the BUSY bit. You should be using the TXF flag to know when the transfer has finished.

 

It works when you single-step but not when you let it run? Then your code isn't waiting for the transfer to finish, and when you're single-stepping you're giving the hardware enough time for the cycles to complete. You should probably be polling TXF.

 

You should start from some working code and then change it step by step.

 

Your original question was:

 

> using a routine from AN3291, requires to poll over a flag.

 

Section 3.4 of that App Note gives a worked example using Interrupts.

 

Another idea. As I said in another recent post to this forum:

 

Cue Mark Butcher and uTasker:

 

http://www.utasker.com/

 

"The µTasker supports specific network enabled processors and is free to use in educational, hobby and other non-commercial projects.". It may have I2C code.

 

Are you "Educational or Hobby"?

 

Tom

 

0 项奖励
回复

4,013 次查看
mauricio2346
Contributor II

Hi Tom.

this is the definitions of those registers on header files.  as you can see, they are the same, that's why im asking:

/*** IIC1C1 - IIC Control Register 1; 0xFFFF805A ***/typedef union {  byte Byte;  union { /* Several registers at the same address */    /*** IIC1C1 - IIC Control Register 1; Several registers at the same address ***/    union {      struct {        byte             :1;         byte             :1;         byte RSTA        :1;                                       /* Repeat START */        byte TXAK        :1;                                       /* Transmit Acknowledge Enable */        byte TX          :1;                                       /* Transmit Mode Select */        byte MST         :1;                                       /* Master Mode Select */        byte IICIE       :1;                                       /* IIC Interrupt Enable */        byte IICEN       :1;                                       /* IIC Enable */      } Bits;    } IIC1C1STR;    #define IIC1C1                      _IIC1C1.Byte    #define IIC1C1_RSTA                 _IIC1C1.SameAddr_STR.IIC1C1STR.Bits.RSTA    #define IIC1C1_TXAK                 _IIC1C1.SameAddr_STR.IIC1C1STR.Bits.TXAK    #define IIC1C1_TX                   _IIC1C1.SameAddr_STR.IIC1C1STR.Bits.TX    #define IIC1C1_MST                  _IIC1C1.SameAddr_STR.IIC1C1STR.Bits.MST    #define IIC1C1_IICIE                _IIC1C1.SameAddr_STR.IIC1C1STR.Bits.IICIE    #define IIC1C1_IICEN                _IIC1C1.SameAddr_STR.IIC1C1STR.Bits.IICEN        #define IIC1C1_RSTA_MASK            4    #define IIC1C1_TXAK_MASK            8    #define IIC1C1_TX_MASK              16    #define IIC1C1_MST_MASK             32    #define IIC1C1_IICIE_MASK           64    #define IIC1C1_IICEN_MASK           128        /*** IIC1C - IIC Control Register; Several registers at the same address ***/    union {      struct {        byte             :1;         byte             :1;         byte RSTA        :1;                                       /* Repeat START */        byte TXAK        :1;                                       /* Transmit Acknowledge Enable */        byte TX          :1;                                       /* Transmit Mode Select */        byte MST         :1;                                       /* Master Mode Select */        byte IICIE       :1;                                       /* IIC Interrupt Enable */        byte IICEN       :1;                                       /* IIC Enable */      } Bits;    } IIC1CSTR;    #define IIC1C                       _IIC1C1.Byte    #define IIC1C_RSTA                  _IIC1C1.SameAddr_STR.IIC1CSTR.Bits.RSTA    #define IIC1C_TXAK                  _IIC1C1.SameAddr_STR.IIC1CSTR.Bits.TXAK    #define IIC1C_TX                    _IIC1C1.SameAddr_STR.IIC1CSTR.Bits.TX    #define IIC1C_MST                   _IIC1C1.SameAddr_STR.IIC1CSTR.Bits.MST    #define IIC1C_IICIE                 _IIC1C1.SameAddr_STR.IIC1CSTR.Bits.IICIE    #define IIC1C_IICEN                 _IIC1C1.SameAddr_STR.IIC1CSTR.Bits.IICEN        #define IIC1C_RSTA_MASK             4    #define IIC1C_TXAK_MASK             8    #define IIC1C_TX_MASK               16    #define IIC1C_MST_MASK              32    #define IIC1C_IICIE_MASK            64    #define IIC1C_IICEN_MASK            128      } SameAddr_STR; /*Several registers at the same address */} IIC1C1STR;extern volatile IIC1C1STR _IIC1C1 @0xFFFF805A;

 ok, i'll use TXF Flag.  

when i single step the program, it works.  i have to cicle the code into the infinite loop twice and then let it run.  the program runs fine, even when closing simulator and compiller.   if i run directly or reset the MCU, the code doesn't run.   i added delays between readings and register addressing (10ms and lower), but nothing seems to work.  

 

i've another question.  i need to receive 6 bytes of data after adressing.  i read about restart condition between data bytes like this:

 

Start/Comand+W/Adress/Restart/Command+R/Read byte/Ack/Stop.

 

what if i like to read more than one byte???

 

Start/Comand+W/Adress/ACK/Restart/Command+R/Read byte 1/ACK/Restart/Read Byte 2/ACK/Restart/......//NAck/Stop.

??? 

 

0 项奖励
回复

4,013 次查看
TomE
Specialist II

Thanks for including the header.

 

It isn't obvious what they're doing there. It is very unobvious to anyone who hasn't been following the "Obfuscated C Contests" what is going on there.

 

It isn't defining "multiple registers", just defining multiple ways to get to the bits in the same register by severe abuse of the C Preprocessor.

 

The comment in that header says "Several registers at the same address", but that's either a cut-and-paste bug from some code where they were defining multiple registers, or the writer uses "registers" in a strange way.


Anyone using these techniques should not require the end users to have to read and decode that file in order to work out how to use it. There should be separate clear documentation listing examples of how to get to the registers and the bits in those registers.

 

> i added delays between readings

 

Delays are always a mistake. You're not waiting for the proper events.

 

You either have to understand EVERYTHING about I2C so you can write guaranteed working code from scratch or you have to find good working code you can just use without having to understand it.

 

Have you looked at uTasker? You didn't answer my questions about this in my previous post.

 

> what if i like to read more than one byte???

 

Get sample code that does that already or understand everything. What the I2C data you send to the chiip at the other end does (read/write/command etc) depends on the chip at the other end. You have to read its data sheet too.

 

Tom

 

0 项奖励
回复

4,013 次查看
mauricio2346
Contributor II

Hi Tom.

i believe that header definitions for I2C module with those registers would be a "factory bug" for this processor.  im using IIC1C1 with no problems right know. as you think, i'm not a "C programmer genius".

 

Utasker looks interesting!!  this project is just for "hobby purposes".  i will send a request to download a evaluation. 

 

although this is my first "real" application using I2C with Freescale MCU, i've tested it with Microchip Microcontrollers using eeprom's, humidity sensors, tone generators, etc.in all cases, i wrote the routines. even i adapted routines for Microchip and Anduino cores to work with freescale MCU's with no problem (SCI, LCD)  i've tested eeproms with this core (JM128) too with success.  device datasheets are usefull, but, in this case i've no datasheet for the device.  is a wii motion plus, there's some information in internet, but, seems to be ambigous. im using delays between commands, but also checking RXAK flag.  i 'll poll TXF flag.

 

Regards;

Mauricio 

 

0 项奖励
回复

4,013 次查看
TomE
Specialist II

> but also checking RXAK flag.  i 'll poll TXF flag.

 

Yes, check the RXAK flag AFTER the poll for TXF has finished (but see below first). That bit is there to tell you that you started a transfer, but the slave didn't respond, not that a transfer has completed. If the slave isn't there or is stuck or you got the address wrong the code might wait forever. This bit isn't set when the ACK is received - it is set when the ACK ISN'T received. it is only valid after the transfer has completed (and you have to be monitoring other status bits to determine that).

 

Search the Freescale site for "MCF5282I2C". You'll find a "MCF5282I2C.zip" file. That's what I started with. It is a different CPU to yours and the register names are probably different. I'd also suggest you read the I2C chapters in some other manuals, in case they're more detailed that the ones you're reading.

 

I'm reading the MCF5329 manual. It has polling for BSY for some parts of the transfer, but recommends polling IIF instead of ICF (for your chip that's IICIF instead of TCF) as they behave differently when arbitration is lost. There's a few sections in that chapter that look to be in addition to what is in your manual, and may help you. Quoting:

 

32.4.3
Post-Transfer Software Response
Sending or receiving a byte sets the I2SR[ICF], which indicates one byte communication is finished.
I2SR[IIF] is also set. An interrupt is generated if the interrupt function is enabled during initialization by
setting I2CR[IIEN]. Software must first clear I2SR[IIF] in the interrupt routine. Reading from I2DR in
receive mode or writing to I2DR in transmit mode can clear I2SR[ICF].
Software can service the I2C I/O in the main program by monitoring the IIF bit if the interrupt function is
disabled. Polling should monitor IIF rather than ICF, because that operation is different when arbitration
is lost.
When an interrupt occurs at the end of the address cycle, the master is always in transmit mode; the address
is sent. If master receive mode is required, I2CR[MTX] should be toggled.

Tom

 

0 项奖励
回复

4,013 次查看
JimDon
Senior Contributor III

 IICC is for a part with only one I2C module. IIC1C1 refers to the first module on a two module parts.

So,  for example IIC1C1_MST and IICC_MST mean the same thing.

 

Here are tested working drivers for the I2C for all flexis parts, V1 and 08.

 

You will have to adjust the headers and such to suit your project.

Also note the included CLI ans STI functions. These save and restore the interrupt level rather than just blindly enable and disable interrupts for mutual exclusion. Since they use  asm, there is one set for V1 and one set for 08.

Happy motoring....

 

 

 

0 项奖励
回复

4,013 次查看
mauricio2346
Contributor II

Thanks Jim. i'll take into account if my code keeps failing jeje.

 

before posting replies like ("you're not listening solutions from  posts", first, i don't want to change everything on my code until i make sure what's wrong, and make little modifications one step at time. then, if i'am wrong, test new options). 

 

i think i've a result.  i'm reading all bytes that slave sends to MCU as i wanted.  i think its a progress, but not at all.  i cannot get the MCU to run directly without step  by step simulation.  i can't really get what's wrong.   the code stops while i'm polling over while RXAK flag.  when a MCU is running trough simulator, bus clock, functions, timers, interrupts, etc. runs at clock speed or speed based on clock, am i wrong?.  i woould like to know why its happening, and what should i do to avoid it.

 

this is reading routine for IIC.

void IIC_read_bytes(byte Command, byte addr){  byte RD_data;  char i;  //Send Command  IIC1C1_TXAK = 0;    IIC1C1 |= 0X30;   IIC1D = Command|I2C_WRITE;  while (!IIC1S_IICIF){}   IIC1S_IICIF=1;   while (IIC1S_RXAK){}           //Send Address  IIC1D = addr;  while (!IIC1S_IICIF){}   IIC1S_IICIF=1;   while (IIC1S_RXAK){}   //Restart;  IIC1C1_RSTA = 1;    //Send Command;  IIC1C1_TXAK = 0;   IIC1D = Command|I2C_READ;  while (!IIC1S_IICIF){}   IIC1S_IICIF=1;   while (IIC1S_RXAK){}   IIC1C1_TX = 0;  Dato[0] = IIC1D;   while (!IIC1S_IICIF){}   IIC1S_IICIF=1;  while (IIC1S_RXAK){}  for(i=0;i<5;i++){     IIC1C1_TXAK = 0;      Dato[i] = IIC1D;   }  IIC1C1_TXAK = 1;    Dato[5] = IIC1D;  IIC1C1_MST = 0;   }

 i appreciate Tom's Help, hope we can make this module work for my application soon...

 

Regards;
 

 

 

 

0 项奖励
回复

4,013 次查看
TomE
Specialist II

Don't poll the ACK. It isn't what you think. It is only valid AFTER a transfer. That's most likely to be the major cause of your problems.

 

Here's what part of my code looks like:

 

    /* Wait for address transfer to complete */// DEBUG(1, "while (!(MCF_I2C_I2SR & MCF_I2C_I2SR_IIF));");    eStatus = I2cWait(I2C_TIMEOUT_US, &MCF_I2C_I2SR, MCF_I2C_I2SR_IIF, TRUE);    /* Did we see the ACK? */    if ((eStatus == I2C_STATUS_OK) && ((MCF_I2C_I2SR & MCF_I2C_I2SR_RXAK) != 0))    {     eStatus = I2C_STATUS_NOACK;    }    MCF_I2C_I2SR &= ~MCF_I2C_I2SR_IIF;  /* Clear the status */

 The "i2cWait()" function simply waits for a bit in the status register to set (to TRUE in this case) or for a timeout.

 

Your code in its current state may not be worth wasting any further time on. You've been given working sources, so why not use them?

 

Tom

 

0 项奖励
回复

4,013 次查看
mauricio2346
Contributor II

Hi TomE.  i just changed the entire code to work within IIC interrupt acknowledge.  but still can't get work... i could read once with debugger, step by step, but, not in run mode.   this code returns a "flag" with 5 states, which 0 equals to "error".  im getting 0 al time. 

 

i don't really what to do with this module, i'm tempted to toogle pins as IIC module do, on forums everybody thinks that this module needs more documentation, has several bugs that Freescale seems to ignore, and, no one can get this work as it should without reseting the module.... is disappointing... :smileyfrustrated:

 

with this new code, i need to charge a Data array to send and recieve data...... i don't like it... 

what do you think???

 

 

 

 

0 项奖励
回复

4,013 次查看
JimDon
Senior Contributor III

I seems to work flawlessly for me.

I would be interested to know of any confirmed "bugs".

 

0 项奖励
回复

4,013 次查看
mauricio2346
Contributor II

Hi JimDon.   this is the correct way to write to slave device with this new library?

 

I2C_DATA[0]=0XF0;
I2C_DATA[1]=0X55;
WriteBytesI2C(0XA6,2);
DelayMs(10);

I2C_DATA[0]=0XFE;
I2C_DATA[1]=0X04;
WriteBytesI2C(0XA6,2);

I2C_DATA[0]=0XFB;
I2C_DATA[1]=0X00;
WriteBytesI2C(0XA4,2);

 

i could read only the first data in debug mode with this code:

 

I2C_DATA[0]=0X00;
WriteBytesI2C(0XA4,1);
DelayMs(1);
ReadBytesI2C (0XA4,6);

 

should i add both macro definitions for master address?

Regards;

0 项奖励
回复

4,014 次查看
JimDon
Senior Contributor III

Something like this:

 

I2CInit();
I2CSetDeviceAddress(MyAddress);
while( ERROR_BUSBUSY == I2CSend(buffer address,#of bytes) )
;
while(I2CGetStatus() == ERROR_BUSBUSY)
;
if(I2CGetLastError() != ERROR_NAK )
{
// ok we have a responing device, now procede
}

 

0 项奖励
回复

4,014 次查看
JimDon
Senior Contributor III

Here is a more complete example:

// Commands for PCS9535/9555#define PCA9535_INPUT_PORT0     0x00#define PCA9535_INPUT_PORT1     0X01#define PCA9535_OUTPUT_PORT0    0x02#define PCA9535_OUTPUT_PORT1    0x03#define PCA9535_INVERT_PORT0    0x04#define PCA9535_INVERT_PPRT1    0x05#define PCA9535_CONFIG_PORT0    0x06#define PCA9535_CONFIG_PORT1    0x07int ReadI2CStatus(){  volatile int counter = 500;  while(I2CGetStatus() && counter--)   asm{nop;};  return counter != 0; }byte config[] = {PCA9535_CONFIG_PORT0,0};byte config1[] = {PCA9535_CONFIG_PORT1,0};byte data[]={PCA9535_OUTPUT_PORT0,0xaa};byte data1[]={PCA9535_OUTPUT_PORT1,0xaa};byte rxcmd[]={PCA9535_INPUT_PORT0};byte rxdata[4];byte toggle=0;int Testpca9535(){  // This assumes a clock rat of 48-50 Mhz.  I2CInit();    // This is for the PCA9535  I2CSetDeviceAddress(0x40);  // Send config port 0 for output.  I2CSend((byte*) &config,2);  // If the device did not ACK, bail.  if(ERROR_NAK == I2CGetLastError())       return -1;   if(!ReadI2CStatus() )    return 0;  // Send config port 1 for output.  I2CSend((byte*) &config1,2);  if(!ReadI2CStatus() )    return 0;  // Set up the data...  if( toggle)    data[1] = data1[1] = 0xaa;  else    data[1] = data1[1] = 0x55;  toggle ^= 1;  // Send the data to port 0  I2CSend((byte*) &data,2);  if(!ReadI2CStatus() )    return 0;  // Send the data to pport 1  I2CSend((byte*) &data1,2);  if(!ReadI2CStatus() )    return 0;  // Read back port 0.  I2CSend((byte*) &rxcmd,1);  if(!ReadI2CStatus() )    return 0;  I2CRecieve(&rxdata[0],1);  if(!ReadI2CStatus() )    return 0;  return 0;}

 

0 项奖励
回复

4,014 次查看
mauricio2346
Contributor II

Hi.  i took a break from my personal project due to work.  now, i think i've a better perspective of this problem (a "colder head" ejejj, don't really know how to say that in english :smileyvery-happy:). look at this code, taken from HCS08QRUGSW:

 

unsigned char WriteBytesI2C (unsigned char slaveAddress,unsigned char numberOfBytes){  unsigned char Temp;  I2C_LENGTH = numberOfBytes;  I2C_COUNTER =0;  I2C_STEP = IIC_HEADER_SENT_STATUS;  I2C_DATA_DIRECTION = 1;  /* Format the Address to fit in the IICA register and place a 0 on the R/W bit.*/  slaveAddress &= 0xFE;  IIC1C_IICEN = 0;  IIC1C_IICEN = 1;  Temp = IIC1S;                 /* Clear any pending interrupt */  IIC1S_IICIF=1;  IIC1C_MST = 0;   IIC1S_SRW=0;  IIC1C_TX = 1;              /* Select Transmit Mode */ IIC1C_MST = 1;            /* Select Master Mode (Send Start Bit) */    DelayUs(1);  IIC1D=slaveAddress;      /* Send selected slave address */  return(1);}

 

slaveAddress &= 0xFE;

 slaveAddress &=0XFE should be slaveAddress=(slaveadress<<1)|I2C_Status, being I2C_Status=0 to write and I2C_Status=1 to read??

actually, slaveAddress &=0XFE puts a 0 on LSB, but, the writting address changes... 

 

i think that should be a problem, because i'm reading status flags in interupt acknoledge, and found that never runs over 3th or 4th state (sending and sent message).

 

what do you think?

 

  

0 项奖励
回复

4,014 次查看
TomE
Specialist II

> "colder head"

 

"Cool head", same in English.

 

There are two ways to represent the Slave Address. It is a seven bit field in an 8 bit register, and is 8 bits on the I2C bus when drawn on paper or on a CRO.

 

So you can either use the 7 bit value in the Data Sheets and in code or you can use the 8 bit value. I'm looking at an Atmel AT24C32 Data Sheet, and it represents the address on the bus as:

 

------------------------------------------|  1 |  0 |  1 |   0 | A2 | A1 | A0 | rw |------------------------------------------

So it's your choice (as a programmer) whether to call that "0xA0 - 0xAE" or "0x70 - 0x77".

 

If you've chosen the "more correct" 7 bit value, then at some point in your code you have to convert from the 7-bit address to the 8-bit register value. If you really want to make the code hard to follow you have different parts of the code using different representations, or you hide the conversion in a macro somewhere.

 

Of course if you're starting with someone else's code you have to unpick what they did.

 

There are ways to make this clear, by using good comments and sensible naming conventions. You could even declare typedefs for the 7-bit and 8-bit representations and have explicit conversion functions, but that would be way too professional for low level driver code like this Smiley Happy.

 

I don't think I've ever seen "professional looking" I2C code. It is usually "hacked into shape" and left alone when it first seems to work, leaving confusion in its wake for the next programmer to work on it.

 

Welcome to the club Smiley Happy

 

> slaveAddress &=0XFE should be slaveAddress=(slaveadress<<1)|I2C_Status

 

You're assuming it is passed in in 7 bit form. You're then converting a 7-bit-represented address into an 8-bit-represented address in the same variable witout a warning stating "must be 7 bits above here and is 8 bits below here".

 

The definition of that function should contain proper header comments detailing EXACTLY what each argument is.

 

I'd guess in not only doesn't detail this, but it doesn't have any description of the interface at all.

 

It is likely the shift is being done in the calling function, or (more likely) the original definition (or magic hex number) used to call that function was already shifted into "8 bit format".

 

Tom

 

0 项奖励
回复

4,014 次查看
mauricio2346
Contributor II

Hi Tom.

 

i've some progress.  changing data shifting routine i could get the sensor to response to commands from MCU.  at this point, the sensor reponses with ACK to every valid address and command.

i'm getting problems with reading routine from interrupt.   

based on  HCS08QRUG IIC routine and datasheet from here:

 

http://www.freescale.com/files/microcontrollers/doc/user_guide/HCS08QRUG.pdf

page 57: 

 

If the master is reading data from the slave, verify whether we are about to read the last byte to change the
TXAK bit to 1 and avoid acknowledging the next byte read to indicate the slave we are done reading data.
else{
if((I2C_COUNTER+1) == I2C_LENGTH)
IICC_TXAK = 1; /* to indicate end of transfer */
Read the next byte.
I2C_DATA[I2C_COUNTER] = IIC1D; /* Read the next byte */
I2C_COUNTER++;
If we have finished reading data set the global variable I2C_STEP value to DATA_SENT_STATUS.
if(I2C_LENGTH <= I2C_COUNTER){
I2C_STEP=IIC_DATA_SENT_STATUS;
}
Wait until next byte is read.
return;
}
}
After we have finished with the data transmission or reception and the last byte has been sent/received, the
device should generate the stop signal on the bus and set the global variable I2C_STEP value to
READY_STATUS
if(I2C_STEP==IIC_DATA_SENT_STATUS){
I2C_STEP=IIC_READY_STATUS;
IICS;
IICS_IICIF=1;
IICC_TX=0;
IICS_SRW=0;
IICC_MST=0;
return;
}
}
If the device is acting as the slave device on the IIC bus
else{ /* SLAVE OPERATION */

 

in my case, the MCU recieves 6 calls for interruption (as suposed to be, the slave sends 6 byte-data when requested).

BUT, after sending the last byte, MCU sends no ACK (thats normal).  MCU recieves last byte and set I2C_STEP to IIC_DATA_SENT_STATUS.  it should going to last step (create a stop condition), but, something happens, MST changes to zero (dont really why).  then jumps to SLAVE routines and out from interrupt.  

never creates a stop condition....

do you know why???

 

Thanks;

 

0 项奖励
回复

4,014 次查看
mauricio2346
Contributor II

ok Jim, ill give it a try.

i've another question.  SCL clock frecuency equation is: Bus (Clock/2*Mult*ICR), or (Clock/Mult*ICR)??   

im still thinking about the problem of continous running, and why works fine in debugger mode.

 

the bus clock is set properly to 24Mhz, USB; SCI, SPI communications works fine with this clock and every baud rate.

 

to discard the slave , i will try another device, such as SHT11 humidity sensor or tone generator.  this problem is "freaking me out" (thought it was a 4 hour work). jejeje

 

Regards; 

0 项奖励
回复