Read MODE register for no reason

Writing software for systems that use VLSI Solution's devices as slave codecs to a host microcontroller.
Post Reply
Brek
Senior User
Posts: 60
Joined: Sun 2016-09-11 5:51

Read MODE register for no reason

Post by Brek » Fri 2017-12-29 12:29

Hi Guys :)
I think that’s what I’m doing. In the never ending quest to optimise for more program memory,
I've found that I’m reading the MODE register at startup shortly before writing the clock and volume registers.
The value of the MODE register is being read into a couple of bytes that are never accessed again.

This is probably artefact in my software from back doing original sine tests or something like that.
I can understand one might read back a register after writing it to verify the value was actually written,
but I’m never doing anything with the result that I read back.

Just to be sure is there any reason, such as to overcome a silicon bug, to read the mode register for vs1003b and ignore the result?
Cheers, Brek.

User avatar
pasi
VLSI Staff
Posts: 1457
Joined: Thu 2010-07-15 16:04

Re: Read MODE register for no reason

Post by pasi » Fri 2017-12-29 15:41

There used to be a reason to read SCI_MODE to differentiate vs1002d and vs1011e, which have the same VER number in SCI_STATUS.

If your firmware only works with a specific chip version anyway, then there's no need to read SCI_MODE. Unless you use it as a shortcut to deassert xCS. :D
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Brek
Senior User
Posts: 60
Joined: Sun 2016-09-11 5:51

Re: Read MODE register for no reason

Post by Brek » Tue 2018-01-02 10:07

Thanks for clearing it up :)

I’m checking the mode register, as well as the DREQ pin to ensure the chip is working in a separate function.
It appears I just left a duplicate... the remains of some previous check.. hey.. free program memory :)

Post Reply