Post Go back to editing

Changing data in read/write interface is not reflected in WB/WP pins 

Hello, if I move my encoder knob connected to up/dw counter provided with read/write interface, the WB and WP pins don't reflect any signal. So I think that nothing is witten in the eeprom.

Using my standalone board (same schematic as FREEDSP board). As pin WP can be moved by the 1701, I thought it should write the data by any change in interface rd/wr . There's something to do for activating this function?

Sigmastudio 3.16

adau1701

My project enclosed 

Thanks in advance

Charlie.

DSP_1701.rar
  • Hello Charlie,

    I looked at your project and I did not see where you were trying to "see" the signal. So it seems that you are looking for activity on the I2C/SPI port when you change the encoder. It does not work that way. If the value was constantly updating then you would reach the million or so write limit of EEPROMs in a matter of weeks of operation. The value is only written when the writeback is triggered and that is when power is going down. There must be enough reserve power in charged caps to allow the writeback to complete.

    There are other issues I would like to address.

    If you are looking at the value out of the up/down counters using a Readback cell, you will not see anything until it goes over 16. This is because in the 1701 the readback is only 24 bits and it is the upper 24 bits of the internal 28 bit number. So the bottom four bits are truncated in the readback, not in the DSP. so how to counter that is to multiply the number going to the readback cell by 16. Then you will see the bottom four bits. You will see this done in my example project.

    Next thing I would like to explain is how the interface read and write cells operate.

    The interface read is always reading the contents of the selected interface register.

    The interface write is always updating the value of the selected interface register with the current value of the cell.

    So when the writeback is triggered, the current value in the interface register will be written to EEPROM. There are 8 interface registers. All 8 values are written.

    When the part powers up it will read the value in the EEPROM and write it into this interface register. Then when the cell is in operation, it will look at the value present on the interface read pin and increment/decrement, or keep it the same,  as the current setting of the cell. So the value in the interface register is always reflected into the up/down counter cell.

    The project I attached shows how this works. When I saved the project the cell was set to "6" (I think that was the value) so you will see it is populated with that value during startup. Then as you change the counter, the output from the cell to the interface write cell changes and the write cell write it to the interface register. The read cell then reads it so you will also see that updated.

    I hope this helps.

    Dave T

    Here is a screenshot of the program for those who do not want to download it to see it.

    NOTE: Edited this post to correct a small detail that I had incorrect. I also updated the project and screenshot.

    ADAU1701InterfaceReadandWriteExplaination.dspproj.zip
  • Hello Charlie,

    Since I have been investigating the use of the Interface Read and Write cells, I tried a trick and it works. This is not a problem you have faced but it is a good place to comment on this. The problem is that there are only 8 interface registers so that limits the number of cells you can use in a project that requires Interface Read and Write cells for it to function. You cannot use more than 8 and a compiler error will be generated.  

    So the trick is that the register serves as a feedback storage location. At the start of the sample period the value is read then before the end of the sample period it is updated with the new value if it was changed. So a Feedback cell operates in the same way. The value is read at the start of the frame, this is the Z-1 value, then later in the frame it is updated with the new value. So I simply connected a Feedback cell between the two interface pins and it works!

    The only small detail is that it will always power up with "0" as the value and of course, it will not be saved in the EEPROM. But for some applications this is fine.

    Here is a picture of what I did:

    Like I said, this has nothing to do with the issue you wrote about in this post but this post will come up in searches so I am putting this in here for reference.

    Dave T

  • Hello Dave, thanks a lot for the reply. At the moment I'm on holiday. On 28

    march I'll be back at home and could replay to you. Cheers.

    Charlie.

    Il 20/mar/2018 23:41, "DaveThib" <analog@analog-vm.hosted.jivesoftware.com>

    ha scritto:

    EngineerZone <https://ez.analog.com/?et=watches.email.thread>

    Re: Changing data in read/write interface is not reflected in WB/WP pins

    reply from DaveThib

    <> in *SigmaDSP

    Processors and SigmaStudio Development Tool* - View the full discussion

    <https://ez.analog.com/message/341454-re-changing-data-in-readwrite-interface-is-not-reflected-in-wbwp-pins?commentID=341454&et=watches.email.thread#comment-341454>

  • Hi Dave, thanks a lot again for your prompt reply.

    Writing in EEprom should be solved simply with a timer. While you are rotating the knob, nothing happens, as soons you stop rotating, after say one second the timer overflows signalling to write the new content into EEprom. Doing so its very difficult to make 1 million operations!!!

    About this, I have 100uF connected to 3.3V. Is it enough? How the DSP detect the power falling down?

    Thank in advance,

    Charlie.

  • Hi Dave, thanks a lot again for your prompt reply.

    Writing in EEprom should be solved simply with a timer. While you are rotating the knob, nothing happens, as soons you stop rotating, after say one second the timer overflows signalling to write the new content into EEprom. Doing so its very difficult to make 1 million operations!!!

    About this, I have 100uF connected to 3.3V. Is it enough? How the DSP detect the power falling down?

     

    Thank in advance,

    Charlie.

  • Hi all:

    Interface Registers should only write to the EEPROM upon power up and shutdown to "save" their current state. Other than that, they must be considered a regular memory location as if it was part of the DSP.

    Regards

    Miguel

  • Hello Charlie,

    The rising edge of the WB pin will trigger the writeback. Have a look at the MINI eval board design for some ideas.

    http://www.analog.com/media/en/technical-documentation/evaluation-documentation/EVAL-ADAU1701MINIZ.pdf

    The only thing I need to point out is that there are a few issues with this design. The DVDD voltage that is used to trigger the transistor to create the pulse is coming from the wrong place. It is on the wrong side of the diode D1. Yes, there are two 220uf caps to give it plenty of time to perform the writeback but the DVDD voltage is also being held up by these same caps! So really the trigger needs to have no caps on it so it falls quickly and triggers the writeback. Then having plenty of stored power in some caps will give the DSP time to write the data to the EEPROM.

    There are other ways to develop the "power going down" signal so do some investigating. Sorry that our example is not quite right.

    Dave T

  • Hi Dave, 

    everything I've done, runs OK. Only one last thing is a little tricky for me. 

    I have designed, using 2 timers and some logic, the mechanism that let one to change whetever parameter and after 1 second, it outputs a pulse of 1 ms. You can change these 2 parameters modifying the each timer setting. This positive out pulse is connected to the WB pin. Here the problem. I read in the ADAU1701 datasheet, that I have to set "Set multiple writeback" so that every time I change parameters, a writeback occurs... Could you show me the position and the value of the byte I have to modify? In Sigmastudio Hardware configuration IC2, in the Display File, could you tag the hex number I have to change to set multiple writeback? There's something other parameter to "enable" writeback in the EEPROM?

    If you are interested to see my solution, I could send you... 

    Thanks a lot in advance!

     

    Charlie.