Go to advanced search

by danjperron
Fri Mar 22, 2019 10:38 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CS/CE with active high
Replies: 27
Views: 1254

Re: SPI CS/CE with active high

I got a 93C46B from microchip. it works but only on 16 bits. the org pin is N.A. The Holtek works fine but the map is split by MSB and LSB value. [email protected]:~ $ python3 write93C46.py Hello.dat From file Hello.dat to eerom. BitMasK= 32 addressRange= 6 size= 64 Writing eerom 000 : FEFF 0048 0065 006C 006C...
by danjperron
Fri Mar 22, 2019 10:58 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CS/CE with active high
Replies: 27
Views: 1254

Re: SPI CS/CE with active high

- do you have connected the unused pin 7 from the 93c46 to GND or is your open ? No I let it open. - from where are the hex values 0xFEFF comming at address 0x00 ? I understand that's a byte order mark. But is this only from your converting or will this value automatic set while the EEPROM write op...
by danjperron
Fri Mar 22, 2019 2:36 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CS/CE with active high
Replies: 27
Views: 1254

Re: SPI CS/CE with active high

Ok I tried my latest code with 8/16 bits capability. I had no problem at all. Both of my old Raspberry Pi model B are in use but my Pi model A was available! https://dl.dropboxusercontent.com/s/mnbx7ouyg30kicn/EEROM93C46_on_PIA.jpg I'm using 2K/3K3 on DO to reduce the 5V to 3.3V. I used the same col...
by danjperron
Thu Mar 21, 2019 2:53 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CS/CE with active high
Replies: 27
Views: 1254

Re: SPI CS/CE with active high

OK! you are using 16 bits. I'm using 8 bits ! you should split your 16 bits into two 8 bits. My ORG pin is at GND for 8 bits operation. I will have to check , on 16 bits, what is the memory bank behavior. I hope that 16 bits address 0 is 8 bits address 0(LSB) and 1 (MSB). Daniel Note to myself . I C...
by danjperron
Thu Mar 21, 2019 11:15 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CS/CE with active high
Replies: 27
Views: 1254

Re: SPI CS/CE with active high

In your screenshot it is good to see that your script begin the transfer with the bit combination 0110 (CS is high and the SK with rising edge). If I understand the Atmel guide correct the read operation should start with the bit sequense 110 (not with the first 0). You have to read between the lin...
by danjperron
Thu Mar 21, 2019 2:55 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CS/CE with active high
Replies: 27
Views: 1254

Re: SPI CS/CE with active high

Mario, I didn't check your python script yet but I had 2 errors on my post. #1 Error on Fritzing design. pin1 of 93CX6 needs to be on GPIO12 not on GND. (Correct in the python script). #2 Error on write93C56.py line 9 I should have used bracket and not parentheses. I was using the default file eerom...
by danjperron
Wed Mar 20, 2019 6:19 pm
Forum: Advanced users
Topic: Why is or are PCF857x IO expansion modules always low trigger for output?
Replies: 2
Views: 52

Re: Why is or are PCF857x IO expansion modules always low trigger for output?

Pcf8574 are kind of open collector output.

This allows the pins to be an input when the ouput is high because there is a small pullup current.


Use MCP23017 instead!
by danjperron
Mon Mar 18, 2019 7:54 pm
Forum: Troubleshooting
Topic: RFID-RC522
Replies: 2
Views: 49

Re: RFID-RC522

Tu peux essayer ma version. j'ai modifié la version pour utiliser spidev au lieu de SPI et python3. 1 - vérifie si le SPI est fonctionnel! sudo raspi-config , interface, SPI Tu peux vérifier avec la commande [email protected]:~ $ ls -l /dev/spi* crw-rw---- 1 root spi 153, 0 fév 9 22:29 /dev/spidev0.0 crw-rw...
by danjperron
Thu Mar 14, 2019 2:41 pm
Forum: Troubleshooting
Topic: Ultrasonic sensor stops working a few minutes later.
Replies: 2
Views: 51

Re: Ultrasonic sensor stops working a few minutes later.

No wonder.

You should put timeout in your loop


The Raspberry Pi is not a real time os. It could have execute another task and when it returns to continue this task it missed the pulse.
by danjperron
Tue Mar 05, 2019 7:12 pm
Forum: Python
Topic: ADC SAMPLE RATE
Replies: 20
Views: 585

Re: ADC SAMPLE RATE

Ok then try this

Code: Select all

cd /usr/local/lib/python3.5/dist-packages/adafruit_ads1x15
sudo nano ads1x115.py
change line 162 from time.sleep(0.01) to pass

Save and quit.
by danjperron
Tue Mar 05, 2019 6:04 pm
Forum: Python
Topic: ADC SAMPLE RATE
Replies: 20
Views: 585

Re: ADC SAMPLE RATE

Did you use sudo when you clone the git? Try sudo nano instead [email protected]:~ $ cd ~/Adafruit_CircuitPython_ADS1x15/adafruit_ads1x15/ [email protected]:~/Adafruit_CircuitPython_ADS1x15/adafruit_ads1x15 $ nano ads1x15.py change the line 161-162 for while not self._conversion_complete(): pass write and save! Then re-i...
by danjperron
Tue Mar 05, 2019 4:28 pm
Forum: Python
Topic: ADC SAMPLE RATE
Replies: 20
Views: 585

Re: ADC SAMPLE RATE

@ysmnyol

Did you modified the file ads1x15.py line 161 in the python library and reinstall the library ?

Did you check my last post explaining this?


If not then you are stuck because in the loop there is a time.sleep(0.01).
by danjperron
Mon Mar 04, 2019 2:55 am
Forum: Python
Topic: ADC SAMPLE RATE
Replies: 20
Views: 585

Re: ADC SAMPLE RATE

@ysmnyol the new library Adafruit_CircuitPython_ADS1x15 which is suppose to be better than the old one has a problem! if you look inside the python code you will see that the loop to check the end of conversion has a delay of 0.01 second. This means that the sample rate will be slower than 100 sampl...
by danjperron
Sun Mar 03, 2019 10:31 pm
Forum: Python
Topic: ADC SAMPLE RATE
Replies: 20
Views: 585

Re: ADC SAMPLE RATE

Thanks for your information, i did everthing you said but it's still too slow.

You know that printing the ADC value each time reduces the speed a lot.You have print() in your code!

you should store your data into an array without printing and see what is your sample rate.
by danjperron
Thu Feb 28, 2019 4:56 pm
Forum: HATs and other add-ons
Topic: ADS1115-ADC Module for Raspberry PI 3 B+
Replies: 5
Views: 208

Re: ADS1115-ADC Module for Raspberry PI 3 B+

Just to confirm; Since my source is mono (I only have two wires from the amp) I would use GND and AN0? Yes! and ground AN1 , AN2 and AN3. You won't be able to get higher the 430Hz in frequency. You need at least two samples per cycle. The Pi is not able to give you a constant sampling rate. It will...
by danjperron
Thu Feb 28, 2019 4:45 pm
Forum: Troubleshooting
Topic: MCP3008 only returns a 0 value when using gpiozero
Replies: 1
Views: 51

Re: MCP3008 only returns a 0 value when using gpiozero

A picture of your gig will help!

Did you enable the SPI ?
sudo raspi-config , interfacing options, SPI

Did you try adafruit library PI ?


https://github.com/adafruit/Adafruit_Python_MCP3008
by danjperron
Thu Feb 28, 2019 4:35 pm
Forum: Automation, sensing and robotics
Topic: Water Depth Sensing
Replies: 10
Views: 298

Re: Water Depth Sensing

Why not buying cheap fish sonar finder and figure out how to interface the transducer with the Pi.
by danjperron
Thu Feb 28, 2019 4:21 pm
Forum: HATs and other add-ons
Topic: ADS1115-ADC Module for Raspberry PI 3 B+
Replies: 5
Views: 208

Re: ADS1115-ADC Module for Raspberry PI 3 B+

The ADS1115 maximum sample rate is 860 samples per second.

For audio you need at least 40 000 samples per second for each channel.


The ADS115 has 4 analog inputs

you need to connect the ground and use AN0 and AN1 for left and right. Ground AN2 and AN3 if you don't used them!
by danjperron
Wed Feb 27, 2019 3:33 pm
Forum: Troubleshooting
Topic: Error to run MFRC522 library
Replies: 2
Views: 240

Re: Error to run MFRC522 library

You could try my modified version of the MFRC522-python library. I'm using spidev instead of spi library. I also change to code to read 7 and 10 bytes RFID Card. N.B. I removed the reset pins and the GPIO from the library. Don't connect the reset! It doesn't need to be connected. https://github.com/...
by danjperron
Wed Feb 27, 2019 3:24 pm
Forum: Français
Topic: Raspberry serial port connexion
Replies: 3
Views: 178

Re: Raspberry serial port connexion

Tu peux tout simplement utiliser "C" ou python avec pyserial pour communiquer avec le GPS. Mon GPS envoie d'une façon continue. Code en C https://www.dropbox.com/s/n036oi4jn9vy1s4/readGPS.c?dl=1 https://www.raspberrypi.org/forums/viewtopic.php?p=661794#p661794 Pour commencer install minicom et regar...
by danjperron
Tue Feb 26, 2019 4:32 pm
Forum: Python
Topic: ADC SAMPLE RATE
Replies: 20
Views: 585

Re: ADC SAMPLE RATE

# Create the ADC object using the I2C bus ads = ADS.ADS1115(i2c, gain=1, data_rate=860) The data_rate has to be one of these values. # Data sample rates _ADS1115_CONFIG_DR = { 8: 0x0000, 16: 0x0020, 32: 0x0040, 64: 0x0060, 128: 0x0080, 250: 0x00A0, 475: 0x00C0, 860: 0x00E0 } N.B. The gain could be ...
by danjperron
Mon Feb 25, 2019 6:29 pm
Forum: Troubleshooting
Topic: cron wont run from ~/newfolder but will~/ ?
Replies: 2
Views: 86

Re: cron wont run from ~/newfolder but will~/ ?

Could you try crontab in root. Don't put sudo in crontab


sudo crontab -e


* * * * * /usr/bin/python /home/pi/newfolder/scripts/script.py


also you should specify the full path for python.
by danjperron
Sun Feb 24, 2019 1:08 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Curious SPI behaviour with spidev-3.4
Replies: 5
Views: 688

Re: Curious SPI behaviour with spidev-3.4

Looking at your first chart of your scope and It was on my mind that the spike is a full SPI exchange. You only see a pike because your timing of your scope was way to slow. I checked the python library and there was no clock speed set then it was obvious that the SPI could be way too fast. A small ...

Go to advanced search