2013-10-01

CooCox SPI1 problem - Jean-Pierre

Bug found in LPC111x library: Non-working SPI1 peripheral (includes solution) -    Jean-Pierre

http://www.coocox.org/forum/topic.php?id=645

2 years ago

Hi CooCox!

I found a bug in your latest LPC111x library.  SPI1 was unworkable, and after much testing I was able to find your IOCON definition for MOSI1 was different than the NXP datasheet.

Fixing your lpc11xx_iocon.h to the code belows makes SPI1 functional.

//***MOD: Bug found that makes SPI1 peripheral unworkable.  The values here should match 
table 89 (section 7.4.34) of NXP LPC111x user manual (page 83)

#define PIO2_3_FUN_PIO           0     /** Selects function PIO */
#define PIO2_3_FUN_RI            1
#define PIO2_3_FUN_PIO_MOSI1     2  // (Should be named PIO2_3_FUN_MOSI1 instead)

// Old (incorrect) values below
//#define PIO2_3_FUN_PIO_MOSI1   0     /** Selects function PIO */
//#define PIO2_3_FUN_RI          1

(Please look at other definitions in ioconf.h to make sure they match.  Possibly other chips in the family could be affected as well)

Congrats on the great work!

Jean-Pierre

Sandy 2 years ago

Hi, JPPoulin:

Thanks for your feedback, we will modify the component as you said. If you find any problems in the CooCox Components, you can tell me, and we will modify them.

Thanks for your support!

.END

No comments:

Post a Comment