Question about assembly code
I recently decided to make an assembly driver for a TI ADS 1252, a 24 bit ADC just to see if there was any value for my application over a 12 bit ADC. It also seemed like a great way to improve my PASM skills.
My problem is I ran into some chip behavior that I wasn't expecting.
Basically, I was using my Propscope to look the serial pin to go high and staying high after the ADS 1252 had sent a certain signal on the data pin. However, what I got was all 3 of the pins used in this driver going high. Even the clock pin which shouldn't be affected by the ADC behavior.
Any help correcting my mistaken impressions would be appreciated.
My problem is I ran into some chip behavior that I wasn't expecting.
VAR
long cog, cPin
long Pout
long CLK
long dPin
long sPin
Pub Start( cPinx, dPinx, sPinx) : okay
' cPin connected to CLK pin on ADS1252
' dPin connected to DOUT/DRDY pin on ADS1252
' sPin connected to SCLK pin on ADS1252
longfill(@Pout, 0, 4)
cPin := |< cPinx
sPin := |< sPinx
dPin := |< dPinx
Pout := cPin | sPin
CLK := %00100 << 26 + cPinx
okay := cog := cognew(@entry, @Pout)
Pub Stop
cogstop(cog)
DAT
org
entry mov t1, par
rdlong Pinout, t1
or dira, PinOut
add t1, #4
rdlong aCLK, t1
mov CTRa, aCLK
mov frqa, CtraFreq
add t1, #4
rdlong aDAT, t1
add t1, #4
rdlong aSER, t1
waitpeq aDAT, aDAT
waitpne aDAT, aDAT
waitpeq aDAT, aDAT
waitpne aDAT, aDAT
or outa, aSER
'----------------------------------------------------------------
CtraFreq long 054_100_000
t1 res 1
aCLK res 1
Pinout res 1
aDAT res 1
aSER res 1
Basically, I was using my Propscope to look the serial pin to go high and staying high after the ADS 1252 had sent a certain signal on the data pin. However, what I got was all 3 of the pins used in this driver going high. Even the clock pin which shouldn't be affected by the ADC behavior.
Any help correcting my mistaken impressions would be appreciated.

Comments