LPC4088, WM8731, Embedded Artists Demo Board - Page 1
Forum section: electronics / general

author: ralphrmartin
author_rank: Frequent Contributor
timestamp: December 29, 2018, 05:11:23 pm
content: I'm trying to reproduce the I2S Audio part of the Production Test Program for the Embedded Artists LPC4088 Experiment Base Board (which I dont have) using just the Embedded Artists LPC4088 module and a standalone WM8731 module, without much success.The Production Test Program makes the LPC4088 the I2S slave and the WM8731 master, but I'm having no success doing so. While the crystal on my WM8731 module is oscillating at the right frequency, its output looks more like a sinewave than a squarewave, with an amplitude of only 1V, which I am guessing is why the WM8731 is not outputting other clocks (VCC is 3.3V). Does that sound like a reasonable assumption? (I note the place I bought this module from has rather dodgily crossed out the bit where it says the module can act as master and slave...)On the other hand, if I try to make the LPC4088 the I2S master, on the Experiment Base Board, MCLK is provided by pin LPC4088 P2.27, to which there is no easy access. I thus want to change this pin, but for the life of me I cannot see how the source code is setting this pin up to get the MCLK signal. Can anyone tell me how this is done in the source below, please?https://os.mbed.com/users/embeddedartists/code/lpc4088_ebb_ptp/Thanks!

author: ralphrmartin
author_rank: Frequent Contributor
timestamp: December 29, 2018, 06:36:00 pm
content: OK, well, I2S output is now working for LPC4088 as I2S slave and WM8731 as master - it seems to have been a duff connection somewhere.I'd still be interested in any answers to the second query, though.

author: bson
author_rank: Unknown
timestamp: December 30, 2018, 04:05:30 am
content: Not familiar with the LPC4088, but on the LPC4078 there's a pin configuration (search for IOCON in the family guide) that makes P1.25 CLKOUT. You probably need to find the pin conf code that initializes the pins. When I do it I initialize the pin configuration from a table that is constructed with macros, but I don't know how Embedded Artists do it.My pin/iocon init code ends up looking something like this:Code:enum { PIN_END = 0x1000 };// Install a pin conf tablestatic void PinConf(volatile uint32_t* iocon, const uint32_t* table) {while (*table != PIN_END) {iocon[table] = table;table += 2;}}void ConfigurePins() {// Default all GPIO ports to all input, masked_gpio0.MakeInputs(~0);_gpio1.MakeInputs(~0);_gpio2.MakeInputs(~0);_gpio4.MakeInputs(~0);_gpio0.Mask(~0);_gpio1.Mask(~0);_gpio2.Mask(~0);_gpio4.Mask(~0);//////// Pin plan ////////...// P1.0 - ENET_TXD0// P1.1 - ENET_TXD1// P1.4 - ENET_TX_EN// P1.8 - ENET_CRS_DV// P1.9 - ENET_RXD0// P1.10 - ENET_RXD1// P1.14 - ENET_RX_ER// P1.15 - ENET_REF_CLK// P1.18 - USB_UP_LED1 (XXX this is only used in host mode? If// so, make it GPIO for LED)// P1.19 - GPIO (LED D6) Out// P1.20 - SSP0_SCK// P1.22 - GPIO (LED D8) Out// P1.23 - SSP0_MISO// P1.24 - SSP0_MOSI#ifdef CLKOUTPIN// P1.25 - CLKOUT#else// P1.25 - GPIO In (unused with CP2102N)// P1.25 - GPIO Out (/TEN with CH341T)#endif// P1.26 - GPIO (LED D9 SD card activity) Out// P1.28 - GPIO (Touch controller SPI CS#)// P1.29 - GPIO Out SD Card CS#// P1.30 - USB_VBUS// P1.31 - ADC0_IN5 J8.3static const uint32_t p1[] = {0, D_IOCON_FUNC(1),1, D_IOCON_FUNC(1),4, D_IOCON_FUNC(1),8, D_IOCON_FUNC(1),9, D_IOCON_FUNC(1),10, D_IOCON_FUNC(1),14, W_IOCON_FUNC(1),15, D_IOCON_FUNC(1),18, D_IOCON_FUNC(1),19, D_IOCON_GPIO(IOCON_MODE_NONE, 0, 0, 1, 0),20, D_IOCON_FUNC(5),22, D_IOCON_GPIO(IOCON_MODE_NONE, 0, 0, 1, 0),23, D_IOCON_FUNC(5),24, D_IOCON_FUNC(5),#ifdef CLKOUTPIN25, D_IOCON_FUNC(5), // CLKOUT#else25, D_IOCON_GPIO(IOCON_MODE_NONE, 0, 0, 1, 0),#endif26, D_IOCON_GPIO(IOCON_MODE_NONE, 0, 0, 1, 0),28, D_IOCON_GPIO(IOCON_MODE_NONE, 0, 0, 1, 0),29, D_IOCON_GPIO(IOCON_MODE_PULLUP, 0, 0, 1, 0),30, A_IOCON_FUNC(2),31, A_IOCON_ADC(3),PIN_END, PIN_END};PinConf(IOCON_P1, p1);...}

author: ralphrmartin
author_rank: Frequent Contributor
timestamp: December 30, 2018, 05:39:25 pm
content: Thanks for that tip. But nowhere in the source can I find a reference to pin P2.27, directly or directly, with or without IOCON.Maybe I2S Master Mode was never fully implemented, even though some of the software is written for master mode. In the I2S header file, there's avoid mclk_enable(bool mclk_en);but no definition of this function elsewhere, and nothing calls it.