Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    T113 (tina) 改变gpadc采样率,要测量的引脚电压也会改变,这正常吗?

    T Series
    4
    8
    3485
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jr_online LV 7 last edited by

      改变gpadc采样率:

      cd /sys/class/gpadc/
      echo 5000 > sr #设置gpadc采样率为10000,gpadc采样率范围为400~100000;
      cat sr #查看gpadc当前采样率。
      

      然后通过万用表测量GPADC0引脚的电压,

      发现电压也会随adc采样率的改变而改变。

      这正常吗?

      Y 1 Reply Last reply Reply Quote Share 0
      • YuzukiTsuru
        柚木 鉉 LV 9 last edited by

        @jr_online 正常的

        J 1 Reply Last reply Reply Quote Share 0
        • J
          jr_online LV 7 @YuzukiTsuru last edited by

          @yuzukitsuru 在 T113 (tina) 改变gpadc采样率,要测量的引脚电压也会改变,这正常吗? 中说:

          @jr_online 正常的

          这电压不就不准了吗?不懂😵

          C 1 Reply Last reply Reply Quote Share 0
          • C
            captain LV 5 @jr_online last edited by

            @jr_online
            请问一下修改那些地方能使用这个普通的 gpadc 呀?
            我看它设备树里面都是配置的adc按键,不能直接去读取相关的adc值。
            使用普通adc 命令就会报错。

            /sys/class/gpadc# echo 5000 > sr 
            [ 1536.126834] 8<--- cut here ---
            [ 1536.130277] Unable to handle kernel NULL pointer dereference at virtual address 00000084
            [ 1536.139439] pgd = b0db3a19
            [ 1536.142531] [00000084] *pgd=00000000
            [ 1536.146601] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
            [ 1536.152563] Modules linked in: sx1262(O) sunxi_ce [last unloaded: sx1262]
            [ 1536.160192] CPU: 0 PID: 1687 Comm: bash Tainted: G           O      5.4.61 #2
            [ 1536.168197] Hardware name: Generic DT based system
            [ 1536.173578] PC is at sr_store+0x9c/0x100
            [ 1536.177978] LR is at _kstrtoull+0x34/0x8c
            [ 1536.182473] pc : [<c0507f60>]    lr : [<c035800c>]    psr: a0000013
            [ 1536.189500] sp : c4569e98  ip : c0507ec4  fp : 00000000
            [ 1536.195360] r10: 00000004  r9 : 00000051  r8 : c5108710
            [ 1536.201221] r7 : c4569f70  r6 : 00000000  r5 : 00000005  r4 : c0c03dc8
            [ 1536.208542] r3 : 00000000  r2 : 00001388  r1 : 016e3600  r0 : 00000000
            [ 1536.215865] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
            [ 1536.223871] Control: 10c5387d  Table: 445e006a  DAC: 00000051
            [ 1536.230321] Process bash (pid: 1687, stack limit = 0x0c6dc0e4)
            [ 1536.236864] Stack: (0xc4569e98 to 0xc456a000)
            
            J 1 Reply Last reply Reply Quote Share 0
            • J
              jr_online LV 7 @captain last edited by

              @captain 在 T113 (tina) 改变gpadc采样率,要测量的引脚电压也会改变,这正常吗? 中说:

              @jr_online
              请问一下修改那些地方能使用这个普通的 gpadc 呀?
              我看它设备树里面都是配置的adc按键,不能直接去读取相关的adc值。
              使用普通adc 命令就会报错。

              /sys/class/gpadc# echo 5000 > sr 
              [ 1536.126834] 8<--- cut here ---
              [ 1536.130277] Unable to handle kernel NULL pointer dereference at virtual address 00000084
              [ 1536.139439] pgd = b0db3a19
              [ 1536.142531] [00000084] *pgd=00000000
              [ 1536.146601] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
              [ 1536.152563] Modules linked in: sx1262(O) sunxi_ce [last unloaded: sx1262]
              [ 1536.160192] CPU: 0 PID: 1687 Comm: bash Tainted: G           O      5.4.61 #2
              [ 1536.168197] Hardware name: Generic DT based system
              [ 1536.173578] PC is at sr_store+0x9c/0x100
              [ 1536.177978] LR is at _kstrtoull+0x34/0x8c
              [ 1536.182473] pc : [<c0507f60>]    lr : [<c035800c>]    psr: a0000013
              [ 1536.189500] sp : c4569e98  ip : c0507ec4  fp : 00000000
              [ 1536.195360] r10: 00000004  r9 : 00000051  r8 : c5108710
              [ 1536.201221] r7 : c4569f70  r6 : 00000000  r5 : 00000005  r4 : c0c03dc8
              [ 1536.208542] r3 : 00000000  r2 : 00001388  r1 : 016e3600  r0 : 00000000
              [ 1536.215865] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
              [ 1536.223871] Control: 10c5387d  Table: 445e006a  DAC: 00000051
              [ 1536.230321] Process bash (pid: 1687, stack limit = 0x0c6dc0e4)
              [ 1536.236864] Stack: (0xc4569e98 to 0xc456a000)
              

              那你的设备树是怎么配置的呢?可以贴出来看看和我的有啥不一样。
              我也看不懂你的报错,我就是在命令行去操作gpadc的。

              C 1 Reply Last reply Reply Quote Share 0
              • C
                captain LV 5 @jr_online last edited by

                @jr_online
                仔细检查了一下设备树,发现 gpadc 没打开。
                现在打开之后重新编译就能使用了。
                感谢!

                J 1 Reply Last reply Reply Quote Share 0
                • J
                  jr_online LV 7 @captain last edited by

                  @captain 在 T113 (tina) 改变gpadc采样率,要测量的引脚电压也会改变,这正常吗? 中说:

                  @jr_online
                  仔细检查了一下设备树,发现 gpadc 没打开。
                  现在打开之后重新编译就能使用了。
                  感谢!

                  好的

                  1 Reply Last reply Reply Quote Share 0
                  • Y
                    ysc3650145 LV 4 @jr_online last edited by

                    @jr_online 在 T113 (tina) 改变gpadc采样率,要测量的引脚电压也会改变,这正常吗? 中说:

                    改变gpadc采样率:

                    cd /sys/class/gpadc/
                    echo 5000 > sr #设置gpadc采样率为10000,gpadc采样率范围为400~100000;
                    cat sr #查看gpadc当前采样率。
                    

                    然后通过万用表测量GPADC0引脚的电压,

                    发现电压也会随adc采样率的改变而改变。

                    这正常吗?

                    请问你这个是怎么配置gpadc的 就是作为采集电压的 我目前好像就是采集的都是一样的

                    1 Reply Last reply Reply Quote Share 0
                    • Moved from MR Series by  xiaowenge xiaowenge 
                    • 1 / 1
                    • First post
                      Last post

                    Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

                    行为准则 | 用户协议 | 隐私权政策