Go to advanced search

by photomankc
Thu Sep 20, 2018 5:55 pm
Forum: C/C++
Topic: Tearing My Hair Out Over Signals...
Replies: 4
Views: 1962

Re: Tearing My Hair Out Over Signals...

I see this is quite old but in case it's still an issue: I'm not an expert and I'm having a hard time following what all you have going on in those snips but this is code that is working for me for signals: "g_*" are global variables. #define SIGNAL_NONE 0 #define SIGNAL_USR1 1 #define SIGNAL_USR2 2...
by photomankc
Thu Sep 20, 2018 2:54 pm
Forum: C/C++
Topic: Anyway to know if poweroff has been called?
Replies: 2
Views: 1235

Re: Anyway to know if poweroff has been called?

That looks promising actually. Thanks! :D
by photomankc
Thu Sep 20, 2018 2:49 pm
Forum: C/C++
Topic: wiringPiISR switch bounce
Replies: 7
Views: 2598

Re: wiringPiISR switch bounce

I agree, hardware is good if there is room but I know most developers are going to go with software, it's more flexible and it's not terribly taxing. I know a number of proponents of hardware that have conceded that software debounce is fine. On the loop, I was under the impression that the ISR woul...
by photomankc
Thu Sep 13, 2018 7:03 pm
Forum: C/C++
Topic: Anyway to know if poweroff has been called?
Replies: 2
Views: 1235

Anyway to know if poweroff has been called?

Hey all, I'm working on software to work with my own external pushbutton power switch. I have the basic code running and working. It processes a button press signal from the external microcontroller, and sends a signal to power off to that MCU when I'm ready to shutdown. The MCU gives me 18 seconds ...
by photomankc
Thu Sep 13, 2018 2:13 am
Forum: C/C++
Topic: wiringPiISR switch bounce
Replies: 7
Views: 2598

Re: wiringPiISR switch bounce

I can't say that's wrong and if I were going to make a product to go out the door and the part count and cost allowed it I'd say that's better and cleaner software-wise. In my experience in a hobby environment where you have a range of hardware being attached it's not always so easy to debounce ther...
by photomankc
Wed Sep 12, 2018 9:23 pm
Forum: C/C++
Topic: wiringPiISR switch bounce
Replies: 7
Views: 2598

Re: wiringPiISR switch bounce

So one of my favorite debounce methods goes like this. In the ISR (which is just a thread as I understand it so no need to worry about being as fast as possible) you use say an 8bit integer as a kind of stream input and define a bit pattern that represents the edge you want. So for a clean/sustained...
by photomankc
Thu Sep 08, 2016 2:19 pm
Forum: C/C++
Topic: Qt with Wiring PI
Replies: 26
Views: 32126

Re: Qt with Wiring PI

Yes, it is a fatal error to call wiringPiSetup() more than once in a program. You need to move the setup call to outside your main loop. The reason is that I'm fed-up with people emailing me telling me wiringPi is broken when they repeatedly call the setup code in a loop and their program subsequen...
by photomankc
Mon Aug 22, 2016 3:14 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: LCD 4x20 I2C line problem
Replies: 7
Views: 1563

Re: LCD 4x20 I2C line problem

That makes some sense I suppose. Thanks for the explanation!
by photomankc
Mon Aug 22, 2016 3:14 am
Forum: Automation, sensing and robotics
Topic: mcp23017 : wiring without resistors for inputs (buttons) ?
Replies: 9
Views: 3642

Re: mcp23017 : wiring without resistors for inputs (buttons

Yes, you can google "wetting current" and get several good explanations of it. There are oxide layers on the contacts (or that will develop over time) that impede current flow. Enough current needs to flow through the switch when it is pressed to overcome that. The only current that flows through th...
by photomankc
Fri Aug 19, 2016 8:40 pm
Forum: Automation, sensing and robotics
Topic: mcp23017 : wiring without resistors for inputs (buttons) ?
Replies: 9
Views: 3642

Re: mcp23017 : wiring without resistors for inputs (buttons

Looks like you can use the provided wiringPi extensions to access the MCP23017 I/O extender as just more wiringPi pins. look into mcp23017Setup(). That will then let you use digitalRead(), digitalWrite() and pullUpDownControl() to manage that. 100K pull-ups are probably enough to test with just to s...
by photomankc
Mon Aug 15, 2016 2:59 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: LCD 4x20 I2C line problem
Replies: 7
Views: 1563

Re: LCD 4x20 I2C line problem

Off topic a bit, but does anyone know how that... um... interesting scheme came about? 1,3,2,4. It makes everything about positioning text more difficult to deal with as well as any notion of scrolling. It's hard to imagine a worse way to order things from a users point of view. Is it a hold-over or...
by photomankc
Mon Aug 15, 2016 2:18 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Raspberry Pi as I2C slave?
Replies: 10
Views: 6330

Re: Raspberry Pi as I2C slave?

So as a simple example of something possible. Here is my C++ GPIO_Group wrapper object using wiringPi functions to drive outputs as a 4 bit bus with a data clock when all bits have a valid state. Its sending 128 4-bit counts. That's 64 bytes. It takes 320us to send that. The period of the clock work...
by photomankc
Fri Aug 05, 2016 2:22 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Raspberry Pi as I2C slave?
Replies: 10
Views: 6330

Re: Raspberry Pi as I2C slave?

Sometimes you have to look for new cat-skinning processes. Many libraries are deficient in support for I2C multi-master operation. Even if one device supports it, the other may not. How much GPIO do you have open on the two? Could use 5 lines to create a 4 bit bus. The 5th line acting a little like ...
by photomankc
Thu Aug 04, 2016 7:46 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: GPIO Pin States a Boot time - Change in 3.6.11+
Replies: 17
Views: 39610

Re: GPIO Pin States a Boot time - Change in 3.6.11+

This is good reason to use a buffer with an OE (output enable) line in real-world interfacing. I ran into this in another project on a different SBC and narrowly missed a direct high-low contention issue that would have likely done some damage. I really like using 74VHC244's in this role. They can t...
by photomankc
Wed Jul 27, 2016 1:36 pm
Forum: Device Tree
Topic: kernel panic with dtoverlay=gpio-poweroff
Replies: 2
Views: 2392

Re: kernel panic with dtoverlay=gpio-poweroff

I suppose the fact that the kernel panics would be the problem. I doubt that is supposed to be the way the kernel exits on shutdown.
by photomankc
Thu Mar 03, 2016 8:41 pm
Forum: C/C++
Topic: New C++14 GPIO library CppGPIO
Replies: 15
Views: 3644

Re: New C++14 GPIO library CppGPIO

Man, talk about great timing! I was just heading down the road of doing this using wiringPi but this may be a better fit. Nice work!
by photomankc
Tue Apr 30, 2013 2:42 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Multi-process access to I2C
Replies: 2
Views: 1715

Re: Multi-process access to I2C

Ok so it's safe in the middle of a transaction which is probably enough for most situations. The other question is if the device file is open in process, can another process open it as well?
by photomankc
Mon Apr 29, 2013 6:14 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Multi-process access to I2C
Replies: 2
Views: 1715

Multi-process access to I2C

If you have two processes that each will access slaves on I2C does the kernel file driver provide any locking/safety for that situation? So say process A has opened bus 0 and is in the process of reading data, can process B end up stomping on the top of that and open the bus to start writing it's da...
by photomankc
Mon Apr 29, 2013 6:02 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Multiple I2C slaves disapear
Replies: 4
Views: 1761

Re: Multiple I2C slaves disapear

Bus speed has to be whatever the SLOWEST device on the bus can use. Because they are all always listening they all have to be able to correctly identify start / stop / and address data at all times.
by photomankc
Thu Apr 25, 2013 2:42 pm
Forum: General discussion
Topic: Raspberry Pi vs. Beagle Bone Black
Replies: 177
Views: 72368

Re: Raspberry Pi vs. Beagle Bone Black

I meant that the Pi has component out as well as HDMI and the BBB has only HDMI. Having expansion headers for an external LCD is not the same (in my book) as having an easy component output for any off-the shelf consumer TV monitor. Doesn't the Pi have composite? Component uses several wires I thou...
by photomankc
Thu Apr 25, 2013 1:46 pm
Forum: General discussion
Topic: Raspberry Pi vs. Beagle Bone Black
Replies: 177
Views: 72368

Re: Raspberry Pi vs. Beagle Bone Black

plugwash wrote:
photomankc wrote: So going back to the OP's question here's my interpretation based on the pre-shipping info
Reasonable summary but a few minor corrections (my edits are in bold)
I like your edits and additions.
by photomankc
Thu Apr 25, 2013 1:43 pm
Forum: General discussion
Topic: Raspberry Pi vs. Beagle Bone Black
Replies: 177
Views: 72368

Re: Raspberry Pi vs. Beagle Bone Black

by "hdmi only for video" i assume you mean that's the only video output, and you don't mean it only carries video and not sound, as i doubt that is correct, especially as there is no other sound output. Whichever one he means it seems he is wrong, sound is supported on HDMI according to the system ...
by photomankc
Thu Apr 25, 2013 5:32 am
Forum: General discussion
Topic: Raspberry Pi vs. Beagle Bone Black
Replies: 177
Views: 72368

Re: Raspberry Pi vs. Beagle Bone Black

Wow.... that's, that is an impressive wall of text. So going back to the OP's question here's my interpretation based on the pre-shipping info BeagleBone Black Pros: -More GPIO -Onboard ADC -Full Power for USB device -On-Board boot media -Power Control Built In -Network over USB -Faster processor wi...

Go to advanced search