PDA

View Full Version : Can such interface be handled with SHIFTOUT? (Macroblock MBI5026 LED driver)



CuriousOne
- 6th April 2023, 06:04
Hello.
I got some MBI5026, with LEDs connected to it's output. I want to turn them on via PBP.
According to datasheet, the following timing diagram should be used. I tried to use it with the code below,but it does not works. I have OE connected to GND, so this should not be an issue?



SDI VAR PORTC.4
CLK VAR PORTC.5
LE VAR PORTC.6
CONT VAR WORD
FOR CONT=0 TO 65535
LCDOUT $FE,$C0,"VAL=", DEC CONT
SHIFTOUT SDI,CLK, 0, [CONT]
HIGH LE
PAUSE 1
LOW LE
PAUSE 10
NEXT


9351

HenrikOlsson
- 6th April 2023, 08:29
From the SHIFTOUT section in the manual:

SHIFTOUT DataPin, ClockPin, Mode, [Var{\Bits}...]
...
...
\Bits optionally specifies the number of bits to be shifted out. If it is not specified, 8
bits are shifted out, independent of the variable type.

Ioannis
- 6th April 2023, 08:33
I guess you have to make a word variable and send out the bits you need (if more than a byte).

Ioannis

CuriousOne
- 6th April 2023, 19:56
variable is already WORD.
I tried to add \16 to shiftout, but still nothing...

tumbleweed
- 7th April 2023, 11:43
What value of REXT do you have?
Just to be sure... it's a sink driver so you do have the LEDs connect the right way around - anode to +V, cathode to 5026 output pin), right?

CuriousOne
- 8th April 2023, 13:27
Rext is 2.2K
LEDs are connected in a proper way - I tried to ground the LED pin going into the chip via 220 ohm resistor - it came on.
So I guess, maybe I need to change state of the OE pin too? Currently I have it grounded.

tumbleweed
- 8th April 2023, 16:34
That all looks right according to the datasheet... OE is low-active so grounding it should be ok.

HenrikOlsson
- 8th April 2023, 16:54
So, back to basics then.
Make sure you don't have anlog functions enabled on the pins you're trying to use. Verify that you can control the state of each indivivual pin that you're using.
After that (or before if you'd rather) it's time to hook up the scope or logic analyzer to verify that what you get is what you want.

CuriousOne
- 8th April 2023, 17:42
yes, checked all that :)
tried to pull CLK, SDI, LE pins high/low - all work fine. Checked all wirings and contacts - everything is fine.
A little note - voltage on all output pins is about +3V regarding to GND, and does not change whatever command I send.

CuriousOne
- 9th April 2023, 19:23
Tried to play with OE pin - no change, it does not care whenever pull it high or low...