Go to advanced search

by StuartF
Sun Apr 07, 2019 5:09 pm
Forum: C/C++
Topic: Segmentation fault
Replies: 4
Views: 1660

Re: Segmentation fault

There are two check_button() functions being defined.
One is empty, just above 'void lcdcmd(unsigned int ch)'.

This may be the cause of the problem, however try using gdb to debug.
by StuartF
Fri Jan 25, 2019 7:10 pm
Forum: C/C++
Topic: hardware pwm without wiringpi or other libraries
Replies: 7
Views: 1267

Re: hardware pwm without wiringpi or other libraries

Start with

help> documentation > hardware > raspberrypi > bcm2835

and look at 'Peripheral specification' pdf.
Also refer to the errata as there are some errors in the PWM section.
by StuartF
Sat Jun 09, 2018 9:20 pm
Forum: C/C++
Topic: Writing data to BCM2835 - SPI
Replies: 24
Views: 3439

Re: Writing data to BCM2835 - SPI

SPI is a duplex operation. As you write data out on MOSI signal, data can come in on the MISO signal from the slave device. This TX & RX is using the same CLK. This CLK is generated by the master. To kick a slave into transmitting, you have to generate the CLK. This is done by 'writing' to the FIFO....
by StuartF
Sun May 20, 2018 3:13 pm
Forum: C/C++
Topic: Increase GPIO toggle frequency
Replies: 24
Views: 3624

Re: Increase GPIO toggle frequency

There is a problem in your initMapMem function. The second mmap() parameter is the page size for the map. You are passing 0x84 (132 ) as the value. This should be 4096. This is a fixed value, so you could use a constant, but you don't need to pass it. e.g. static uint32_t * initMapMem(int fd, uint32...
by StuartF
Sun May 20, 2018 2:29 pm
Forum: General discussion
Topic: repair raspberry pi 3 b
Replies: 34
Views: 4560

Re: repair raspberry pi 3 b

It could be that the LAN chip is faulty. Does it get hot?

Are you connecting USB devices directly into the pi or through a USB hub?

Does the yellow led come on if you connect the network cable?
by StuartF
Wed Apr 04, 2018 6:00 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: 6N138 UART 3.3 to 5v unidirectionnal level shifter
Replies: 1
Views: 299

Re: 6N138 UART 3.3 to 5v unidirectionnal level shifter

Midi out does not require opto-isolation, only midi in.
So a transistor or mofet acting as a switch will do the conversion.
by StuartF
Wed Jun 28, 2017 2:48 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread.
Replies: 926
Views: 479327

Re: The I2S sound thread.

So DIVI = 177 and DIVF = 0.1541195011 * 1024 = 157.8183... I "rounded" it at 158.
This is incorrect. This should be 4096. Although it says 1024 in the PCMCLK datasheet, it has been corrected
in the forums and is mentioned in the example source code.
by StuartF
Tue Jun 27, 2017 6:17 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread.
Replies: 926
Views: 479327

Re: The I2S sound thread.

I'll reply in this thread as it is more relevant. From the other thread.. I set MASH 1 , DIVI = 177 , DIVF = 158 This is for 44100 @ 32 bit stereo? You have the correct DIVI, but the DIVF is not correct. How are you working DIVF out? By my calc, DIVF should be 681 ( although it falls on an edge case...
by StuartF
Sun Jun 18, 2017 2:57 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Sending TTL pulse from Arduino to Raspberry Pi
Replies: 6
Views: 1462

Re: Sending TTL pulse from Arduino to Raspberry Pi

Depending on which i/o you are using as an input, it could be an internal pull-up is active.
This would act as a voltage divider.
Try to get it working with just one Pi first, then add the others once debugged.
by StuartF
Sat Jun 17, 2017 8:56 pm
Forum: General discussion
Topic: OLED 16x2 HD44780 woes
Replies: 27
Views: 14485

Re: OLED 16x2 HD44780 woes

But the WS0010 controller is not 100% compatible with the HD44780 It is compatible, but the "usual practice" of wiring the LCD module to be write only causes the problems with this chipset. I have not looked into the I2C_LCD_driver module, but it may have a read function. Failing that, assume that ...
by StuartF
Sat Jun 17, 2017 2:06 pm
Forum: General discussion
Topic: OLED 16x2 HD44780 woes
Replies: 27
Views: 14485

Re: OLED 16x2 HD44780 woes

I have had experience of this chipset. There is a small but critical difference. To quote from the datasheet BUSY FLAG (BF) The Busy Flag is used to determine whether WS0010 is idle or internally operating. When WS0010 is performing some internal operations, the Busy Flag is set to "1". Under this c...
by StuartF
Sun May 07, 2017 2:27 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Strange Chips and an RPi
Replies: 4
Views: 1145

Re: Strange Chips and an RPi

They are cmos 256K x 4bit dynamic ram.
The datasheet is out there, you may want to try another search engine ( that doesn't track you). Search for '514256 datasheet'.
by StuartF
Sat Apr 29, 2017 11:19 pm
Forum: C/C++
Topic: LonRun : thread hang and not responding in raspberry pi 3
Replies: 6
Views: 982

Re: LonRun : thread hang and not responding in raspberry pi

There is a return NULL in the adc function that may be causing the problem. Also, when you check for fp == NULL, it may be wise to use an else condition for the output. e.g. if( fp == NULL ) { <fail message> } else { <write to fp> <close fp> } Another suggestion would be to have the thread function ...
by StuartF
Mon Sep 26, 2016 2:05 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: soft SPI works but hard dont?RPI3
Replies: 7
Views: 1638

Re: soft SPI works but hard dont?RPI3

In your spiTransfer function, try adding

Code: Select all

.cs_change = 0
.pad = 0
to struct spi_ioc_transfer tr .
by StuartF
Fri Jan 22, 2016 1:26 pm
Forum: C/C++
Topic: Serial device reads CR and overwrites data
Replies: 1
Views: 446

Re: Serial device reads CR and overwrites data

You will need to set the termios options.

Code: Select all

tcsetattr( fd, TCSANOW, &options );
by StuartF
Mon Jan 11, 2016 11:46 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI connection between RPi and atmega32
Replies: 2
Views: 909

Re: SPI connection between RPi and atmega32

You seem to be missing a few settings in the rpi code. Add these global vars uint8_t bitsPerWord = 8; uint8_t spiMode = SPI_MODE_0; In main() add ioctl( fd, SPI_IOC_WR_MODE, &spiMode ); ioctl( fd, SPI_IOC_WR_BITS_PER_WORD, &bitsPerWord ); In your atmega code you pause 10ms (milli). In your rpi code ...
by StuartF
Thu Jan 07, 2016 7:39 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: RPi2 UART Baud Rate
Replies: 28
Views: 9806

Re: RPi2 UART Baud Rate

Sorry about that.

Code: Select all

#define BLOCK_SIZE		4096
by StuartF
Wed Jan 06, 2016 9:56 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: RPi2 UART Baud Rate
Replies: 28
Views: 9806

Re: RPi2 UART Baud Rate

This has worked for me using the standard bcm2709.uart_clock=3000000 clock setting in cmdline.txt with the ttyAMA0 default removed. It uses mmap to directly set the PL011 registers according to the ARM datasheet. The datasheet can be found here. http://infocenter.arm.com/help/topic/com.arm.doc.ddi01...
by StuartF
Wed Sep 30, 2015 6:25 pm
Forum: Raspbian
Topic: STICKY: Jessie (now defunct and replaced with Stretch) Q&A
Replies: 396
Views: 212925

Re: Jessie Q&A

can't help with 2 or 3 but for setting the number of desktops try editing
/home/pi/.config/openbox/lxde-pi-rc.xml
find <desktops> and then <number>
change this to the number of desktops required
save
reboot or go cli and startx.
by StuartF
Sun Jul 12, 2015 1:18 pm
Forum: Advanced users
Topic: Linux kernel is now 4.0
Replies: 182
Views: 94384

Re: Linux kernel is now 4.0

PhilE wrote:Delete the dt-blob.bin. It doesn't have the sections needed by the new firmware.
That sorted it.
Thanks for the help.
by StuartF
Sat Jul 11, 2015 10:05 pm
Forum: Advanced users
Topic: Linux kernel is now 4.0
Replies: 182
Views: 94384

Re: Linux kernel is now 4.0

Did rpi-update complete without errors? Yes. Could the sdcard have been full? reporting 3.8gig free.. Can you ssh in? no, due to turning it off in config. I have put the sd card into another pi and found that '/dev' now only contains 3 folders. These are fd, pts and shm. I don't see any mmcblk0p* d...
by StuartF
Sat Jul 11, 2015 4:27 pm
Forum: Advanced users
Topic: Linux kernel is now 4.0
Replies: 182
Views: 94384

Re: Linux kernel is now 4.0

I have upgraded to 4.0.7-v7+ #802 on a 2B and get 'error opening '/dev/input/event*' during boot.
The power to the USB sockets is 'missing' and I can't type anything.

Any clues as to resolving this or did I bork it?
by StuartF
Tue Apr 07, 2015 6:18 pm
Forum: C/C++
Topic: Solid 31250 UART Midi
Replies: 6
Views: 1821

Re: Solid 31250 UART Midi

This thread was about a solution to a known problem. i.e. setting a 31250 baud rate for old style 5 pin DIN midi using mmap in C. It was dormant for about a month. Now it has been turned into a rant concerning your opinion of what consitutes 'theory'. I would expect better of someone who carries the...

Go to advanced search