Go to advanced search

by Infraviolet
Mon Feb 17, 2020 7:40 pm
Forum: C/C++
Topic: Reading pi's hostname from a C program
Replies: 4
Views: 1068

Re: Reading pi's hostname from a C program

Thanks, much easier that I expected it to be.
by Infraviolet
Sun Feb 16, 2020 8:27 pm
Forum: C/C++
Topic: Reading pi's hostname from a C program
Replies: 4
Views: 1068

Reading pi's hostname from a C program

I've got a C program running on a pi, it needs to be able to use some sort of C system() like function call to run some script in the terminal which somehow returns the hostname of the pi to it. I need to do this as I'm writing a program once which will run on several different raspberry pis, upon s...
by Infraviolet
Sun Jun 09, 2019 10:11 pm
Forum: Troubleshooting
Topic: espeak and aplay broken
Replies: 9
Views: 7640

Re: espeak and aplay broken

Does this mean I should roll back the kernel then? I've done it once or twice on an x86 linux PC but how is that done on a pi? Thanks P.S. just checked and on the good Sd card I'm running "Linux raspberrypi 4.14.70-v7+ #1144 SMP Tue Sep 18 17:34:46 BST 2018 armv7l GNU/Linux" according to u...
by Infraviolet
Sun Jun 09, 2019 7:11 pm
Forum: Troubleshooting
Topic: espeak and aplay broken
Replies: 9
Views: 7640

espeak and aplay broken

I've been using espeak as a speech synthesizer in a project on a pi. I've now gone and flashed a new microSD card to use in another project and have tried to set it up the same as the old microSD card, but espeak is refusing to work, and aplay is cutting off just after the "cen" of "c...
by Infraviolet
Mon May 27, 2019 10:51 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Proper way to toggle I2C SCL, as output or as input with PUD?
Replies: 3
Views: 1865

Re: Proper way to toggle I2C SCL, as output or as input with PUD?

When the Pi operates the SCL line normally how does it do it? As a high or low impedance input or output pin? Like you've described (my option 2) or by some other scheme? This method isn't completely non standard, it is mentioned as acommon way to clear an I2C bus when a slave gets stuck low due to,...
by Infraviolet
Mon May 27, 2019 3:38 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Proper way to toggle I2C SCL, as output or as input with PUD?
Replies: 3
Views: 1865

Proper way to toggle I2C SCL, as output or as input with PUD?

I've found that when a slave device has SDA stuck low a series of between 9 and 16 toggles of the SCL pin fixes the problem. I've done this in a brief test but wanted to check, before I use this method longer term, the correct way to do this. That is to say, whether the toggling should be done by tu...
by Infraviolet
Tue May 21, 2019 7:18 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Shutting down and STAYING shut down
Replies: 10
Views: 3511

Re: Shutting down and STAYING shut down

Physical pin 5 is being used for i2c to a bunch of slaves. The slaves stay turned on until the whole system is shut off when the relay is turned off. I have got some pullup resistors on this pin, and the slaves should in theory not pull low when the master is not i2cing them. So I would not expect p...
by Infraviolet
Tue May 21, 2019 7:13 pm
Forum: C/C++
Topic: BCM2835 library, I'm after 1 to 20 microsecond delays but needn't be very accurate
Replies: 7
Views: 2688

Re: BCM2835 library, I'm after 1 to 20 microsecond delays but needn't be very accurate

I did some further tests and found that while the bcm2835 library says a 0 delay results in 80ms I ran some tests under light and medium CPU loads, my whole chain of pulses was, according to an oscilloscope, able to, with bit banging and no need for SPI, complete in under 200ms. I used bcm2835_delay...
by Infraviolet
Fri May 17, 2019 6:15 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: BCM2835 library slower I2C
Replies: 1
Views: 619

BCM2835 library slower I2C

Is there a way to get slower I2C that 100KHz. I'd like to try at 50KHz or so instead. I've got an I2C slave which I think tries to clock stretch when at 100KHz, but the Pi is well known for having a bug in it's ability to cope with clock stretches by slaves. I'd like to try slower I2C and see if it ...
by Infraviolet
Wed May 15, 2019 10:18 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Shutting down and STAYING shut down
Replies: 10
Views: 3511

Re: Shutting down and STAYING shut down

That code is pretty much what mine does, but somehow the Pi starts to power up again during the "delay xx seconds/minutes (raspberry full shutdown time)" part. The pi begins powering down as soon as the previous line, "digitalWrite(GPIO_Y, LOW); // start shutdown command in raspberry&...
by Infraviolet
Wed May 08, 2019 1:18 am
Forum: C/C++
Topic: BCM2835 library, I'm after 1 to 20 microsecond delays but needn't be very accurate
Replies: 7
Views: 2688

Re: BCM2835 library, I'm after 1 to 20 microsecond delays but needn't be very accurate

Are you saying to try using Pi pin (physical pin layout) 23 as SHCP and pin 19 as the SERIAL line to the shift register which is acting as my extra outputs? The use any spare GPIOs as the latch control, so I can twiddle the latch control GPIO as a bit bang, then send as many bytes worth of SPI as ne...
by Infraviolet
Wed May 08, 2019 12:59 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Shutting down and STAYING shut down
Replies: 10
Views: 3511

Re: Shutting down and STAYING shut down

Thanks for the link, I can make much mroe sense of your flowchart when I see the rest of your system's details. The more I think about it the more your system sounds exactly like what mine is. The real difference I see is only in the turning on phase, you have a deliberate delay after pressing the &...
by Infraviolet
Mon May 06, 2019 3:18 pm
Forum: C/C++
Topic: BCM2835 library, I'm after 1 to 20 microsecond delays but needn't be very accurate
Replies: 7
Views: 2688

Re: BCM2835 library, I'm after 1 to 20 microsecond delays but needn't be very accurate

The shift registers I write to aren't SPI devices. They don't have MISO, MOSI,CSEL... pins. They just have a serial in pin, a clock pin and an enable pin. They take data according to the attacehd timing diagram. They work well with bit banging but right now my bangs are based on a minimum timeable i...
by Infraviolet
Mon May 06, 2019 3:12 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Shutting down and STAYING shut down
Replies: 10
Views: 3511

Re: Shutting down and STAYING shut down

Unless you're describing something different I already have an element in my design where my microcontroller cuts off power to the pi after a delay period. But as the Pi's shutdown time can vary, and as can things coming after the "shutdown" button press but before the countdown begins, th...
by Infraviolet
Sun May 05, 2019 10:42 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Shutting down and STAYING shut down
Replies: 10
Views: 3511

Re: Shutting down and STAYING shut down

Could you just explain in text the meaning of your flowchart, your terminology on it "acc" and other such things is very different to mine, can you define briefly what those labels on your diagram mean in the context of the system components I have described. For clarity, I power my Pi off...
by Infraviolet
Sun May 05, 2019 10:35 pm
Forum: C/C++
Topic: BCM2835 library, I'm after 1 to 20 microsecond delays but needn't be very accurate
Replies: 7
Views: 2688

BCM2835 library, I'm after 1 to 20 microsecond delays but needn't be very accurate

I'm running a collection of shift register from a pi. I need to clock data into them and want to get this whole operation done in less than a millisecond. I don't need great accuracy but need to have delays atleast 1uS long and ideally less than 10uS long, less than 10uS long is pretty essential. I ...
by Infraviolet
Sun May 05, 2019 2:39 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Shutting down and STAYING shut down
Replies: 10
Views: 3511

Shutting down and STAYING shut down

I'm using a Pi zero attached to a custom PCB as part of a large project. The custom PCB has a "shut down" button on it and a "startup" button. The startup button temporarily enables a "relay"* while it is held down, during this time an ATMEGA328P microcontroller (almost...
by Infraviolet
Sat Feb 23, 2019 7:03 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Physical pins 27 and 28 as GPIO inputs/outputs? What about 8 and 10??
Replies: 2
Views: 1903

Physical pins 27 and 28 as GPIO inputs/outputs? What about 8 and 10??

Note that throughout the following post I make use of physical pin numbers on the header of a Pi 3/zero or zero W. Ok, so for various reasons I've got a project which has ended up using pretty much every GPIO pin of a pi zero W as either an input or an output. I'm using I2C from pins 3 and 5 to cont...
by Infraviolet
Sat Feb 23, 2019 6:44 pm
Forum: Automation, sensing and robotics
Topic: Robot with Arduino and RPi3
Replies: 1
Views: 773

Re: Robot with Arduino and RPi3

The arduino will need to be controlled from the pi via something like I2C, UART, 2 wire serial or another wired protocol. The pi will be the thing to run the fancy software and do the wifi while the arduino is best used for fast realtime control of actuators and sensors (such as the pi tells the ard...
by Infraviolet
Sat Feb 23, 2019 6:37 pm
Forum: Automation, sensing and robotics
Topic: Choosing motors
Replies: 36
Views: 11190

Re: Choosing motors

Post #2, stepper motors with gearboxes for £1.54? How physically small, how much torque possible from them? I'd be interested to know for future projects of my own.
by Infraviolet
Thu Jan 31, 2019 2:39 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Sending all GPIO pins low at boot
Replies: 4
Views: 9922

Re: Sending all GPIO pins low at boot

6by9, you're talking GPIO numbering scheme there, not physical? Hence you mean physical pins at positions 27,28,3,5,7,29,31,26,24 ? Burngate, thanks for the tip about the size of the internal pullups, as luck has it, (if my assumption that 6by9 was quoting GPIO numbers and they correctly map on a Pi...
by Infraviolet
Wed Jan 30, 2019 11:03 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Sending all GPIO pins low at boot
Replies: 4
Views: 9922

Sending all GPIO pins low at boot

Ok, so I'm using a Pi Zero W in a project where pretty mch every GPIO pin is in use. Obviously there are the 5v and 3v3 pins whih are always at the relevant high voltages, and the i2c pins (I tnd to work by physical pjn umbers so these are 3 and 5 by the numbering scheme I work to). I'm using the BC...

Go to advanced search