Announcement

Collapse
No announcement yet.

AUDENB , SPI_Init

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • AUDENB , SPI_Init

    Hello,
    I have two questions regarding functionality of some features in Diablo chip.

    1. In datasheet is mentioned an AUDIO ENABLE (AUDENB) output pin. I've found no reference in related docs, about how to operate this pin (just set Low/High).
    2. SPI interface could be initiated in several modes, including 16bits modes. It is possible to send/receive words instead of bytes if SPI is initiated in one of these 16bits modes. Second, in documentation I didn't find specified if SPI transmitted/received bits order is done with MSB first or LSB first, or if it is a possibility to choose between these two.

    Thanks!

  • #2
    Update:
    Regarding second part of the second question, I used an oscilloscope and find out that MSB is sent first, which is pretty much common. The other questions still remains.

    Cheers,
    Chris

    Comment


    • #3
      Dear Chris,

      The Audio Enable (AUDENB) is an output Pin which is used to enable and disable an external amplifier. The pin is automatically asserted when there is
      a command that requires outputting a sound from the diablo chip. When High -->Enable Amplifier.

      For the SPI interface, you can use spi1_ReadBlock("buf", "bufsize") to read more than one byte. See page 236 to 237 of the Diablo Internal functions manual:

      --> http://www.4dsystems.com.au/productp...ons_R_1_16.pdf

      Best regards,

      Comment


      • #4
        Hi Noel,

        I've been playing around with this new information, and figured out how it works. For the Audio Enable pin I was expecting to have an instruction like this (accepted by IDE) : pin_HI(AUDIO_ENABLE) / pin_LO(AUDIO_ENABLE) or pin_Val(AUDIO_ENABLE,0) / pin_Val(AUDIO_ENABLE,1) working. Actually the pin is asserted to audio functions and it's fully controlled by these functions (as far as I can tell). Also, at module initialization (uLCD 43DTC) this pin is set HI and once one of these function is used properly, the Audio Enable pin is set LO after each execution.
        Regarding the SPI interface, I understand the usage of Read/Write Block functions, where the SPI should be initialized in 8bit mode. What i didn't catch is the purpose of SPI 16bit initialization, like this: SPI1_Init(SPI_SPEED1, SPI16_MODE_1).

        Comment


        • #5
          Hi Noel,

          I've been playing around with this new information, and figured out how it works. For the Audio Enable pin I was expecting to have an instruction like this (accepted by IDE) : pin_HI(AUDIO_ENABLE) / pin_LO(AUDIO_ENABLE) or pin_Val(AUDIO_ENABLE,0) / pin_Val(AUDIO_ENABLE,1) working. Actually the pin is asserted to audio functions and it's fully controlled by these functions (as far as I can tell). Also, at module initialization (uLCD 43DTC) this pin is set HI and once one of these function is used properly, the Audio Enable pin is set LO after each execution.
          Regarding the SPI interface, I've understand the usage of Read/Write Block functions, where the SPI should be initialized in 8bit mode. What i didn't catch is the purpose of SPI 16bit initialization, like this: SPI1_Init(SPI_SPEED1, SPI16_MODE_1). An example will be much appreciated.

          Thank you for support!
          Chris

          Comment


          • #6
            Dear Chris,

            The Read/Write Block functions read and write a number of bytes which is 8 bits so it must be initialized in 8 bit mode. When the SPI port is initialized in 16 bit mode, the read
            and write functions SPI1_Write and SPI1_Read are 16 bit.

            You can use this code:

            SPI1_Init(SPI_SPEED0,SPI16_MODE_0);
            SPI1_SCK_pin(PA1); //clock
            SPI1_SDO_pin(PA3); //Serial out pin

            pin_Set(PIN_OUT,PA4); //Chip Select

            repeat

            pin_LO(PA4);
            SPI1_Write(0x0017);
            pin_HI(PA4);

            pin_LO(PA4);
            SPI1_Write(0x0007);
            pin_HI(PA4);



            forever

            Please see attached screen capture from a logic analyzer

            Best regards
            Attached Files

            Comment


            • #7
              Thank you very much Noel!

              Now it's clear.

              P.S. sorry for this long time replay.
              Kind regards!

              Comment

              Working...
              X