Go to advanced search

by Richard-TX
Wed Aug 07, 2013 5:14 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Understanding i2c write in C
Replies: 7
Views: 4782

Re: Understanding i2c write in C

The simple way to write a word to the Adafruit 16 channel controller is to use the word option to i2cget/i2cset. i2cset 1 0x40 0xaddr 0xFFFF w In this manner, register 0xaddr and 0xaddr+1 will get written in a single write operation. In your c code define your variable as a word instead of an int an...
by Richard-TX
Wed Aug 07, 2013 5:04 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN bus on Pi
Replies: 4
Views: 1952

Re: CAN bus on Pi

Depending on the USB-> CAN adapter you should be able to do everything from user space and not have to touch the kernel. What does the output of lsusb look like? Who made the device?
by Richard-TX
Wed Aug 07, 2013 4:51 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading Tach Wire Pulses from Fan
Replies: 2
Views: 2813

Re: Reading Tach Wire Pulses from Fan

As far as I am concerned, the best way to do fan control is with an off-the-shelf solution. Here is one that looks easy and is the one I would try first. http://www.analog.com/static/imported-files/data_sheets/ADT7470.pdf That chip is low cost (about $5) and has many features. There are other chips ...
by Richard-TX
Wed Aug 07, 2013 4:25 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: I2C vs GPIO vs UART vs SPI - Super Noob Question
Replies: 16
Views: 46882

Re: I2C vs GPIO vs UART vs SPI - Super Noob Question

In the Raspberry Pi world, the way it boils down is like this: I2C - Easiest and most expandable bus. Raspberry has two I2C buses, bus 0 and bus 1. Capable of expanding the Rpi to thousands of output ports. Programming is very easy. SPI - Only 2 chip select lines so max number of devices is very lim...
by Richard-TX
Wed Aug 07, 2013 3:57 pm
Forum: Automation, sensing and robotics
Topic: I2C do not work with MPU6050
Replies: 2
Views: 759

Re: I2C do not work with MPU6050

Maybe your I2c bus speed is too high, cable length too long, or is improperly terminated. Try lowering your clock speed to compensate.
by Richard-TX
Wed Aug 07, 2013 11:38 am
Forum: Automation, sensing and robotics
Topic: Controlling servos
Replies: 13
Views: 79084

Re: Controlling servos

As far as I am concerned, when it comes to servos, the Adafruit 16 channel controller can't be beat. Easy to program and robust. I have two in operation now and will be adding more.
by Richard-TX
Sun Jul 14, 2013 3:53 am
Forum: Raspbian
Topic: PATH evrio varible?
Replies: 7
Views: 2076

Re: PATH evrio varible?

You can set the path explicitly or you can append to what is there.

to set it explicitly

PATH=/bin:/usr/bin:........
export PATH

To append to it.....
PATH=$PATH:/path/to/
export PATH
by Richard-TX
Sun Jul 14, 2013 3:51 am
Forum: Beginners
Topic: Debating on which language to learn
Replies: 10
Views: 2071

Re: Debating on which language to learn

I recommend learning the following:
shell scripts
'c' - NOT C++
python

That will cover 99%-100% of your needs.
by Richard-TX
Mon Jul 08, 2013 3:17 pm
Forum: Automation, sensing and robotics
Topic: MCP23S17 as I/O expander?
Replies: 19
Views: 12297

Re: MCP23S17 as I/O expander?

As FYI, the SPI bus can address sixteen MCP23S17 chips. That means that he number of SPI based I/O ports available is a whopping 256. The I2C buses can address an additional sixteen MCP23017 chips. That means that the RPI can have a total of 512 I/O ports based on the mcp23x17. If that isn't enough ...
by Richard-TX
Mon Jul 08, 2013 2:31 pm
Forum: Automation, sensing and robotics
Topic: MCP23S17 as I/O expander?
Replies: 19
Views: 12297

Re: MCP23S17 as I/O expander?

Hi, I' m interested to connect a MCP23S17 to the R-pi for using with scratch. Has someone helpful information? Thanks RABIS50 Here is a simple program to get you going,. No special libraries needed. :) Save it as spi-test.c then do a "make spi-test" You can invoke it as simply "spi-test" or "spi-te...
by Richard-TX
Mon Jul 01, 2013 10:01 pm
Forum: Other projects
Topic: Model Railroad Controller aka Stationary Decoder
Replies: 1
Views: 3603

Re: Model Railroad Controller aka Stationary Decoder

I have a web site for the Rocrail-Raspberry Pi model railroad controller project. It is at http://rocpi.ae-tool.com This is a full featured controller that has: - Servo or LED controllers for switch control. - Power switching for powering switch frogs and signals. - Block detection For those that ar...
by Richard-TX
Sat Jun 29, 2013 1:14 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: [SPI] LED Matrix using Maxim MAX7221
Replies: 4
Views: 4877

Re: [SPI] LED Matrix using Maxim MAX7221

The Max7221 allows for cascading on the SPI bus so the limit on the number of devices on a RPI is fairly high. It appears to be unlimited. (How many no-op commands can you send?) Look at page 10 and the diagram at the bottom of page 13 of the document at http://datasheets.maximintegrated.com/en/ds/M...
by Richard-TX
Sat Jun 29, 2013 12:54 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Cheap I/O Expansion chips
Replies: 16
Views: 10196

Re: Cheap I/O Expansion chips

I like Digikey for a few reasons.

1 - their prices are usually good depending...
2 - they will ship via USPS First class mail which is dirt cheap!

Their single lot prices for a MCP23017 is a whopping $1.44 Buy 25 of them for $25.
by Richard-TX
Sat Jun 29, 2013 12:36 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI MCP23s17 addressing
Replies: 8
Views: 4887

Re: SPI MCP23s17 addressing

Gordon and Arjan, With all respect I appreciate the links to the libraries but I chose not to use them for a few reasons. 1 - if I were to use them I would learn little. 2 - This application has to be fast and a library may add latency. 3 - It is uncertain if a library would be suitable for my appli...
by Richard-TX
Sat Jun 29, 2013 7:47 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI MCP23s17 addressing
Replies: 8
Views: 4887

Re: SPI MCP23s17 addressing

Here is the corrected program. The command needed to enable HW addressing of the MCP23S17 is in bold. /**************************************** * basic SPI demo for mcp23s17 with addressing * now with interrupts. *****************************************/ #include <stdlib.h> #include <stdio.h> #incl...
by Richard-TX
Tue Jun 25, 2013 8:04 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI MCP23s17 addressing
Replies: 8
Views: 4887

Re: SPI MCP23s17 addressing

I found out what is wrong.

I needed to set HAEN

writeByte (IOCON, 0x08) ; // set HW addressing.
by Richard-TX
Tue Jun 25, 2013 7:46 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Sainsmart SSR Wiring?
Replies: 5
Views: 5166

Re: Sainsmart SSR Wiring?

I am not sure why Sainsmart does what it does, but I am driving solid state relays directly from the GPIO on the Rpi. SSRs require 3-30VDC to trigger so the Rpi is a natural.
by Richard-TX
Tue Jun 25, 2013 7:15 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI MCP23s17 addressing
Replies: 8
Views: 4887

Re: SPI MCP23s17 addressing

When I connect a led to port a-1 of both chips, both LEDs light up and turn off simultaneously..
by Richard-TX
Tue Jun 25, 2013 4:46 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI MCP23s17 addressing
Replies: 8
Views: 4887

SPI MCP23s17 addressing

I have two MCP23S17 chips connected to the SPI bus on my Pi. I will have more connected in the future. One of the chips is configured with address 0 and the other at address 1. The two chips share the save CS/CE line as well as the other lines. Below is the program that I am using. The issue is that...
by Richard-TX
Wed Jun 19, 2013 1:11 pm
Forum: Other projects
Topic: Model Railroad Controller aka Stationary Decoder
Replies: 1
Views: 3603

Model Railroad Controller aka Stationary Decoder

I just completed phase I of something I call the Roc-Pi. The Roc-Pi is a servo, LED, and block detector or in other words a multi-purpose stationary decoder that uses SRCP (Simple Railroad Command Protocol) as a communications protocol. While designed for use with Rocrail, it could be used with any ...
by Richard-TX
Mon Jun 10, 2013 2:18 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Sainsmart relay
Replies: 60
Views: 54219

Re: Sainsmart relay

The 8 relay board that I am referring to that needs some modification done is the signal relay board with the yellow cased relays. The blue cased relay boards work just fine without any additional glue and is safe for use with the Rpi (assuming it is wired correctly). I have been switching a two rel...
by Richard-TX
Tue Jun 04, 2013 6:46 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Sainsmart relay
Replies: 60
Views: 54219

Re: Sainsmart relay

The 8 relay board does need a little help if it is to be triggered from 3 volts. What I opted to do was to eliminate R7. There just isn't enough current there to reliably fully turn on the transistor when supplied with 3 volts. Sometimes that isn't enough. so changing the 1k to a lower value may be ...
by Richard-TX
Tue Jun 04, 2013 6:01 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Sainsmart relay
Replies: 60
Views: 54219

Re: Sainsmart relay

I just checked the relay modules that I received yesterday from Sainsmart. The boards I received matches the schematic save for the short across the coil. :D Having said all that, the 3 volt supply lights the leds and triggers the relays reliably so no issues there. The worst case scenario would be ...
by Richard-TX
Tue May 28, 2013 3:37 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Sainsmart relay
Replies: 60
Views: 54219

Re: Sainsmart relay

I fail to see why any special interfacing is required. The relay board has opto isolators for driving the relays and they can be triggered directly from the Pi since they represent one LED load or less. Also the opto input is isolated from the rest of the board so there are no special considerations...

Go to advanced search