Optoisolators

After all the frustrations with the optoisolators last time I designed a board for the ACSL-6400, which is a quad optoisolator, and ordered some. Today they came so I assembled one and tested putting the CS, MOSI and SCLK signals through it. This one has 4 signals in the same direction, but there is also a 3 out 1 in version specifically for SPI. I didn’t use this because the ADS1299 has both DRDY and the MISO signals I want to connect.

Custom breakout board for the ACSL-6400
When looked at with the signal analyzer, everything is right (inversion is done in MCU software).

Everything appears to work. I have a ton of extra boards, so if anyone is interested in buying assembled quad optoisolator breakout boards, please contact me.

Sorting LaTeX references

I don’t use .bib files and just populate bibliographies like:


\begin{thebibliography}{99}

\bibitem{Romanelli1989}
  F.~Romanelli, Phys. Fluids B \textbf{1}, 1018 (1989).

%.... (other citations)

One issue is that this can be out of order compared to the order of /cite{} in the text. The following python script goes through the citations in the text and prints the appropriately ordered bibliography. Replacing the bibliography must be done by hand, but it’s safer that way.


f=open("article.tex","rb")

cites=[]
A=f.tell()

for line in f.readlines():
  while(True):
    a=line.find(r"\cite{")
    if(a==-1):
      break
    else:
      line=line[a+5:]
      b=line.find("}")
      blah=line[1:b]
      if(blah!=""):
        B=blah.split(",")
        for e in B:
          if e not in cites:
            cites.append(e)
      line=line[b:]

refs=[]

f.seek(A)
last_line=""
for line in f.readlines():
  if(last_line[:5]==r"\bibi"):
    refs.append((last_line,line))
  last_line=line

for i in cites:
  for j in refs:
    end=j[0].find("}")                                                                                                                                        
    if(i==j[0][9:end]):
      print j[0][:-1]
      print j[1]
      continue