Go to advanced search

by frasmacon
Sun Apr 21, 2013 5:17 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

OK, I have tried to rethink this and it's really confusing. Basically I'm just trying to work out what is wrong. So code-wise I have Used my own code Used the C example from BCM_2835.h Used the Python bitbang from Adafruit and it still doesn't work I have checked, double-checked, triple-checked and ...
by frasmacon
Sat Apr 20, 2013 2:46 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

OK, here's some C code that doesn't seem to work either for some reason... It's also attached (ZIP'ed as I can't attach C. //MCP3004 code thing by Fraser May //Adapted from the examples #include <bcm2835.h> #include <stdio.h> int main(int argc, char **argv) { // If you call this, it will not actuall...
by frasmacon
Fri Apr 19, 2013 11:22 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

trouch wrote:/dev/spidev0.0 => Chip Enable 0 (CE0 / Pi header pin 24 / GPIO 8)
/dev/spidev0.1 => Chip Enable 1 (CE1 / Pi header pin 26 / GPIO 7)
In theory it almost defiantly should work that way but I don't know what it's doing...
by frasmacon
Fri Apr 19, 2013 11:20 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

Well I tried using the BCM2835 C library and although it did do things with the chip select, it didn't really work. I'll post my code in a few hours after I go to sleep as I'm in bed and PC is off. I wouldn't mind someone taking a look at it as I don't normally use C.
by frasmacon
Fri Apr 19, 2013 7:17 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

I tried doing the chip select line manually, turning it low before doing the transfer function then turning it back on and it didn't seem to work. Is there any way it could accidentally use the wrong pins for the proper SPI? Did you check that the CE line is going low when you did this? If you're w...
by frasmacon
Thu Apr 18, 2013 8:18 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

OK, just re installed the OS using the Occidentalis thing from Adafruit and that's not working either. Although I used the program I used before. Maybe it's something to do with that. But it still has the problem with chip select not going low. I'll mess about with it some more. EDIT: Tried changing...
by frasmacon
Tue Apr 16, 2013 10:20 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

I don't know if this will help, but I was having issues with the I2C bus (http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=39925) and I think what solved the issue was setting the I2C speed to a whopping 1 Hz and then back to 32KHz. It's just a suggestion akin to 'turn it off and back on agai...
by frasmacon
Sat Apr 13, 2013 5:27 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

I tried doing the chip select line manually, turning it low before doing the transfer function then turning it back on and it didn't seem to work. Is there any way it could accidentally use the wrong pins for the proper SPI?
by frasmacon
Wed Apr 10, 2013 11:56 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

Are you definitely giving the ADC enough power? I had a similar problem with an AD7908 ADC because I was trying to drive it off the Pi's 5V supply (which actually sits at ~4.7 V). The Pi's supply lines and ground are also a bit noisy which can cause errors in the ADC. After a few days of it not wor...
by frasmacon
Wed Apr 10, 2013 10:08 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI chip select lines don't go low

So now the problem has been narrowed down to: SPI chip select lines don't go low. You can verify this by emulating the Chip Select line on another gpio that you control from your program. Set it initially HIGH Set it LOW Send data with SPI Set it HIGH Have you tried the loopback test, to see if sen...
by frasmacon
Wed Apr 10, 2013 8:59 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

SPI chip select lines don't go low

The rmmod/modprobe commands basically remove the SPI driver from memory and then restart it. If the driver is corrupted or an incompatible version you should receive a message indicating a problem when the modprobe command is executed. Barring an issue with your wiring or ADC, it is possible you ha...
by frasmacon
Tue Apr 09, 2013 7:40 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

It almost seems that the SPI is not enabled for the GPIO lines. I recall an earlier thread that discussed an issue with using the SPI for GPIO and then attempting to use it for SPI required a reboot. Can you confirm that no other application has used the same GPIO pins for IO before you run your pr...
by frasmacon
Tue Apr 09, 2013 12:42 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

OK here goes... http://s19.postimg.org/o18sihmlr/xfer.jpg xfer not xfer2. I don't have a multimeter but I can confirmed using an LED the value changes properly when I rotate it. Tried this and it didn't work. Just got a lot of zeros Not too sure what you want me to do with this one... Tried this and...
by frasmacon
Mon Apr 08, 2013 7:10 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

bgreat wrote:Sorry for the delay, but I have been rather busy. Nothing obvious in the wiring. I will take a closer look at this tonight on my Raspberry Pi and post back.

Enjoy!
Bill
Thanks very much
by frasmacon
Sun Apr 07, 2013 10:37 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

Please post a drawing of how you have MCP3004 connected and your code. Unless there is a hardware failure, the issue is either wiring or software. With the additional information, it will be possible to help you determine the cause. Enjoy! Bill OK Here's a Fritzing drawing, this is pretty much a du...
by frasmacon
Wed Apr 03, 2013 2:57 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI ADC was working fine last week and now it's not
Replies: 27
Views: 6540

Re: SPI ADC was working fine last week and now it's not

Hello? I rewired again for the third time using a picture and video I made of it before and it working perfectly and it still doesn't work. I even swapped out the MCP3004 with another MCP3004. I would really like some help. It just returns random numbers from 0 to 23 (out of 1023). Some help would b...
by frasmacon
Sun Mar 31, 2013 11:36 am
Forum: Automation, sensing and robotics
Topic: Weather Station idea
Replies: 18
Views: 4964

Re: Weather Station idea

Unfortunately, python can't be used with DHT22, because of the high speed of communication required (I think). Some more expensive humidity sensors that use a similar interface to I2C are the SHT family: http://www.sensirion.com/en/products/humidity-temperature/ These can also be bought at sparkfun...
by frasmacon
Sun Mar 31, 2013 10:22 am
Forum: Automation, sensing and robotics
Topic: Weather Station idea
Replies: 18
Views: 4964

Re: Weather Station idea

I'd rather use this humidity sensor as it's the only relatively cheap one I found that doesn't a) Have some weird interface or b) requires to be bought in bulks of near 4000. It outputs a varying voltage depending on the humidity so could I just hook this up to an ADC? https://www.sparkfun.com/produ...
by frasmacon
Sun Mar 31, 2013 10:00 am
Forum: Automation, sensing and robotics
Topic: Weather Station idea
Replies: 18
Views: 4964

Re: Weather Station idea

My weather station is recording data to the SD card every 10 minutes for more than 8 months now, accumulating over 10 MB or 400k lines of data, and still working flawlessly. So no worries here ;) For humidity I suggest RHT03 (or DHT22, same sensor), which is well documented on the forums. Here is t...
by frasmacon
Sun Mar 31, 2013 12:26 am
Forum: Automation, sensing and robotics
Topic: Weather Station idea
Replies: 18
Views: 4964

Re: Weather Station idea

OK, So so far I have achieved the following. Established most of the sensors I want to use (BMP085 for temp/pressure/altitude) Found out how I'm going to measure wind speed (3 cups that spin round and trigger a pulse, find wind speed with an equation I'll find later Measure wind direction with a 16 ...
by frasmacon
Sat Mar 30, 2013 10:16 pm
Forum: Automation, sensing and robotics
Topic: Weather Station idea
Replies: 18
Views: 4964

Re: Weather Station idea

I believe so to stop the battery being overdriven Gordon77 With some clever pre-thinking could you maybe rig it up in such a way in which it only just reaches maximum charge when the panel turns off. Or calculate how long it takes to charge the battery then disconnect the solar panel when it gets d...
by frasmacon
Sat Mar 30, 2013 9:27 pm
Forum: Automation, sensing and robotics
Topic: Weather Station idea
Replies: 18
Views: 4964

Re: Weather Station idea

It's helped a bit although it's really not suited to what I need.

Is a solar regulator really necessary?
by frasmacon
Sat Mar 30, 2013 9:16 pm
Forum: Automation, sensing and robotics
Topic: Weather Station idea
Replies: 18
Views: 4964

Re: Weather Station idea

I was then going to write a program that takes measurements from said sensors and records them in a file, probably on a USB stick or something to avoid too many writes to the SD card and breaking it (We're talking a write every 10 minutes for 7 days and I don't want to break the card). Hi I wouldn'...
by frasmacon
Sat Mar 30, 2013 8:27 pm
Forum: Automation, sensing and robotics
Topic: Weather Station idea
Replies: 18
Views: 4964

Re: Weather Station idea

For a direction, I was thinking of a wind vane connected to a rotary switch One way to do that, seeing as you will probably only need 16 directions, is to have a four-pole binary coded rotary switch. You could possibly make one by etching a pcb with a hole in the middle for the spindle and five spr...
by frasmacon
Sat Mar 30, 2013 7:17 pm
Forum: Automation, sensing and robotics
Topic: Weather Station idea
Replies: 18
Views: 4964

Re: Weather Station idea

Hi, To get started try a search on here with 'weather stations'. Heres' one result that may help http://www.raspberrypi.org/phpBB3/viewtopic.php?f=37&t=14777&p=318044&hilit=weather+station#p318044 Gordon77 So those Sint Wind Pi things are Pi powered weather stations? It's interesting but not really...

Go to advanced search