On Mon, Jan 28, 2019 at 6:52 AM <[email protected]> wrote:
>
> Hello..
>      I am first time work on beaglebone.I want to generate Clock of 3Khz on 
> timer7 (P8_8)pin og beaglebone.
> here is my code.
>
> import Adafruit_BBIO.GPIO as GPIO
> import time
> outpin="P8_8"
> GPIO.setup(outpin,GPIO.OUT)
> GPIO.setclock(outpin,3000)
> while True:
>       GPIO.output(outpin,GPIO.HIGH)
>       time.sleep(2)
>       GPIO.output(outpin,GPIO.LOW)
>       time.sleep(2)
> -------------------------------------------------------------------------------------
> It gives error..
> GPIO.setclock(outpin,3000)
> AttributeError: 'module' object has no attribute 'setclock'
>
> Please correct me..

Just use the BB-PWM-TIMER-P8.08.dts overlay:

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-PWM-TIMER-P8.08.dts

PS, to hit your clock, make sure to properly set teh prescaler:

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-PWM-TIMER-P8.08.dts#L47

Regards,

-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYiJJ2EnXdd5ncfuohvphn-xcCcFOQSW4eEMOY7aE6rHqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to