Go to advanced search

by gauravsharma0190
Thu Apr 30, 2015 7:50 am
Forum: C/C++
Topic: i2c with pcf8591
Replies: 46
Views: 9499

Re: i2c with pcf8591

hello there i connected the pcf8591 connection like this.... when i do i2cdetect it shows the address 0x48 . now i do i2cset -y 0 0x48 0x32 0x10 .while see the i2cdump 0 0x48 at address 0x32 it doesn't show me 0x10. while i2cget -y 0 0x48 0x32 it doesn't read the value 0x10 which i wrote on it. what...
by gauravsharma0190
Thu Apr 23, 2015 11:25 am
Forum: C/C++
Topic: i2c with pcf8591
Replies: 46
Views: 9499

Re: i2c with pcf8591

hey joan
do u work on friendly arm mini2440.
i am problem in it
by gauravsharma0190
Thu Apr 23, 2015 10:35 am
Forum: C/C++
Topic: i2c with pcf8591
Replies: 46
Views: 9499

Re: i2c with pcf8591

hello there,
i am interfacing the pcf 8591 and detect it using i2cdetect tool.
now i wand to read it using command line as i2cget.
but when i type it it tells -sh :no i2cget
how can i do it.
by gauravsharma0190
Fri Apr 17, 2015 12:04 pm
Forum: C/C++
Topic: i2c with pcf8591
Replies: 46
Views: 9499

Re: i2c with pcf8591

The Pi is the I2C bus master. The devices on the bus which talk to the master are called slaves. So a slave address just refers to a device address. @joan i knew you are really fed up to me...but i really oblige to you if you give me simple programme idea to read data from pcf8591 because i really ...
by gauravsharma0190
Fri Apr 17, 2015 9:57 am
Forum: C/C++
Topic: i2c with pcf8591
Replies: 46
Views: 9499

Re: i2c with pcf8591

The Pi is the I2C bus master. The devices on the bus which talk to the master are called slaves. So a slave address just refers to a device address. @joan i knew you are really fed up to me...but i really oblige to you if you give me simple programme idea to read data from pcf8591 because i really ...
by gauravsharma0190
Fri Apr 17, 2015 9:20 am
Forum: C/C++
Topic: i2c with pcf8591
Replies: 46
Views: 9499

Re: i2c with pcf8591

The address confusion seems to arise because the address and R/W bit is placed in 8 bits with the address at the top. Your device has a device address of 0x48. The R/W bit is 0 when you write to a device and 1 when you read from a device. So to read from your device 0x91 is sent on the bus. To writ...
by gauravsharma0190
Fri Apr 17, 2015 8:46 am
Forum: C/C++
Topic: i2c with pcf8591
Replies: 46
Views: 9499

Re: i2c with pcf8591

@joan i understand...now i am interfacing the pcg8591 with GND ADD. pin and ext pin. 10K pullup with scl and sda. now connect the scl and sda pins with pi scl and sda pin.. 1.open i2c file. 2.device address 0x48. 3.write address 0x90 to it. 4. write from which address. 5.read address 0x91. 6.read th...
by gauravsharma0190
Fri Apr 17, 2015 6:13 am
Forum: C/C++
Topic: i2c with pcf8591
Replies: 46
Views: 9499

Re: i2c with pcf8591

hello joan,
thanks for the code
i am little bit confuse about that according the datasheet i2c slave address is 0X91 if all add.pin to GND.
and control byte is 0X00 if read from channel 1.
so why are you using 0x48...first
second...what is i2c_slave. diff b/w i2c-slave and pcf8591 i2c slave.
by gauravsharma0190
Thu Apr 16, 2015 12:29 pm
Forum: C/C++
Topic: i2c with pcf8591
Replies: 46
Views: 9499

Re: i2c with pcf8591

Without context it's a bit hard to know why 0x90 (which is 0x48 shifted 1 bit up) is being used. It seems like a mistake if the Linux I2C driver is being used. My similar C code. #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <linux/i2c-dev.h> #include <nc...
by gauravsharma0190
Thu Apr 16, 2015 10:44 am
Forum: C/C++
Topic: i2c with pcf8591
Replies: 46
Views: 9499

Re: i2c with pcf8591

Not all PCF8591 modules let you configure the address so the base address 0f 0x48 is used. 0x48 is 100 1000 (7 bit addresses). On the I2C bus the 7 bit address is sent followed by the read/write bit. So 100 1000 R/W is sent. Ok joan bu tsee in this code here is the another example { buf[0]=0x90; //...
by gauravsharma0190
Thu Apr 16, 2015 9:08 am
Forum: C/C++
Topic: i2c with pcf8591
Replies: 46
Views: 9499

Re: i2c with pcf8591

Slave address
Bit 7 6 5 4 3 2 1 0

slave 1 0 0 1 A2 A1 A0 R/W
R=1;W=0;
here is the slave address.
by gauravsharma0190
Thu Apr 16, 2015 4:35 am
Forum: C/C++
Topic: i2c with pcf8591
Replies: 46
Views: 9499

i2c with pcf8591

hello there, i am interfacing an i2c pcf8591 and want to read with it. i have an example code in which void i2c_init() { fd=open("/dev/i2c/0",O_RDWR); // file open i2c communication in read-write mode if (fd<0) { printf("\n NOT ABLE TO OPEN THE DRIVER \n"); } else { printf("\n I2C IS WORKING \n"); }...
by gauravsharma0190
Wed Feb 04, 2015 7:09 am
Forum: C/C++
Topic: serial communication with xbee problem
Replies: 73
Views: 20161

Re: serial communication with xbee problem

The best way is to use already made library like Wiring Pi or pigpio Start with wiring PI. Both of them are very good http://wiringpi.com http://abyz.co.uk/rpi/pigpio/ Daniel thanks very much sir.... if you have your email id that i can stay connect with you i want to learn lot from you. if you don...
by gauravsharma0190
Tue Feb 03, 2015 5:46 am
Forum: C/C++
Topic: serial communication with xbee problem
Replies: 73
Views: 20161

Re: serial communication with xbee problem

Experience only experience. And yes it is 'C'. A good way to start will be to google 'gcc documentation' I start to play with processor in 1977 using toggle and push button to program the RCA 1802. This is telling you how old I am. Borland compiler version 1.0 came with book with all the functions....
by gauravsharma0190
Tue Feb 03, 2015 4:22 am
Forum: C/C++
Topic: serial communication with xbee problem
Replies: 73
Views: 20161

Re: serial communication with xbee problem

thanks very much sir.......
still i am at level 0.........
i did very simple programming in c....
and i am very greatful to you....to give me your helpful suggestion.
it's all about experience.....
i will learn lot's of things from you....
by gauravsharma0190
Thu Jan 29, 2015 11:26 am
Forum: C/C++
Topic: serial communication with xbee problem
Replies: 73
Views: 20161

Re: For serial communication

I read the Royaltek document and since I don't know your code I did a sample program to extract the structure of each GPS Data. This program will split all the string from the gps in individual array. You will have to decipher it by yourself. This code use one thread which wait for a new line and l...
by gauravsharma0190
Thu Jan 29, 2015 5:37 am
Forum: Troubleshooting
Topic: GPIO issue
Replies: 3
Views: 516

Re: GPIO issue

and what is the default voltage when switch on the RPI
by gauravsharma0190
Thu Jan 29, 2015 5:02 am
Forum: Troubleshooting
Topic: GPIO issue
Replies: 3
Views: 516

Re: GPIO issue

Are you using pin numbers or gpio numbers? pin 7 = gpio 4 pin 11 = gpio 17 To set a gpio low set it as an output and write 0. To set a gpio high set it as an output and write 1. What do you mean by 2.90+/- 5? That says -2.1V or 7.9V. Do you mean 2.90+/- 0.5, 2.4V or 3.4V? no john i am using wiringP...
by gauravsharma0190
Wed Jan 28, 2015 12:01 pm
Forum: Troubleshooting
Topic: GPIO issue
Replies: 3
Views: 516

GPIO issue

hello everyone i have a gpio issue....when i turn on the rpi then pin 11,7 and some are at logic level at 2.90+/- 5.... can anyone tell me how to get them at Zero level.... second how to exit from the running programme......including RPI programme. fro example:- blinking an led while giving sudo ./l...
by gauravsharma0190
Tue Jan 27, 2015 11:40 am
Forum: Troubleshooting
Topic: GPIO Pin Voltage
Replies: 27
Views: 20957

Re: GPIO Pin Voltage

hello everyone,
i've seen all the post and says thanks to all
i have a problem in gpio pin 12 where it is giving me 1.15+/- 5 V anytime when i switch off/on the supply.....
i am worry about it because it is PWM pin.
can anyone give me solution for this.
thanks
by gauravsharma0190
Wed Jan 21, 2015 6:43 am
Forum: C/C++
Topic: interfacing ADC to raspberry
Replies: 2
Views: 1086

interfacing ADC to raspberry

hello everyone
i want to interface the adc with my pi board ADC0808...
how can i programme in raspberry pi without the wiringpi.....because i programme in AVR and pic which is much differ then this programming.....like advance C language....
if anyone help me i will oblige for this
thank you.
by gauravsharma0190
Wed Jan 21, 2015 4:41 am
Forum: C/C++
Topic: for pwm generation
Replies: 1
Views: 603

Re: for pwm generation

hello everyone, i generated the softpwm using the wiringpi library as follows: #include<softpwm.h> pwmcreate(1,20,100); pwmwrite(1,20); for(;;) delay(100); but now the pin which is assigned 1 is 12 no pin in pi,has voltage 1.17V and not generate the pwm but when i change the pin it generate the pwm....
by gauravsharma0190
Thu Jan 15, 2015 12:12 pm
Forum: Python
Topic: for pwm generation
Replies: 3
Views: 520

for pwm generation

hello everyone
i want to generate a 100 Hz pwm wave to control LED brightness/motor speed
can any one help me how to code it only
i am new in python as well as PWM.
i worked on 51 and avr family but not in pi a long time...just a learner and learn python.
thank you .
by gauravsharma0190
Thu Jan 15, 2015 4:58 am
Forum: C/C++
Topic: for pwm generation
Replies: 1
Views: 603

for pwm generation

hello everyone,,
can any one help me to code a pwm.c so that i can see and understand it..
i seen it in wiring pi but could not understand the basic.
thanks
by gauravsharma0190
Wed Jan 07, 2015 4:52 am
Forum: C/C++
Topic: serial communication with xbee problem
Replies: 73
Views: 20161

Re: serial communication with xbee problem

Could you cut, paste and recompile my code because there is no reason for that. As I demonstrated with my own GPS. It is working fine. What will you do with the filtered data? What is the next step? Just wonder? What is the reason about filtering the data? My first name is Daniel, Perron is my last...

Go to advanced search