Parallel to serial output

Discussion in 'Embedded Systems and Microcontrollers' started by sanwa, Mar 4, 2009.

  1. sanwa

    Thread Starter Active Member

    Jan 18, 2009
    36
    0
    Hi everyone, I am guessing am i able to to have the currently data buses that is used to displayed the characters on the LCD to send as serial data to my other module? 4 bits data are used to display the characters, then i am thinking to use this 4 data buses connected to a parallel to serial shift register so that I can have both data displayed at the LCD and serial data to my module. I am using 16F88 ... I am scaring the problem of synchronization between the two. :eek:
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    The uC has two serial interfaces built in - why not use one of those? The data sheet has all the information you need to send/receive data - assuming your "module" has similar capabilities.
     
  3. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    If you are using the internal oscillator of the PIC you can configure it to output a clock signal on one of its crystal oscillator pins. This clock signal will be synchronized with the PIC clock and you can clock other devices.
     
  4. sanwa

    Thread Starter Active Member

    Jan 18, 2009
    36
    0
    Well I know it, just that RB1, RB2 for SPI mode already used in DB to the LCD while RB4 and RB5 for AUSART also used for E and RS LCD respectively.
     
  5. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Is the question that you want to be able to use the pins that currently "talk to" the LCD for other purposes while not updating the display?
     
  6. sanwa

    Thread Starter Active Member

    Jan 18, 2009
    36
    0
    Beside it can display using LCD, it can also has serial output to my module.
     
  7. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Is this a circuit/program that is already built, or can the pins be reassigned?

    Keep the LCD Enable and serial clock (SPI you said?) as seperate pins, use serial module data on an LCD data line.

    When LCD isn't enabled, signals while talking to the serial module will be ignored. When the serial module doesn't have a clock and the LCD is Enabled, signals going to the LCD will be ignored by the serial module, but displayed on the LCD.

    Or am I missing something?
     
  8. sanwa

    Thread Starter Active Member

    Jan 18, 2009
    36
    0
    Yup, I'd built this circuit.
    Erm.. sorry for my poor english, might not getting what u mentioned.
    So u mean have 2 connections from RB4. When it is connected to the LCD, it enables it.
    So when it is connected to the serial module, it will SPI to the module?
     
  9. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    The serial module should ignore any voltage changes on it's input pin unless they come with a clock signal. I use "should" as I don't know anything about it.

    The LCD ignores any changes on it's input pins if the Enable signal isn't present.

    The serial module and LCD would see the all the signals on that bus. Only the enabled device will act on what signals are seen on the bus/wire/line.

    All of the actual switching is done in code, by only using one device at a time, with the correct lines/pins.
     
  10. sanwa

    Thread Starter Active Member

    Jan 18, 2009
    36
    0
    I am glad to have your reply. Well, how about if i am using shift register then?
    convert the parallel IO to serial using IC like  SN74HC165N?
     
  11. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
  12. sanwa

    Thread Starter Active Member

    Jan 18, 2009
    36
    0
    Code ( (Unknown Language)):
    1. Parallel-in access to each stage is provided by eight individual direct data (A−H) inputs that are enabled by a low level at the shift/load (SH/LD) input.
    I tot there must be a LOW in order to load the parallel input? Without clock input, shifting is impossible right? ;)
     
  13. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Those two pins will only be high when writing to the LCD. Once the LCD write is finished, you can enable the shift register to listen by dropping the Enable on LCD, then setting up the Clock and load pins as you normally would. As long as the LCD enable is low, you can send data to/from the shift register as if the LCD Display wasn't present (since it is not enabled).

    Check google for articles on parallel bus multiplexing if the concept doesn't make sense, some other articles may describe the process better than I am. Or Wikipedia's entry on data bus.
     
Loading...