Phone: +86-20-8520 1025       Email: SALES@FRIENDLYARM.COM / techsupport@friendlyarm.com Forum    Wiki

  • Shopping Cart
  • Login
  • Register
  • CPU Module
  • Mini Board
    • Cortex-A9(Quad-Core)
    • Cortex-A8
    • ARM11
    • ARM9
  • NanoPC & NanoPi
  • Hats & Docks
  • Enclosure & Holder
    • 3D Printed
    • Acrylic
    • Metal
    • Plastic
  • Matrix Accessories
    • Actuator
    • Camera
    • Communication
    • Display
    • GPS
    • Heat Sink
    • Power
    • Sensor
    • Serial Comm Board
    • SSD/MicroSD
    • Others
  • BakeBit Sensors/Modules
  • LCD Module
  • Value Pack & Kit
FriendlyElec

Login | Register

  • Home
  • Downloads
  • Forum
  • Wiki
  • Information
    • About Us
    • Privacy Policy
    • Terms & Conditions
  • Distributor
  • FreeBoard
Analog to Digital Converter ADC-01 Analog to Digital Converter ADC-01 Analog to Digital Converter ADC-01 Analog to Digital Converter ADC-01
Analog to Digital Converter ADC-01

Analog to Digital Converter ADC-01

0 reviews / Write a review
  • $5.00
  • Availability: In Stock

  • Brand: FriendlyElec
  • Product Code: ADC-01


  • Description
  • Reviews (0)

1 Introduction

We utilize the PFC8591T in this module and extend necessary pins through a 2.54 mm spacing pin header. The PFC8591T is an 8-bit A/D and D/A converter. It has 4 A/D channels and 1 D/A channel. In this module we use the PFC8591T's power, ground, I2C, A/D and D/A pins. The I2C's address is configured as 1001000x. Its power source range is 2.5V - 6.0V. By default the power pin is 5V however if you want to take a 0 - 3.3V analog signal and keep its accuracy you can connect it to a 3.3V power source.

2 Features

  • Wide power input range: 2.5V-6.0V
  • I2C, 3.3V/5V
  • 8-bit A/D x 4
  • 8-bit D/A x 1
  • Tiny dimension, easy to use in various situations
  • 2.54 mm spacing pin

3 How To

  • Connect to Tiny4412 SDK (1506)

    GND: Ground

    VCC: 5V

    SDA: I2C SDA

    SCL: I2C SCL

Code Sample in C Under Linux

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "libfahw.h"
 int main(int argc, char ** argv)
{
int devFD;
int data, channel, mode;
  if ((devFD = pcf8591Init()) == -1) {
printf("Fail to init pcf8591 ");
return -1;
}  if (pcf8591SetCtrl(devFD, PCF8591_INIT_AD_CONTROL) == -1) {
printf("Fail to Set pcf8591 control AD ");
pcf8591DeInit(devFD);
return -1;
}
mode = 0;
printf("pcf8591 working as AD in mode%d ",mode);
for(channel = PCF8591_AIN_CHANNEL0;channel <= PCF8591_AIN_CHANNEL3; channel++) {
data = pcf8591Read(devFD, mode, channel);
printf("Channel%d's value: %d ",channel,data);
}
pcf8591DeInit(devFD);
return 0;
}

Compile and Run

git clone http://github.com/friendlyarm/fa-hardware.git
cd fa-hardware
cd demo/matrix-analog_to_digital_converter
make

Copy your compiled bin to your board and you are ready to go.

Resources


Write a review

Write a review

Note: HTML is not translated!
    Bad           Good


Power & Source of Big Ideas

Follow us
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Newsletter

New in alerts - Sign up to our Newsletter.

Contact Us
  • Room 118,Building A, Shilian Technology Park, No.33 Science Road,Science City,Luogang District, Guangzhou,GuangDong China
  • +86-20-8520 1025
  • sales@friendlyarm.com
  • techsupport@friendlyarm.com
Information
  • About Us
  • Downloads
  • Privacy Policy
  • Terms&Conditions
  • Distributor
  • FreeBoard
Customer Service
  • Contact Us
  • Returns
  • Site Map
My Account
  • My Account
  • Order History
  • Wish List
  • Newsletter


Copyright © 2008-2022 friendlyelec.com All rights reserved.
Top
Categories
  • CPU Module (10)
  • Mini Board (3)
  • NanoPC & NanoPi (29)
  • Hats & Docks (13)
  • Enclosure & Holder (16)
  • BakeBit Sensors/Modules (2)
  • Matrix Accessories (73)
  • LCD Module (16)
  • Value Pack & Kit (11)