Re: [Emc-users] Serial ADC Shifting

2008-01-22 Thread Kirk Wallace
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

Re: [Emc-users] Serial ADC Shifting

2008-01-22 Thread Kirk Wallace
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

Re: [Emc-users] Serial ADC Shifting

2008-01-22 Thread Jeff Epler
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

Re: [Emc-users] Serial ADC Shifting

2008-01-22 Thread Alex Joni
Hi Kirk, I didn't read the code _very_ carefully, so I might be off. But skimming over it it seems that you do shiftings between adc_step = 7 and adc_step = 29 that's 22 shiftings if I read it right, the which_bit will be decremented 22 times (after 11 decrements it will probably overflow, and t

Re: [Emc-users] Serial ADC Shifting

2008-01-21 Thread Javid Butler
> 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

Re: [Emc-users] Serial ADC Shifting

2008-01-21 Thread Kirk Wallace
On Mon, 2008-01-21 at 21:54 -0600, Javid Butler wrote: > 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:

Re: [Emc-users] Serial ADC Shifting

2008-01-21 Thread Javid Butler
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 a serial ADC setup and mostly