Exact match. Not showing close matches.
PICList
Thread
'[SX] reading a 24Bit word with SX28 and SX/B'
2009\02\07@221255
by
WMcKILLemALLn/a
|
|
Hello all
I'm tring to read a 24Bit word with a SX28.
The word is LSB frist
I have seen this done with a PIC16F876A but it is in ASM, and I really don't like the PIC Editor, The SX/B is far better in My opion and is in Basic.
I would like to stay with the SX/B and SX28. I'm A newbee to the SX, But I like it.
If Any has some code for this or a link, I would Appt. it.
Thanks in Advance for any help.
______________$WMc%___________
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=326798
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)
2009\02\07@230506 by JonnyMacn/a
|
|
Read from what? I use 24-bit values in a camera control program that will be in the March issue of Nuts & Volts; in my case, though, I'm simply incrementing and decrementing a value; I'm not converting to any sort of output
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=326798#m326808
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)
2009\02\08@140751 by WMcKILLemALLn/a
|
|
JonnyMac
I'm trying to read a postion on a digital caliper ( 0" to 24" )
I have a 4 pin header on the caliper pin1 = VSS
pin2 = clock clock speed is 77kHz~ This is measured with a Parallax Oscope
pin3 = DATA
pin4 = VDD
The word starts out with a 55uS pause then the 24 bit word and a 55uS stop
I think My real ? is about the 16 bit REG. and a 24bit value.
How do I get the first 16 bits and then catch the last 8 bits in a REG. without them going by the way side.? And how to read this in to differnt REG.?
I'M confused
The Assembly I have converts this 24bit word to Quadrature and involes a lot of hardware.
Anyhelp or links would be great.
I also look forward to Your artc.s in Nut&Volts
____________$WMc%__________
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=326798#m326927
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)
2009\02\08@181522 by JonnyMacn/a
|
|
You'll have to synthesize a 24-bit value from a byte and a Word. Let's say you do this:
calHigh VAR Byte ' bits 16 - 23
calLow VAR Word ' bits 0 - 15
Get_Cal_Bits:
FOR idx = 0 TO 23
DO WHILE ClockPin = 0
LOOP
calHigh = calHigh << 1
calHigh.0 = calLow.15
calLow = calLow << 1
calLow.0 = DataPin
DO WHILE ClockPin = 1
LOOP
NEXT
Get_Cal_Bits:
FOR idx = 0 TO 23
ASM
JNB ClockPin, @$
MOVB C, DataPin
RL calLow_LSB
RL calLow_MSB
RL calHigh
JB ClockPin, @$
ENDASM
NEXT
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=326798#m327012
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)
2009\02\08@183449 by JonnyMacn/a
|
|
You'll could synthesize a 24-bit value from a byte and a Word. Let's say you do this:
calHigh VAR Byte ' bits 16 - 23
calLow VAR Word ' bits 0 - 15
Get_Cal_Bits:
FOR idx = 0 TO 23
DO WHILE ClockPin = 0
LOOP
calHigh = calHigh << 1
calHigh.0 = calLow.15
calLow = calLow << 1
calLow.0 = DataPin
DO WHILE ClockPin = 1
LOOP
NEXT
ASM
CLC
RL calHigh
MOVB calHigh.0, calLow_MSB.7
CLC
RL calLow_LSB
RL calLow_MSB
MOVB calLow_LSB.0, DataPin
ENDASM
Get_Cal_Bits:
FOR idx = 0 TO 23
ASM
JNB ClockPin, @$
MOVB C, DataPin
RL calLow_LSB
RL calLow_MSB
RL calHigh
JB ClockPin, @$
ENDASM
NEXT
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=326798#m327018
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)
2009\02\09@053817 by dabaylissn/a
|
|
I haven't tested the code but is it not possible to use an array to avoid the whole carry-shifting problem?
cals VAR Byte(3) ' bits 0-23
CalsIdx var byte
BitsIdx var byte
program get_cal_bits
Get_Cal_Bits:
FOR CalsIdx = 0 TO 2
FOR Bitsidx = 0 TO 7
DO WHILE ClockPin = 0
LOOP
cals(CalsIdx) = cals(CalsIdx) << 1
cals(CalsIdx).0 = DataPin
DO WHILE ClockPin = 1
LOOP
NEXT
NEXT
2009\02\09@071923 by JonnyMacn/a
|
|
Yep, David, that will work -- but it puts the values into an array which adds its own layer of complexity in SX/B (vis-a-vis treating the bits as one 24-bit value).
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=326798#m327150
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)
2009\02\09@173938 by WMcKILLemALLn/a
|
|
Hello All
I have tried the ASM code posted. I can see how it works and its very clever. However I keep getting a error from the compiler "Line 68,Error 5,Pass 1:BYTE PARAMETER EXPECTED " idx " "
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=326798#m327355
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)
2009\02\09@190005 by dabaylissn/a
|
|
The variable IDX needs to be declared before it is used.
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=326798#m327380
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)
|
|
WMc: Do you have link to that caliper and how others were interfacing to it? The code examples posted above are just for theory explanation; you to know actual clock polarity and the bit order to write a working function.
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=326798#m327393
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)
2009\02\10@172548 by WMcKILLemALLn/a
|
|
JonnyMac
Thanks for the reply...Here's the link http://www.shumatech.com/support/chinese_scales.htm#Chinese%20Scale%20Protocol
If above doesn't work Try www.ShumaTech.com
This link shows the protocol, and I have veryfied this with the Parallax Oscope.
*Note this site no longer has the ASM program that converted Chinese to Digimatic or Quadrature, Or the Hardware schematics, But I have these in print. I will try to scan it tomarrow and send it out to this Post.
David Bayliss:Thanks, I knew I was doing something stupid,.........I like to complie/snyntax check code as I go to check for errors.
_____Thanks for the help_____$WMc%_____________
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=326798#m327679
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)
More... (looser matching)
- Last day of these posts
- In 2009
, 2010 only
- Today
- New search...