Go to advanced search

by texy
Tue Oct 09, 2012 5:53 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

... for pin in [DIN, SCLK, DC, RST, SCE]: wiringpi.pinMode(pin, ON) wiringpi.pinMode(LED,2) wiringpi.pwmWrite(LED,128) def SPI(value): # data = DIN # clock = SCLK # MSB first for i in reversed(xrange(8)): wiringpi.digitalWrite(DIN, (value >> i) & 1) wiringpi.digitalWrite(SCLK, ...
by SAA
Wed Sep 26, 2012 12:30 am
Forum: Python
Topic: Control GPIO with iPhone / iPad
Replies: 2
Views: 3219

Control GPIO with iPhone / iPad

... python script to create sockets and the RPi.GPIO library to control the pins and interfaces with my iPhone/iPad app. Im hoping to get i2C and SPI working soon and have it send back data to the iDevice.
by c g
Sun Sep 23, 2012 1:06 pm
Forum: Python
Topic: spidev config
Replies: 7
Views: 2962

Re: spidev config

The SPI controllers support bit lengths up to 32 bit ( http://www.raspberrypi.org/wp-content/u ... herals.pdf ).

I'd assume it's just a limitation of the driver, but you better ask Chris Boot ( http://www.bootc.net ), he's the developer.
by devnull
Sun Sep 23, 2012 12:20 pm
Forum: Python
Topic: spidev config
Replies: 7
Views: 2962

Re: spidev config

Thanks very much, that's very helpful. But I wonder if the developer has hard-coded the SPI to only run in 8 bit mode because of hardware limitation, or because that's what he felt most systems would use ? How would I found out whether this is a limitation of the hardware ...
by c g
Sun Sep 23, 2012 12:04 pm
Forum: Python
Topic: spidev config
Replies: 7
Views: 2962

Re: spidev config

BCM2708 is the family, BMC2835 is the specific implementation of the SoC that is used here. Have a look into the sources of the kernel's SPI driver at https://github.com/raspberrypi/linux/blob/rpi-3.2.27/drivers/spi/spi-bcm2708.c#L238 I might be mistaken, but to me this looks like that you ...
by c g
Sun Sep 23, 2012 11:16 am
Forum: Python
Topic: spidev config
Replies: 7
Views: 2962

Re: spidev config

According to the sources of the spi_bcm2708 module, 9 bits per word is not supported.
by devnull
Sun Sep 23, 2012 12:09 am
Forum: Python
Topic: spidev config
Replies: 7
Views: 2962

spidev config - Kernel Panic

OK, seems like sending data with bit size other than 8 (the default) results in a kernel panic. Here's the dump: [ 92.076174] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 92.183061] pgd = c0004000 [ 92.224491] [00000000] *pgd=00000000 [ 92.276552] Internal error: Oo...
by devnull
Sat Sep 22, 2012 12:51 pm
Forum: Python
Topic: spidev config
Replies: 7
Views: 2962

spidev config

... I have now reverted to spidev to get better performance rather than bit bashing. But I need to operate in 9 bit mode, and as soon as I change the SPI port to 9 bit using the bpw attribute and then send the writebytes() function, it crashes / hangs the entire system. I am assuming that writebytes() ...
by devnull
Fri Sep 21, 2012 11:24 am
Forum: Python
Topic: Nokia Colour Display
Replies: 4
Views: 2356

Nokia Colour Display

... an old breakout board I bought from sparkfun several years ago (they have since revised the design). This is a great little display, it uses 9 Bit SPI and is supplied with 2 different chipsets, one from EPSON and the other from Philips, the chipset I have is Epson, but it would not take much to ...
by SiriusHardware
Sun Sep 16, 2012 10:00 am
Forum: Python
Topic: Write a niibble or byte to GPIO
Replies: 23
Views: 11598

Re: Write a niibble or byte to GPIO

... the bus concept - but then I suppose it could be argued that if you want to talk to something else these days you are more likely to do it via SPI or I2C or USB. However, there are still plenty of useful devices around which communicate via a parallel bus, and the lack of a 'clean' 8-bit user ...
by timhoffman
Mon Sep 03, 2012 11:30 am
Forum: Python
Topic: modprobe command from within python
Replies: 5
Views: 4412

Re: modprobe command from within python

There is a python-kmod wrapper for kmod access. You need to get it from here https://github.com/agrover/python-kmod You will need to install libkmod-dev (sudo apt-get install libkmod-dev) (and possibly do a sudo apt-get update, if you haven't updated your raspbian package sources lately). The just f...
by Boezelman
Wed Aug 29, 2012 6:50 pm
Forum: Python
Topic: [GPIO] Combining 2 different codes in to 1 program
Replies: 17
Views: 4189

Re: [GPIO] Combining 2 different codes in to 1 program

... for char in text: if char == '\n': self.cmd(0xC0) # next line else: self.cmd(ord(char),True) GPIO.setmode(GPIO.BCM) DEBUG = 1 LOGGER = 1 # read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7) def readadc(adcnum, clockpin, mosipin, misopin, cspin): if ((adcnum > 7) or (adcnum < 0)): return ...
by Grumpy Mike
Mon Aug 20, 2012 10:17 pm
Forum: Python
Topic: [GPIO] Combining 2 different codes in to 1 program
Replies: 17
Views: 4189

Re: [GPIO] Combining 2 different codes in to 1 program

The purple ones are dedicated to SPI. No they are not. You are free to use them how you want BUT if you choose one of the alternative functions one of these alternative functions are SPI. All pins are GPIO pins first and specialised functions ...
by texy
Sat Aug 18, 2012 4:22 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

... # extended mode lcd_cmd(0x14) # bias lcd_cmd(contrast) # vop lcd_cmd(0x20) # basic mode lcd_cmd(0xc) # non-inverted display cls() def SPI(c): # data = DIN # clock = SCLK # MSB first # value = c for i in xrange(8): wiringpi.digitalWrite(DIN,((c & (1 << (7-i))) > 0)) wiringpi.digitalWrite(SCLK, ...
by Boezelman
Wed Aug 15, 2012 8:00 pm
Forum: Python
Topic: [GPIO] Combining 2 different codes in to 1 program
Replies: 17
Views: 4189

Re: [GPIO] Combining 2 different codes in to 1 program

... GPIO.output(LCD_E, True) time.sleep(E_PULSE) GPIO.output(LCD_E, False) time.sleep(E_DELAY) GPIO.setmode(GPIO.BCM) DEBUG = 1 LOGGER = 1 # read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7) def readadc(adcnum, clockpin, mosipin, misopin, cspin): if ((adcnum > 7) or (adcnum < 0)): return ...
by joan
Wed Aug 15, 2012 7:13 pm
Forum: Python
Topic: [GPIO] Combining 2 different codes in to 1 program
Replies: 17
Views: 4189

Re: [GPIO] Combining 2 different codes in to 1 program

I think the edit button appears in the same place as "report this post" etc. See the FAQ for details. http://www.raspberrypi.org/phpBB3/faq.php#f2r1

Check here for the pins to use. The green ones are general, undedicated, pins to use as you wish. The purple ones are dedicated to SPI.
by joan
Wed Aug 15, 2012 1:00 pm
Forum: Python
Topic: [GPIO] Combining 2 different codes in to 1 program
Replies: 17
Views: 4189

Re: [GPIO] Combining 2 different codes in to 1 program

... for char in text: if char == '\n': self.cmd(0xC0) # next line else: self.cmd(ord(char),True) GPIO.setmode(GPIO.BCM) DEBUG = 1 LOGGER = 1 # read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7) def readadc(adcnum, clockpin, mosipin, misopin, cspin): if ((adcnum > 7) or (adcnum < 0)): return ...
by Boezelman
Wed Aug 15, 2012 11:11 am
Forum: Python
Topic: [GPIO] Combining 2 different codes in to 1 program
Replies: 17
Views: 4189

[GPIO] Combining 2 different codes in to 1 program

... a website fot datalogging) #!/usr/bin/env python import time import os import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) DEBUG = 1 LOGGER = 1 # read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7) def readadc(adcnum, clockpin, mosipin, misopin, cspin): if ((adcnum > 7) or (adcnum < 0)): return ...
by POSitality
Sat Aug 11, 2012 8:38 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

... side of the display to get user responses. Bit like the buttons at the side of hole-in-the wall machines. This is why I asked if the RPi's 'real' SPI output is easy to program as they'll be more GPIO lines left. Ofc... I need to sober up a bit first! Maybe tomorrow :) Regards, Andy
by BlackJack
Fri Aug 10, 2012 11:09 am
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

... # Set pin directions. wiringpi.wiringPiSetup() wiringpi.wiringPiGpioMode(ON) for pin in [DIN, SCLK, DC, RST, LED]: wiringpi.pinMode(pin, ON) def SPI(value): # data = DIN # clock = SCLK # MSB first for i in reversed(xrange(8)): wiringpi.digitalWrite(DIN, (value >> i) & 1) wiringpi.digitalWrite(SCLK, ...
by texy
Fri Aug 10, 2012 6:20 am
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

... set up an extra GPIO line I guess, maybe if you wanted two or three of these running (dunno how many lines we have left!) BTW... we are emulating SPI via the GPIO lines on the RPi. Is this stuff easier or harder using the RPi's own SPI outputs? Onto the fun times! I erm... couldn't be bothered ...
by POSitality
Fri Aug 10, 2012 12:20 am
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

... set up an extra GPIO line I guess, maybe if you wanted two or three of these running (dunno how many lines we have left!) BTW... we are emulating SPI via the GPIO lines on the RPi. Is this stuff easier or harder using the RPi's own SPI outputs? Onto the fun times! I erm... couldn't be bothered ...
by texy
Thu Aug 09, 2012 11:24 am
Forum: Python
Topic: Analogue outputs...
Replies: 7
Views: 2868

Re: Analogue outputs...

Rumour has it P1-12 is a PWM pin, but I haven't seen any example code. There are also some chips you can connect to the SPI/I2C buses to generate PWM outputs. On a more general Analogue note, gnibbler has described how to attach a DDS over on Raspberry Pi.SE . As for python "current ...
by mobeyduck
Wed Aug 08, 2012 8:41 pm
Forum: Python
Topic: Analogue outputs...
Replies: 7
Views: 2868

Re: Analogue outputs...

Rumour has it P1-12 is a PWM pin, but I haven't seen any example code. There are also some chips you can connect to the SPI/I2C buses to generate PWM outputs. On a more general Analogue note, gnibbler has described how to attach a DDS over on Raspberry Pi.SE . As for python "current ...
by alexchamberlain
Sat Aug 04, 2012 3:44 pm
Forum: Python
Topic: Analogue outputs...
Replies: 7
Views: 2868

Re: Analogue outputs...

Rumour has it P1-12 is a PWM pin, but I haven't seen any example code. There are also some chips you can connect to the SPI/I2C buses to generate PWM outputs.

On a more general Analogue note, gnibbler has described how to attach a DDS over on Raspberry Pi.SE.

Go to advanced search