> On Apr 28, 2016, at 4:46 AM, frank brewer <frankthebre...@gmail.com> wrote:
> 
> 
> I just noticed the faster way of toggling pins by using mmap, and after 
> trying chiragnagpal's example, I could achieve 2.6MHz. 
> 
> 
> 
> Example was for 1 pin only, now I want to use 8 pins, so I edited .dtc file 
> as following:
> 
> /*
> * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
> *
> * This program is free software; you can redistribute it and/or modify
> * it under the terms of the GNU General Purpose License Version 2 as
> * published by the Free Software Foundation
> *
> * Original from: 
> github.com/jadonk/validation-scripts/blob/master/test-capemgr/
> *
> * Modified by Derek Molloy for the example on www.derekmolloy.ie
> * that maps GPIO pins for the example
> */
> 
> 
> /dts-v1/;
> /plugin/;
> 
> 
> /{
>        compatible = "ti,beaglebone", "ti,beaglebone-black";
>        part-number = "DM-GPIO-Test";
>        version = "00A0";
> 
> 
>        fragment@0 {
>              target = <&am33xx_pinmux>;
> 
> 
>              __overlay__ {
>                   pinctrl_test: DM_GPIO_Test_Pins {
>                         pinctrl-single,pins = <
> 
> 
>                                 0x070 0x07  /* P9_11 60 OUTPUT MODE7 - The 
> LED Output */
>                                 0x078 0x07  /* P9_12 60 OUTPUT MODE7 - The 
> LED Output */
>                                 0x074 0x07  /* P9_13 60 OUTPUT MODE7 - The 
> LED Output */
>                                 0x048 0x07  /* P9_14 60 OUTPUT MODE7 - The 
> LED Output */
>                                 0x040 0x07  /* P9_15 60 OUTPUT MODE7 - The 
> LED Output */
>                                 0x04c 0x07  /* P9_16 60 OUTPUT MODE7 - The 
> LED Output */
>                                 0x15c 0x07  /* P9_17 60 OUTPUT MODE7 - The 
> LED Output */
>                                 0x158 0x07  /* P9_18 60 OUTPUT MODE7 - The 
> LED Output */
> 
> 
> 
> 
>                                /* OUTPUT  GPIO(mode7) 0x07 pulldown, 0x17 
> pullup, 0x?f no pullup/down */
>                                /* INPUT   GPIO(mode7) 0x27 pulldown, 0x37 
> pullup, 0x?f no pullup/down */
> 
> 
>                         >;
>                   };
>              };
>        };
> 
> 
>        fragment@1 {
>                 target = <&ocp>;
>                 __overlay__ {
>                         test_helper: helper {
>                                 compatible = "bone-pinmux-helper";
>                                 pinctrl-names = "default";
>                                 pinctrl-0 = <&pinctrl_test>;
>                                 status = "okay";
>                         };
>                 };
>         };
> };
> 
> 
> However I could not figure out how to edit the header file used in the 
> example. Here is the header file of the example:
> 
> #ifndef _BEAGLEBONE_GPIO_H_
> #define _BEAGLEBONE_GPIO_H_
> 
> 
> #define GPIO1_START_ADDR 0x4804C000
> #define GPIO1_END_ADDR 0x4804DFFF
> #define GPIO1_SIZE (GPIO1_END_ADDR - GPIO1_START_ADDR)
> #define GPIO_OE 0x134
> #define GPIO_SETDATAOUT 0x194
> #define GPIO_CLEARDATAOUT 0x190
> 
> 
> 
> 
> #define PIN (1<<28)
> 
> 
> 
> 
> #endif
> 
> 
> Questions:
> 
> 1) I could not find START_ADDR, END_ADDR, OE, SETDATAOUT, CLEARDATAOUT from 
> technical manual. Where can I find them for the pins from P9_11 ... upto P9_18
See AM3358 TRM Table 2-3 GPIO1
> 
> 2) what is the explanation of the following statement? What does it do?
> define PIN ( 1<<28)
Take a 1 and left shift by 28. This means bit 28 is set.

>From Section 25.4
134h GPIO_OE
190h GPIO_CLEARDATAOUT
194h GPIO_SETDATAOUT

Learn to read the TRM. Section 2.1, Memory Map. Last section of each chapter is 
the register layout, for example, 25.4 is the GPIO register layout. 

> 
> 3) I am going to use it for SPI communication, so since the timing is 
> critical, and Linux is not RT, there is a possibility that some other 
> interrupts may damage my communaction. Do you think that it would be a 
> problem? If yes, what precautions can I get?
It is possible because the data is synchronized to the clock. However, I would 
recommend doing this with PRU.

Regards,
John
> 
> Regards,
> Frank
> 
> -- 
> For more options, visit http://beagleboard.org/discuss 
> <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 beagleboard+unsubscr...@googlegroups.com 
> <mailto:beagleboard+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/beagleboard/fe2ed36d-96bb-43d3-aeee-9e85fcbfd04b%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/beagleboard/fe2ed36d-96bb-43d3-aeee-9e85fcbfd04b%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/E9FF8757-D1A0-4D9B-9031-E8E0BB2A00CB%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to