1

I am using the RPi_GPIO library in a python shell to read a raw wireless signal using the wait_for_edge() function in a loop like so:

while True:
   GPIO.wait_for_edge(26, GPIO.RISING)
   print 'R'
   GPIO.wait_for_edge(26, GPIO.FALLING)
   print 'F'

Meanwhile in another python shell on the same machine, I am doing a cheesy PWM by switching GPIO 21 HIGH/LOW and calling sleep() in between like this:

while True
   GPIO.output(21, GPIO.HIGH)
   sleep(20)
   GPIO.output(21, GPIO.LOW)
   sleep(20)

My goal was just to verify that I had everything wired up and could send/receive signal. Maybe 30 seconds in, I got a message in both shells that said:

Message from syslogd@raspb2 at May 19 21:35:26 ...
kernel:[ 9675.681566] Disabling IRQ #49

This is what I see in /proc/interrupts:

           CPU0       CPU1       CPU2       CPU3       
 16:          0          0          0          0   ARMCTRL  16  bcm2708_fb dma
 24:        262          0          0          0   ARMCTRL  24  DMA IRQ
 25:       2887          0          0          0   ARMCTRL  25  DMA IRQ
 32:    6527881          0          0          0   ARMCTRL  32  dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1
 49:     200000          0          0          0   ARMCTRL  49  3f200000.gpio:bank0
 50:          0          0          0          0   ARMCTRL  50  3f200000.gpio:bank1
 65:         44          0          0          0   ARMCTRL  65  ARM Mailbox IRQ
 66:          2          0          0          0   ARMCTRL  66  VCHIQ doorbell
 75:          1          0          0          0   ARMCTRL  75
 79:          0          0          0          0   ARMCTRL  79  3f804000.i2c
 80:          0          0          0          0   ARMCTRL  80  3f204000.spi
 83:         17          0          0          0   ARMCTRL  83  uart-pl011
 84:      19653          0          0          0   ARMCTRL  84  mmc0
 99:      81407      60633      23147      50785   ARMCTRL  99  arch_timer
474:      15968          0          0          0  pinctrl-bcm2835  26  gpiolib
FIQ:              usb_fiq
IPI0:          0          0          0          0  CPU wakeup interrupts
IPI1:          0          0          0          0  Timer broadcast interrupts
IPI2:      59304      52831      74083      54061  Rescheduling interrupts
IPI3:          7          6          9         12  Function call interrupts
IPI4:          3          4          1          2  Single function call interrupts
IPI5:          0          0          0          0  CPU stop interrupts
IPI6:          0          0          0          0  IRQ work interrupts
IPI7:          0          0          0          0  completion interrupts
Err:          0

IRQ #49 appears to be gpio:bank0 (I never knew there were different banks for the GPIO). I am guessing that I have overrun a buffer or something while trying to read and write so rapidly. Maybe both of these pins are on the same bank and I could us a different pin for one of the loops that is on the other bank. Unfortunately a quick google search did not turn up a reference for which pins are on which bank. I don't think this is a show-stopper but now my interest is peaked. Anyone have this problem before or have some insight into what it is? What is the maximum speed at which I can/should read/write on GPIO pins?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.