Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: Thomas on November 21, 2012, 09:31:04 PM

Title: UEXT connector & bank/pin numbers
Post by: Thomas on November 21, 2012, 09:31:04 PM
Hi,
I'm trying to understand how to guess bank/pin numbers of the UEXT connector (olinuxino-maxi).

Here is the MAXI UEXT connector details from the User Manual :
(http://thomasdutreuilh.free.fr/dev/uext_maxi.png)

Here a part of the C code using this connector for MOD-LCD3310 :

//MOSI -> bank[0], pin[20]
//MISO -> bank[0], pin[0]
//SCK -> bank[0], pin[24]
//cs - bank[0], pin[3]
//res - bank[1], pin[23]
//dc  - bank[1], ping[24]

#define LCD_CS_MAKE_OUT() gpio_output(0, 3)
#define LCD_CS_HIGH()  GPIO_WRITE(0, 3, 1)
#define LCD_CS_LOW()  GPIO_WRITE(0, 3, 0)

#define LCD_RES_MAKE_OUT() gpio_output(0, 23);
#define LCD_RES_HIGH() GPIO_WRITE(0, 23, 1);
#define LCD_RES_LOW() GPIO_WRITE(0, 23, 0);

#define LCD_DC_MAKE_OUT() gpio_output(0, 25);
#define LCD_DC_HIGH() GPIO_WRITE(0, 25, 1);
#define LCD_DC_LOW() GPIO_WRITE(0, 25, 0);


How do you guess for example SCK is bank0/pin24 ?
The same for MOSI : on the picture it's number 21, and the C comment indicates bank0/pin20.

Thank you for helping me :)

Thomas.
Title: Re: UEXT connector & bank/pin numbers
Post by: Thomas on November 22, 2012, 09:39:43 PM
Hey ! You ! Looking at this line ! I'm sure you can help me ! :)

Thomas.
Title: Re: UEXT connector & bank/pin numbers
Post by: Fadil Berisha on November 22, 2012, 11:11:14 PM
Quote from: Thomas on November 22, 2012, 09:39:43 PM
Hey ! You ! Looking at this line ! I'm sure you can help me ! :)

Thomas.
Hi Thomas,
This question is answered in this forum. Point in search window and write > bank pin <


Fadil Berisha
Title: Re: UEXT connector & bank/pin numbers
Post by: Thomas on November 23, 2012, 01:58:39 PM
Thank you for your reply.

Indeed I found it already, and tried to apply it on A13 without success.
I'm trying to switch on the LED on A13 with the following C code :


#include "gpio-mmap.h"

int main() {
gpio_map();
gpio_output(0,10); //bank0, pin10
GPIO_WRITE_PIN(10,1);


We can see in A13 manual that LED1=GPIO Pin#10. (so it's bank0,pin10 I suppose ?)
I am using this gpio-mmap.h file : https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/iMX233/gpio-mmap.h
Looking at its code, I do not see anything iMX233-specific so I use it for A13.

What am I doing wrong ?

Thank you.
Thomas.

PS :
Shell command to switch on the LED :
echo 1 > /sys/devices/virtual/misc/sun4i-gpio/pin/pg9

A13 GPIO User Manual :
(http://thomasdutreuilh.free.fr/dev/a13_gpio.png)