Bit banging SPI and Clock Freq

Discussion in 'Embedded Systems and Microcontrollers' started by blue_flare, Apr 17, 2008.

  1. blue_flare

    Thread Starter New Member

    Feb 6, 2008
    8
    0
    Hi All,
    Will there be a problem, If I am to interface my 8051 controller running at 24MHz Osc freq with another SPI device of speed 26MHz. How do I make this thing synchronous/work. I understand that the instruction cycle of a 8051 takes 12 clock cycles. So, I may be able to generate the SCK signal at the max of 1 MHz (Pls correct me If I am wrong). But for the other SPI device, the speed mentioned is 26MHz. How do I resolve this? the max clock freq I can provide to the 8051 as per the datasheet is 24MHz and it does not have SPI hardware support.

    Your help is greatly appreciated.
    Rgds,
    Ather
     
  2. Caveman

    Active Member

    Apr 15, 2008
    471
    0
    If the 8051 is the master, you can bit bang the SPI as slow as you want. This is because it controls the clock. The 26MHz is likely the maximum speed on the SPI, although I will say that that is really high. What is this other device?
     
  3. blue_flare

    Thread Starter New Member

    Feb 6, 2008
    8
    0
    Its MAX6954 LED driver chip
     
  4. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    I have several projects using an 8051 and the MAX6954. I chose 2.25 MHz. as the clock frequency. The system woorks like a champ and has been ultrareliable. I think Maxim's datasheet for the part is one of the best written out there. This is an awesome part.
     
  5. blue_flare

    Thread Starter New Member

    Feb 6, 2008
    8
    0
    Hey papabravo and caveman, thanks for the answer, that really helped.

    Im here again with a query.
    My bit-banging stuff works just fine. But it seems that, sometimes, the command is not received properly by the SPI slave device. I have powered both the controller as well as the MAX6954 with a +5V supply.

    The logic levels for these two devices are:
    8051: VIL=0.9(max), VIH=1.9(min), VOL=0.45(max), VOH=2.4(min)
    6954: VOL=0.2(max), VOH=4.8(min), VIL=0.6(max), VIH=1.8(min)

    I dont see any reason as to why it should have problems. I have ensured that the setup and hold times are way above their threshold. Currently Im getting a 1MHz transfer rate.
    Can somebody here give me some pointer/lead for resolving this issue.
    Rgds,
    Ather
     
  6. Caveman

    Active Member

    Apr 15, 2008
    471
    0
    I generally would put it on a scope and check all of the lines to make sure it is doing what I expect by comparing to the datasheet.
     
  7. blue_flare

    Thread Starter New Member

    Feb 6, 2008
    8
    0
    It is pretty difficult to do so as it happens very sporadically.. It stays fine as long as Im watching :)
    Are there any protection that we have to provide for the MAX6954. I have made the connections just the way it was mentioned in the datasheet
     
  8. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    I would take a look at the power disipation. I was not happy running the part at 5 Volts and dropped it to 3.6 so as to lower the power requirements. Is the chip warm to the touch? Would you want to put your lips on it? If the answer is no then try running the segments at a lower duty cycle or changing the Iset components for a lower maximum current.
     
Loading...