LPC43xx Only able to get 1 SGPIO output working

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

LPC43xx Only able to get 1 SGPIO output working

跳至解决方案
982 次查看
scientistjonath
Contributor I

I am using an LPC4367JET100 on an LPCXpresso4367 to output data using SGPIO.  Excluding the rest of my project so that I can solely test the SGPIO, I made a simple program that outputs a 32 bit word of alternating bits (0xAAAAAAAA) continuously over SGPIO in order to allow me to test my outputs using a multi-meter.  Since this signal should be equivalent to an average of half the VCC, it should be 1.65v at the pins. 

In the code attached below, SGPIO slice B is outputting to SGPIO pin 8 which corresponds to the P1_12 physical pin.  On this pin, I get the 1.65v output and I can change it too by using different register values, proving that it works.  The problem is the 5 other pins that I need to function do not seem to output this 1.65v (0xAAAAAAAA).  The documentation for SGPIO is very confusing but I believe this is how the pins are muxed internally for 1 bit mode: 

SGPIO slice B  ->  SGPIO pin 8  ->  physical pin P1_12 (SCU function 6 this one works but none of the others seem to)

SGPIO slice L  ->  SGPIO pin 7  ->  physical pin P2_6  (SCU function 0)

SGPIO slice M  ->  SGPIO pin 9  ->  physical pin P1_13  (SCU function 6)

SGPIO slice N  ->  SGPIO pin 11  ->  physical pin P1_4  (SCU function 2)

SGPIO slice O  ->  SGPIO pin 13  ->  physical pin P2_4  (SCU function 0)

SGPIO slice F  ->  SGPIO pin 6  ->  physical pin P2_2  (SCU function 0)

Please correct me if I am wrong on understanding how the SGPIO slices mux internally.  P1_13 is a specific one which did not work where I tried switching the SCU pin function to every possible value and on none did I get any 1.65v output.  I also decided to check all the pins available to me on the board in case I was checking the wrong pins but no other pins had this 1.65v /were controllable via SGPIO slice.

Thank you for looking into this.

标签 (2)
标记 (1)
0 项奖励
1 解答
784 次查看
starblue
Contributor III

The way you use GPIO_OENREG is wrong. You need to set the bits for all outputs simultaneously. The way you do it one after another, previously set bits become cleared again and the outputs become disabled.

The last one is line 251:

LPC_SGPIO->GPIO_OENREG = (1 << 8); //enable pin 8‍

After that only bit 8 is set, so only output 8 works.

在原帖中查看解决方案

2 回复数
785 次查看
starblue
Contributor III

The way you use GPIO_OENREG is wrong. You need to set the bits for all outputs simultaneously. The way you do it one after another, previously set bits become cleared again and the outputs become disabled.

The last one is line 251:

LPC_SGPIO->GPIO_OENREG = (1 << 8); //enable pin 8‍

After that only bit 8 is set, so only output 8 works.

784 次查看
scientistjonath
Contributor I

Thank you very much!  I knew I was missing something simple.

0 项奖励