SPI CS PROBLEM

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all , i got a color lcd display (PCF8833 , that display from Sparkfun) , i can fully controle the lcd , display frames... the problem is that the LCD can run without pulling the /CS pin to low , as if the CS (chip select) signal is not connected to the lcd controller or its pulled low directly.
So i cant put multiple devices on the spi line , cuz without CS signal i cant select/unselect devices (slaves) , (am using atmega32/UC3B(AVR32) as uC).
I was wondering if i use a AND gate with two input one of them is inverted and connected to the uC chip select control , the other input is connected to the uC clock, ans the gate output is connected to the LCD clock , so i can control a "chip select" by controlling the clock line in the LCD
(clock to lcdenabled = /CS (AND gate input inverted) = 0 )

(clock to lcd disabled= /CS (AND gate input inverted) = 1 )

but i didnt fin a high speed and gate that works "bridges" a clock speed of 40MHZ (cuz i am testing that on a UC3B avr32 uC) .
is that any solutions , suggestions to put a ChipSelect signal to an SPI device that doesn have the /CS line.....
Thanxxx

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What are you using for /CS? Does it actually go to the LCD? ie have you measured it?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
but i didn't fin a high speed and gate that works "bridges" a clock speed of 40MHZ

Any typical 74LS should pass that. I've made a counter with TTLs at 80MHz and it works nicely. The problem should be elsewhere. Line capacitance maybe?

KISS - Keep It Simple Stupid!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

??? i m just asking how to add a CS signal to SOI slave device that diesnt have a CS signal , gor the cs i m just manipulating an output (high/low) thats is, help plz

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Calm ahmed, my idea is gating each I/O signal. MOSI, MISO, SCK, so you had to use 3 gates.
Put the output of Gate A to SI of LCD,
input A of Gate A to MOSI of AVR.
output of Gate B to SCK of LCD,
input A of Gate B to SCK of AVR,
output of Gate C to MISO of AVR,
input A of gate C to output SO of LCD.
Then tie input B of all gates to AVR's slave select.
Simple isn't it?

KISS - Keep It Simple Stupid!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

m23402027 , yeah that the problem cuz in 74LS (AND ans NOT gate) it indicates that it can run up to 90MHZ or maybe higher. but i visualized the clock signal in oscilloscope, and because its too fast , i can see some RC constants in falling and rising edges... between msb n lsb the clock signal doesn hall to 0 exactly ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okkkk, so u mean that my problem was the delay produced between clock and mosi (due to a single gate that i use in clock)(i dont use miso , theres no data from lcd to uC)

Okiiiii thankss i ll try thissss ;)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
i m just asking how to add a CS signal to SOI slave device that diesnt have a CS signal
That's NOT what you asked above. You said that the /CS pin somehow was not working as it should.
Quote:
the problem is that the LCD can run without pulling the /CS pin to low , as if the CS (chip select) signal is not connected to the lcd controller or its pulled low directly.
So DOES the LCD have a /CS pin or not?

Remember that the /CS pin is NOT just to select the chip, it also resets the chip to normal operation if some noise messes up the clock pulses.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the lcd has a CS and a RESET separately, but the CS on the LCD is not working , i can see no changes if i pull it high or low , , in each situations the LCD works , as if it was always selected.

I tries the AND gates on MISO an MOSI , ans it works!!! with CS not inverted, but when i tried to invert CS to make it /CS , by adding a NOT gate (74LS02) it doesnt work , i think thats due to TTL level cuz the LCD works with 3.3V on clock and data . If i put gates on 5V , and divide outputs (5v) by resistors to make it 3.3 level will it work . an i keep inputs of gates at 5V level , cuz the uC output 3.3v it will pass over TTL level, this problem is when i add the not gate , it seem like it doesnt accept to be powered by 3.3V instead of 5V