On Tue, 2008-01-22 at 09:16 -0800, Kirk Wallace wrote:
> On Tue, 2008-01-22 at 09:33 -0600, Jeff Epler wrote:
> > A "bit" pin which is TRUE can have any nonzero value, not just 1. So
> > the line
> > bit_shifted = (bit_in << which_bit);
> > is incorrect. Instead, you may wish to write somethi
On Tue, 2008-01-22 at 09:33 -0600, Jeff Epler wrote:
> A "bit" pin which is TRUE can have any nonzero value, not just 1. So
> the line
> bit_shifted = (bit_in << which_bit);
> is incorrect. Instead, you may wish to write something like
> if(bit_in)
> accum = accum | (1 << which_bi
A "bit" pin which is TRUE can have any nonzero value, not just 1. So
the line
bit_shifted = (bit_in << which_bit);
is incorrect. Instead, you may wish to write something like
if(bit_in)
accum = accum | (1 << which_bit);
to avoid the confusion. (I prefer "|" (bitwise OR) to "+" (a
rflow, and the shift will
happen with a strange number of bits).
Regards,
Alex
- Original Message -
From: "Kirk Wallace" <[EMAIL PROTECTED]>
To: "Enhanced Machine Controller (EMC)"
Sent: Tuesday, January 22, 2008 5:29 AM
Subject: [Emc-users] Serial ADC Shifting
> I was kinda hoping no one would ask that.
Hi, I'm the one in every crowd...:)
I just hooked up the AXIS
> Flood button to the bit input of my component. Which would give the
> component all ones or all zeros, except when the input is changed during
> a conversion cycle. This shouldn't make to
;
> Sent: Monday, January 21, 2008 9:29 PM
> Subject: [Emc-users] Serial ADC Shifting
>
>
> >I have the a serial ADC setup and mostly working, but I have a problem
> > with the output value being too high. I shift bit 11 through 0 into a
I was kinda hoping no one
Kirk-
How are you simulating the input in the office?
Javid
- Original Message -
From: "Kirk Wallace" <[EMAIL PROTECTED]>
To: "Enhanced Machine Controller (EMC)"
Sent: Monday, January 21, 2008 9:29 PM
Subject: [Emc-users] Serial ADC Shifting
>I have the
I have the a serial ADC setup and mostly working, but I have a problem
with the output value being too high. I shift bit 11 through 0 into a
byte as shown below.
Full file here:
http://www.wallacecompany.com/machine_shop/EMC2/serial_adc/LTC1286.comp
...
case 1: // *** Mode 1