To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 3896
3895  |  3897
Subject: 
A/D converter
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Thu, 4 Jun 1998 06:22:38 GMT
Original-From: 
HECTOR NORIEGA <110060.2126@saynotospamCOMPUSERVE.COM>
Viewed: 
1177 times
  
From: Hector Noriega,   3JUNE98
Thanks Adam,(adam@programmer.net) The Speed of the
A/D inproved by about 50 HZ, by getting rid of
float types, so now I can sample data at 290HZ only!.
According to the Motorola "Pink Book" the A/D
should be ready after 32 E clock cycles and
the E clock is 2 MHZ, so the sampling should be
good for 58KHZ and the nyquest is 29KHZ.
The new "IC" code is :
****************Start of "IC" code************************

/* To test Feedback Controller */
   int  volt_out=128;          /*motor output of "0" */
   int v_opt,disp;
void main()
  {
   while(1)
    {
  v_opt = atodconv(0);  /*start a2d subroutine;*/
      v_opt = (v_opt <<8);      /* shift to get rid of one accumulator*/
      v_opt = (v_opt >>8);      /* shift right to read byte */
      v_opt = (128 - v_opt);
      volt_out = (v_opt + 128); /*scale volts to digital units.*/
      poke(0x6fff,volt_out);     /* A/D correction to drive motor*/
    }  /* end of while */
    }  /* end of main program*/
********************************end of "IC" code.
Thank you for your support in advance.
Hector Noriega; 110060.2126@compuserve.com



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR