BusInOut Problem

14 Jun 2012

Hello,

I wrote this topic another section. But maybe this is a bug. I wanted to write here again.

I have a problem with BusInOut. My codes are as below.

I have two buses ( 5 bit. cRowBus and cColBus). I made them opendrain output. p29 didn't work, when I tried the first code. (I measure 111101 on cColBus pins, when I write to bus as cColBus.write(63); (111111). p29 was always zero.) I tryed this two codes on two mbed. Both of them were same. After, I tried the second code. (I just canceled cRowBus). It works fine. Can you try these codes on own mbed 1768? What could be the reason for this?

Thanks,

Selim.

1. code: 

#include "mbed.h"

BusInOut cRowBus(p5, p8, p10, p6, p9, p7);      
BusInOut cColBus(p25, p26, p27, p28, p29, p30); 
unsigned char x;
main(){
    cColBus.mode(OpenDrain);
    cColBus.output();
    cRowBus.mode(OpenDrain);
    cRowBus.output();
    while(1) {
        cColBus.write(63);
        wait_ms(500);
        cColBus.write(0);
        wait_ms(500);
    }
}


2. code :

#include "mbed.h"

//BusInOut cRowBus(p5, p8, p10, p6, p9, p7);      
BusInOut cColBus(p25, p26, p27, p28, p29, p30); 
unsigned char x;
main(){
    cColBus.mode(OpenDrain);
    cColBus.output();
  //  cRowBus.mode(OpenDrain);
  // cRowBus.output();
    while(1) {
        cColBus.write(63);
        wait_ms(500);
        cColBus.write(0);
        wait_ms(500);
    }
}
14 Jun 2012

The problem is that you set the pins as OpenDrain, so you can't be sure of your measurements,
unless you have some kind of pull-up on the output?

Lerche

14 Jun 2012

Hi Lerche

There are pull-up resistors on these two buses. The problem is occured when i define two buses. If I use just one bus, there isn't problem. P29 works well.

Selim.

Christian Lerche wrote:

The problem is that you set the pins as OpenDrain, so you can't be sure of your measurements,
unless you have some kind of pull-up on the output?

Lerche

26 Jun 2012

Uh, funny troubles.
I'll try to reproduce within a day or two.

Lerche

27 Jun 2012

Hi,

Yes, it was very funny trouble. :) My pcb and code had problem at same pin. I solved it finally.

Thanks for your interest.

Selim.

Christian Lerche wrote:

Uh, funny troubles.
I'll try to reproduce within a day or two.

Lerche