am335x,GPIO学习

合集下载

AM335x学习记录

AM335x学习记录

AM335x 学习笔记1 硬件及其开发环境篇1.1 开发环境的搭建1.1.1 路由器方式的 NFS 启动1) 通过路由器的方式来启动 NFS 文件系统 设置路由器局域网的网关:192.168.1.1,然后将开发板和 PC 都连接在路由器的 LAN 端口,并且采用 DCHP 的 方式来实现 tftp 和 nfs。

2) uEnv.txtserverip=192.168.1.27 rootpath=/opt/ti-sdk-am335x-evm/targetNFS bootfile=uImage-am335x-evm.bin ip_method=dhcp tftp_nfs_boot=echo Booting from network...; dhcp ${loadaddr} ${bootfile}; run net_args; bootm ${loadaddr} uenvcmd=run tftp_nfs_boot1.1.2 Root 用户登陆#sudo passwd root #****** #****** #sudo –s –H 切换到 root 用户 然后就可以重启虚拟机,以用户 root 来登陆1.1.3 中文字库问题#locale –a 查看 是否有 zh_CN,zh_CN.gb18030,zh_CN.gb2312 等 #vim /var/lib/locales/supported.d/local#dpkg-reconfigure locales #locale-gen zh_CN.GB18030 #locale-gen zh_CN.GB2312 #locale-gen zh_CN.GBK1.1.4 环境变量设置路径#vim /etc/envinoment 常用的 3 个永久设置路径  #vim /etc/envirnoment  #vim /etc/profile  #vim ~/.bashrc (/root/.bashrc)1.1.5 设置 ubuntu 的上网 ip设置为 bridge 连接方式,设定静态 IP 地址.1.1.6 更改 sh 工具#rm /bin/sh # ln –s /bin/bash /bin/sh #apt-get install fakeroot1.1.7 安装必须的工具#apt-get install vim #apt-get install build-essential #apt-get install libtool #apt-get install bsion(干什么用的还不清楚) GNU autotools 主要包括三个工具 autoconf, automake,libtool1.1.8 虚拟机开发工具的安装$ sudo apt-get install build-essential libncurses-dev flex bison autoconf automake libmpfr-dev texinfo nfs-kernel-server tftpd-hpa libcloog-ppl1.2 AM335x BeagleBone 的 NFS 启动Sd 卡的识别:在/media/下面显示内容 在/dev/sd* 下显示分区 卸载:#unmount /dev/sdb1 这个是在 AM335X-LINUX-PSP-04.06.00.03 里面找的 1) 制作 sd 启动盘 MLO+uboot.img+uImage+rootfs#!/bin/bash if [[ -z $1 || -z $2 || -z $3 || -z $4 ]] then echo "mksd-am335x Usage:" echo " echo " exit fi if ! [[ -e $2 ]] then echo "Incorrect MLO location!" exit fi if ! [[ -e $3 ]] then echo "Incorrect u-boot.img location!" exit fi if ! [[ -e $4 ]] then echo "Incorrect uImage location!" exit fi if ! [[ -e $5 ]] then echo "Incorrect rootfs location!" exit fi echo "All data on "$1" now will be destroyed! Continue? [y/n]" read ans if ! [ $ans == 'y' ] then exit fi echo "[Partitioning $1...]" DRIVE=$1 dd if=/dev/zero of=$DRIVE bs=1024 count=1024 SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'` echo DISK SIZE - $SIZE bytes CYLINDERS=`echo $SIZE/255/63/512 | bc` echo CYLINDERS - $CYLINDERS mksd-am335x <device> <MLO> <u-boot.img> <uImage> <rootfs tar.gz >" Example: mksd-am335x /dev/sdc MLO u-boot.img uImage nfs.tar.gz"{ echo ,9,0x0C,* echo ,,,} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE echo "[Making filesystems...]" mkfs.vfat -F 32 -n boot "$1"1 &> /dev/null mkfs.ext3 -L rootfs "$1"2 &> /dev/null echo "[Copying files...]" mount "$1"1 /mnt cp $2 /mnt/MLO cp $3 /mnt/u-boot.img cp $4 /mnt/uImage umount "$1"1 mount "$1"2 /mnt tar zxvf $5 -C /mnt &> /dev/null chmod 755 /mnt umount "$1"2 echo "[Done]"2) 建立 uEnv.txt (我是将 tf 卡放入读卡器,在虚拟机下面 vim 编写的。

CES-AM335X 产品手册说明书

CES-AM335X 产品手册说明书

深圳市海天雄电子有限公司Shenzhen Haitianxiong Electronic Co., Ltd. CES-AM335X产品手册TI系列开发平台Rev. V1.0Date:2016-08-03平台简介CES-AM335X开发平台是海天雄研发的一款工业级开发平台,基于TI公司Sitara系列的ARM处理器AM335X,在设计上采用高集成度的系统模块形式的核心板,核心板上集成了容量512MB的DDR3颗粒,容量1GB的SLC NandFlash 和电源管理芯片。

CES-AM335X开发平台由核心板、底板、显示驱动板、开发辅助工具组成,核心板采用AM3354,是产品定位最清晰的一个工业控制MCU,最高运行频率可达800MHz,集成了基于ARM Cortex-A8的微处理器单元、两路MAC控制器和POWERVR SGXTM图形加速器,在图像、图形处理、外设方面进行了增强,保证系统在低功耗运行的同时拥有高性能,核心板可直接用于目标产品,从而节省开发时间和开发成本;底板由各功能单元和扩展模块组成,功能单元包括常用的UART 串行数据口、USB主/从设备通用串行数据口、以太网接口、I2C通信接口、CAN通信接口、RS485通信接口、MMC/SDIO 接口、McASP接口、ADC接口、AUIAO、LVDS和RGB双路显示控制接口、GPIO输入输出功能及其他功能。

CES-AM335X开发平台可选7英寸电阻触摸液晶显示屏和10.1英寸电容触摸液晶显示屏,提供配套的开发工具包和软件程序包。

丰富的资源、优化的软硬件,完全满足大多数产品的应用,适用于工业控制、医疗电子、节能环保、智能交通、能源节能、电力系统、通讯系统、数控行业、汽车电子、工业触摸屏控制系统、机器人视觉、媒体处理无线应用、数字家电、车载设备、通信设备、网络终端等环境恶劣场合。

平台特点◆TI Cortex-A8 AM3354处理器;◆搭载512MB DDR3内存和1GB SLC NandFlash;◆支持7英寸RGB 24位电阻触摸显示屏(800*480)及10.1英寸LVDS(1024*600)显示屏;◆支持双路千兆以太网接口,包含RS485、CAN总线、USB等,满足工业应用;◆支持Linux3.2、Android4.2操作系统;功能接口核心板硬件参数软件参数——Linux 3.2软件参数——Android 4.2USB 摄像头驱动 支持USB 摄像头的预览和拍照功能 CAN 驱动 支持CAN 通讯 RS485驱动 支持RS485通讯 SPI 驱动支持SPI 通讯产品配置清单开发平台(扩展板+核心板)用户光盘串口线触摸笔网线10.1英寸电容触摸显示屏USB 线7英寸RGB 电阻显示屏(选配)电源适配器SD 卡(选配)服务支持技术支持联系方式:电话:*************86325376邮箱:************************技术支持服务时间:周一至周五:9:00~12:00,13:30~18:00免责声明本手册信息仅供用户参考使用,对于所作修改,恕不另行通知。

AM335x 处理器 SDK RTOS 板库端口和启动说明书

AM335x 处理器 SDK RTOS 板库端口和启动说明书

Board Porting\Bring up using Processor SDK RTOS for AM335xProcessor SDK RTOS component known as board library consolidates all the board-specific information so that all the modifications made when moving to a new custom platform using the SOC can be made in the source of this library.There are three different components in PRSDK that help in porting and bring up of a custom board:∙Board library updatesa.PLL Clocking and PRCMb.Pin mux Updatec.DDR Configurationd.Peripheral instances updates∙Diagnostics tests∙Boot loader updatesBoard Library Updates in Processor SDK RTOS:PLL ClockingThere are two places where the device PLL configurations are performed when using Processor SDK RTOS and CCS.Debug environment:Debug environment refers to development setup where code is debugged using JTAG emulator on the SOC. The PRSDK software relies on the GEL file that is part of the target configuration to setup the clocks and the DDR for the device. The CCS GEL file for AM335x platforms is located in the CCS package at the location ccsv7\ccs_base\emulation\boards\<boardName>For example for beagle bone black, the files can be found atccsv7\ccs_base\emulation\boards\beaglebone\gelThe GEL is the first piece of software that should be brought up on a custom board.Production environment:Production environment refers to the setup when the base application is booted from a boot media like a flash memory or host interface. In this environment, the bootloader sets performs all the SOC and board initialization and copies the application from flash memory to the device memory.The clock setup in the bootloader code can be located atpdk_am335x_x_x_x\packages\ti\starterware\bootloader\src\am335xUsers can choose to use the platform clocking similar to one of TI reference platforms or can modify them as per their application requirements. By default the PLL settings are setup for OPP_NOM settings (MPU= 600 MHz.)TI provides Clock Tree tool to allow users to simulate the clocking on the SOC. For quick reference of the multiplier and divider settings to change the PLL setting is provided in the spreadsheetAM335x_DPLL_CALCv3.xlsx.After modifying the clocking in the bootloader, users need to rebuild the bootloader using instructions provided in Processor_SDK_RTOS_BOOT_AM335x/AM437xPRCM Modules Enable:PRCM Module Enable is required to turn on the power domain and the clocking to each of the modules on the SOC. The PRCM Enable calls to enable each module are made from the functionBoard_moduleClockInit which is found in the location.pdk_am335x_1_0_9\packages\ti\board\src\bbbAM335x\bbbAM335x.cCheck every instance and peripheral required in the application platform and enable the module in the board library.For example to use three UARTs 0, 1 and 4, ensure that you have the following code as part of the board library setup:/* UART */status = PRCMModuleEnable(CHIPDB_MOD_ID_UART, 0U, 0U);status = PRCMModuleEnable(CHIPDB_MOD_ID_UART, 1U, 0U);status = PRCMModuleEnable(CHIPDB_MOD_ID_UART, 4U, 0U);Note: PRCMEnable function is defined in pdk_am335x_1_0_9\packages\ti\starterware\soc\am335x Pinmux updates in the Board library:Generating a New PinMux Configuration Using the PinMux Utility: This procedure uses the cloud-based pinmux utilityNavigate to ${PDK_INSTALL_DIR}\packages\ti\starterware\tools\pinmux_config\am335x and Load beaglebone_black_configAdd and remove peripheral instances and select the appropriate use cases required for development based on the application platform requirements and resolve all conflicts.Refer Pin_Mux_Utility_for_ARM_MPU_ProcessorsPost Processing steps:1.Change the Category filter to starterware and download the pinmux files am335x_pimnmux.hand am335x_pinmux_data.c2.At the bottom of am335x_pinmux.h change extern pinmuxBoardCfg_t gAM335xPinmuxData[];to extern pinmuxBoardCfg_t gBbbPinmuxData[];3.Change am335x_pinmux_data.c to am335x_beagleboneblack_pinmux_data.c.4.Change gAM335xPinmuxData to gBbbPinmuxData at the end of the file in file5.am335x_beagleboneblack_pinmux_data.c.Replace the existing files with the new files and rebuild the board library using the instructions in the section Rebuilding board Library in Processor SDK RTOS:Updating DDR settings:Similar to clock and PLL settings, DDR initialization is configured in the Debug environment through GEL files and in production environment using bootloader source files.TI provides AM335x_EMIF_Configuration_tips which contains a spreadsheet to enter the timing from the DDR datasheet to compute the EMIF timing number required to initialize DDR.We strongly recommend changing the value and testing using GEL files before using them in the bootloader software. For Sanity test, you can perform read/write tests using CCS Memory Browser or run the diagnostic memory read/write test that we provide in diagnostics package here:PDK_INSTALL_PATH\packages\ti\board\diag\memOnce the DDR timings have been confirmed, you can use the settings in the file:PDK_INSTALL_PATH \packages\ti\starterware\bootloader\src\am335x\sbl_am335x_platform_ddr.c Peripheral initialization:The board library is responsible for most of the SOC initialization but it also setup some board level components such as ethernet PHY and debug UART and I2C for reading board ID from EEPROM. All of the other peripheral instances and initialization needs to be done from the application level.For example for beagleboneblack, the peripheral initialization are performed from the source filepdk_am335x_1_0_9\packages\ti\board\src\bbbAM335x\bbbAM335x_lld_init.cThe debug UART instance, I2C Addresses are set using the file board_cfg.h found under:pdk_am335x_1_0_9\packages\ti\board\src\bbbAM335x\includeDefault UART instance is set to 0 in the board library. The Board initialization will configure the UART instance 0 to send binary log data to serial console using the Board_UARTInit function. If you wish to use more UART instances then we recommend linking in the UART driver in the application and using UART_open() and UART_stdioInit API calls from the application.Each peripheral driver in the Processor SDK RTOS has a SOC configuration that provides the interrupt numbers, base address, EDMA channels which can be updated using the file <peripheral>_soc.c file. This is used as default setup for initializing the driver instance. It can be overridden from the application using peripheral_getSOCInitCfg() and peripheral_setSOCInitCfg()For Example: All instances of UART for AM335x have been mapped in the filepdk_am335x_1_0_9\packages\ti\drv\uart\soc\am335x\UART_soc.cSystem integrators need to ensure that no interrupt numbers and EDMA resource conflicts exist in the SOC configuration for all drivers used in the system.To exercise three UARTs in the system, users can use the following code://Setup Debug UARTboardCfg = BOARD_INIT_PINMUX_CONFIG |BOARD_INIT_MODULE_CLOCK |BOARD_INIT_UART_STDIO;Board_init(boardCfg);// Open Additional UART Instances:/* UART SoC init configuration */UART_initConfig(false);/* Initialize the default configuration params. */UART_Params_init(&uartParams);// Open UART Instance 1uartTestInstance =1;uart1 = UART_open(uartTestInstance, &uartParams);//Open UART Instance 4uartTestInstance = 4;uart4 = UART_open(uartTestInstance, &uartParams);BoardID Detect:TI supports multiple evaluation and reference platforms for AM335x hence the hardware platforms are populated with an EEPROM which contains information that identifies the hardware and its revision. The board library and software components read the boardID and initialize the platform based on the boardID. The BoardID_detect function can be found in the source in the file bbbAM335x_info.c in the board library and board_am335x.c in the bootloader source at:<PDK_INSTALL_PATH>\packages\ti\starterware\board\am335xRebuilding board Library in Processor SDK RTOS:While Creating a new folder for the custom board is an option users can explore, TI recommends that users make there changes in existing board package using either bbbAM335x, evmAM335x oriceAM335x folder to avoid spending additional effort to modify the build files for including the customBord.Once all the update to the board library are completed, the board library can be updated using the following instructions.Instructions to rebuild board library:Setup Processor SDK build environment before following steps provided below.cd pdk_am335x_1_0_9\packagesgmake board_libFor a specific board users are required to provide the LIMIT_BOARDS argument.LIMIT_BOARDS : evmAM335x icev2AM335x iceAMIC110 bbbAM335x skAM335xFor Example for beagleboneblack, users can use the following build option:gmake board_lib LIMIT_BOARDS=bbbAM335xDiagnostics:After the board library is built, we highly recommend that you create a diagnostics package similar to one provided in board library to test different interfaces functionally during board bring up.The diagnostics package can be located at pdk_am335x_1_0_9\packages\ti\board\diag. These are simple bare-metal tests that use peripheral drivers to help functionally validate the pins and interfaces.Documentation for all available diagnostic tests is provided here:/index.php/Processor_SDK_RTOS_DIAGBootloader in Processor SDK RTOS:As part of the production flow, users are required to develop/port flashing and booting utilities so the application can be launched on the custom board with JTAG. TI provides a bootloader mechanism where the ROM bootloader loads a secondary bootloader on the onchip memory that initializes the SOC and DDR and then copies the application into DDR memory.The boot process and flashing tools have been described in detail in the following article that is part of processor SDK RTOS Software developer`s guide:/index.php/Processor_SDK_RTOS_BOOT_AM335x/AM437x#Building_the_B ootloader。

盈鹏飞嵌入式_AM335XGPMC使用总结

盈鹏飞嵌入式_AM335XGPMC使用总结

盈鹏飞嵌入式_AM335XGPMC使用总结AM335X GPMC使用比较灵活,可以配置为● 8-bit 同步或者异步并行总线 (非burst)● 16-bit 同步或者异步并行中线● 16-bit 非复用的NOR Flash● 16-bit 数据和地址总线复用的NOR Flash● 8-bit 和 16-bit NAND Flash● 16-bit pSRAM.下面以EVB335X扩展EXAR ST16C554为例,讲解如何配置GPMC。

1. 配置GPMC引脚static struct pinmux_config gpmc_pin_mux[] = {/********* 8-bit data bus **************/{"gpmc_ad0.gpmc_ad0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},{"gpmc_ad1.gpmc_ad1", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},{"gpmc_ad2.gpmc_ad2", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},{"gpmc_ad3.gpmc_ad3", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},{"gpmc_ad4.gpmc_ad4", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},{"gpmc_ad5.gpmc_ad5", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},{"gpmc_ad6.gpmc_ad6", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},{"gpmc_ad7.gpmc_ad7", OMAP_MUX_MODE0 |AM33XX_PIN_INPUT_PULLUP},/**************** 8-bit address bus ****************/{"gpmc_a0.gpmc_a0", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},{"gpmc_a1.gpmc_a1", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},{"gpmc_a2.gpmc_a2", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},{"gpmc_a3.gpmc_a3", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},{"gpmc_a4.gpmc_a4", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},{"gpmc_a5.gpmc_a5", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},{"gpmc_a6.gpmc_a6", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},{"gpmc_a7.gpmc_a7", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},{"gpmc_csn2.gpmc_csn2", OMAP_MUX_MODE0 | AM33XX_PULL_DISA},{"gpmc_oen_ren.gpmc_oen_ren", OMAP_MUX_MODE0 | AM33XX_PULL_DISA},{"gpmc_wen.gpmc_wen", OMAP_MUX_MODE0 | AM33XX_PULL_DISA},{NULL, 0},};setup_pin_mux(gpmc_pin_mux);2. 申请GPMC内存unsigned long serial_gpmc_mem_base_phys;int cs = 2; /* EVB335X评估板中ST16C554接在CS2上 */gpmc_cs_request(cs, SZ_16M, &serial_gpmc_mem_base_phys)此时serial_gpmc_mem_base_phys存放的是该CS上多对应的物理起始地址。

AM335XGPIO详解

AM335XGPIO详解

AM335XGPIO详解1、配置GPIO1的时钟CM_PER RegistersCM_PER_GPIO1_CLKCTRL该寄存器管理GPIO1时钟。

OPTFCLKEN_GPIO_1_GDBCLK 可选功能时钟控制0X0 = FCLK_DIS :可选功能的时钟被禁止0x1 = FCLK_EN :可选功能时钟使能IDLEST 模块为空闲状态0X0 =函数功能:模块功能齐全,包括OCP0x1 =反:模块进行转换:唤醒或休眠,或睡眠流产0X2 =空闲:模块处于空闲模式(仅OCP部分)。

它是功能,如果使用独立的时钟功能0x3的=禁止:禁止模块,不能访问CM_PER_L4LS_CLKSTCTRL该寄存器使能域功率状态转换。

它控制着SW监督时钟域状态ON- PER和ON- INPER状态之间的转换。

它也认为每个时钟输入1个状态位域。

CLKACTIVITY_GPIO_1_GDBCLK 该字段表示在该GPIO1_GDBCLK时钟的状态域。

0X0 = INACT :对应的时钟门控0x1 =ACT:通讯时钟有效2、配置GPIO端口功能CONTROL_MODULE Registersconf_gpmc_a0-a11 设置内部上拉和管脚传输速率:快或慢3、重启GPIO模块GPIO_SYSCONFIG 寄存器1 SOFTRESET R/W Software reset.This bit is automatically reset by the hardware. During reads, it always returns 0.0x0 = Normal mode0x1 = The module is rese软件复位。

该位由硬件自动复位。

在读取时,它总是返回0 。

0X0 =普通模式为0x1 =该模块复位4、设置GPIO方向GPIO_OE[0-31] 寄存器输出数据使能0X0 =相应的GPIO端口被配置为输出。

0x1 =相应的GPIO端口配置为输入。

AM335X开发日记

AM335X开发日记

AM335X平台开发日记2014-11-24至2014-11-29进行核心板原理图设计2014-12-1至2014-12-10进行PCB设计。

2014-12-5开始学习AM335X软件部分的知识。

安装了vmware虚拟机,10.0.1版本的。

安装了ubunt12.04版本。

安装vmware-tools,创建共享文件夹。

在root(需执行sudo su)下执行mount -t vmhgfs .host:/ /mnt/hgfs在windows共享文件夹存放TI安装包ti-sdk-am335x-evm-06.00.00.00-Linux-x86-Install.bin。

在终端里面执行安装。

安装目录为/usr/local/ti-sdk-am335x-evm#,一般会自动加入环境变量,如果没有,在/etc/environment增加环境变量:(注意:6.0的安装包不支持ubunt14.04版本,只支持12.04以下的版本)PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/l ocal/ti-sdk-am335x-evm/linux-devkit/sysroots/i686-arago-linux/usr/bin:"输入命令arm-linux-gnueabihf-gcc –v即可查询版本执行setup.sh配置linux环境,例如安装包更新,NFS,TFTP,minicom等。

下载了Uniflash V3,准备选择USB或者ETH接口进行FLASH编程。

执行命令make CROSS_COMPILE=arm-linux-gnueabihf- O=am335x ARCH=armam335x_evm编译u-boot,生成MLO(spl)和u-boot.imgNandflash程序分区:1.0-0x1ffff 为SPL2.0x20000-0x3ffff为SPL backup13.0x40000-0x5ffff为SPL backup24.0x60000-0x7ffff为SPL backup35.0x80000-0x25ffff为uboot6.0x260000 -0x27ffff为env7.0x280000-0x77ffff为linux kernel8.0x780000- 为file system9.下载uboot软件并进行修改适应新设计的核心板,并把uboot下载到板子里调试运行。

am335x,GPIO学习

am335x,GPIO学习

[A8] am335x_starterware—GPIO demo学习本例程实现功能比较简单,实现LED灯的闪烁。

1、主流程图1-1 GPIO程序主流程像常见LED闪烁程序一样,都是先配置,然后采取:置高-延时-拉低-延时-置高-延时……的方式,实现闪烁。

2、各子函数说明2.1 GPIO1ModuleClkConfig()配置GPIO1寄存器CM_PER_GPIO1_CLKCTRL(或上0x00000002),使能该GPIO1模块。

等待配置完毕。

P1049。

配置GPIO1寄存器CM_PER_GPIO1_CLKCTRL(或上0x00040000),使能GPIO1模块时钟。

等待配置完毕。

P1049。

检测GPIO1是否处于闲置状态CM_PER_GPIO1_CLKCTRL[17-16],若处于非fully functional状态,则等待。

P1049。

检测L4的CM_PER_L4LS_CLKSTCTRL的[19]位,查看GPIO1_GDBCLK时钟是否激活。

若未激活(Inact)则等待。

P1020。

2.2 GPIO1Pin23PinMuxSetup()GPIO1Pin23PinMuxSetup()配置GPMC_A7(GPIO1_23)引脚,配置为高速、下拉并使能。

Register=0x00000007。

p1278。

功能服用配置位为该寄存器[2:0],配置为111b,还未搞清楚。

2.3 GPIOModuleEnable()GPIOModuleEnable(GPIO_INSTANCE_ADDRESS)配置GPIO1时钟使能,GPIO_CTRL。

GPIO_CTRL[0]=0,使能GPIO1模块。

P4524。

2.4 GPIOModuleReset()GPIOModuleReset(GPIO_INSTANCE_ADDRESS)复位GPIO1各端口。

GPIO_SYSCONFIG。

GPIO_SYSCONFIG[1]=1,软件写1复位,复位GPIO1各端口。

AM335x通用EVM硬件用户指南_中文

AM335x通用EVM硬件用户指南_中文

AM335x通用EVM硬件用户指南本文档介绍了AM335x评估模块(EVM)(TMDXEVM3358)这是基于德州仪器AM335x处理器的硬件体系结构。

该EVM通常也被称为AM335x通用(GP)EVM。

AM335x通用EVM是一个独立的测试,开发和评估模块系统,它使开发人员能够编写周围的AM335x处理器子系统的软件和硬件开发。

已经可用的EVM板的基础上,为开发人员提供了所需的基本资源最通用的类型的项目,包括作为主处理器的AM335x AM335x子系统的主要内容。

此外,额外的,“典型的”外围设备内置的的EVM如存储器,传感器,LCD,以太网PHY等,使未来的系统可以模拟快速显着的额外的硬件资源。

以下各节提供有关EVM的更多细节。

AM335x通用EVM的系统视图是由底板,子板,液晶显示板叠放在一起,通过标准的通孔连接器连接。

请参阅下面的图片的EVM。

图1:AM335x通用EVM 图2:的AM335x底板底查看AM335x完整的通用EVM被划分在三个不同的电路板的模块化。

GP EVM包括基板(处理器和主电源),子板(外围设备)和液晶显示板(LCD和触摸屏)。

图3:AM335x的EVM系统板图处理器TMXAM3359ZCZ处理器是此EVM的中央处理器。

在黑板上的所有资源环绕TMXAM3359处理器提供的硬件和软件开发能力。

请参阅的TMXAM3359数据表和TRM的处理器的详细信息。

有系统的配置信号,SYSBOOT,也可以设置在EVM上AM335x处理器定义一些启动参数。

有关详细信息,请参阅“配置/设置”一节。

EVM有几个时钟,支持AM3359处理器。

为处理器的主时钟是来自从24MHz晶体。

片上振荡器的AM3359产生基准时钟,后续的模块需要在AM3359处理器的时钟。

一个32kHz的时钟RTC的AM3359是来自一个32kHz的晶体在黑板上。

SYS_RESETn是运行多个外设和的AM335x其中执行这些外围设备的复位信号。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

[A8] am335x_starterware
—GPIO demo学习本例程实现功能比较简单,实现LED灯的闪烁。

1、主流程
图1-1 GPIO程序主流程
像常见LED闪烁程序一样,都是先配置,然后采取:置高-延时-拉低-延时-置高-延时……的方式,实现闪烁。

2、各子函数说明
2.1 GPIO1ModuleClkConfig()
配置GPIO1寄存器CM_PER_GPIO1_CLKCTRL(或上0x00000002),使能该GPIO1模块。

等待配置完毕。

P1049。

配置GPIO1寄存器CM_PER_GPIO1_CLKCTRL(或上0x00040000),使能GPIO1模块时钟。

等待配置完毕。

P1049。

检测GPIO1是否处于闲置状态CM_PER_GPIO1_CLKCTRL[17-16],若处于非fully functional状态,则等待。

P1049。

检测L4的CM_PER_L4LS_CLKSTCTRL的[19]位,查看GPIO1_GDBCLK时钟是否激活。

若未激活(Inact)则等待。

P1020。

2.2 GPIO1Pin23PinMuxSetup()
GPIO1Pin23PinMuxSetup()
配置GPMC_A7(GPIO1_23)引脚,配置为高速、下拉并使能。

Register=0x00000007。

p1278。

功能服用配置位为该寄存器[2:0],配置为111b,还未搞清楚。

2.3 GPIOModuleEnable()
GPIOModuleEnable(GPIO_INSTANCE_ADDRESS)
配置GPIO1时钟使能,GPIO_CTRL。

GPIO_CTRL[0]=0,使能GPIO1模块。

P4524。

2.4 GPIOModuleReset()
GPIOModuleReset(GPIO_INSTANCE_ADDRESS)
复位GPIO1各端口。

GPIO_SYSCONFIG。

GPIO_SYSCONFIG[1]=1,软件写1复位,复位GPIO1各端口。

P4519。

2.5 void GPIODirModeSet()
void GPIODirModeSet(unsigned int baseAdd,
unsigned int pinNumber,
unsigned int pinDirection)
配置相应GPIO,相应引脚的输入输出方向位:
baseAdd:GPIOn首地址;
pinNumber:GPIO待配置端口号;
pinValue:GPIO相应端口的输入输出方向状态;
调用:GPIODirModeSet( GPIO_INSTANCE_ADDRESS,
GPIO_INSTANCE_PIN_NUMBER,
GPIO_DIR_OUTPUT);
配置GPIO1_23输入输出方向位。

GPIO_OE。

GPIO_OE[23]=0,将GPIO1_23置为输出。

P4524。

2.6 void GPIOPinWrite()
void GPIOPinWrite(unsigned int baseAdd,
unsigned int pinNumber,
unsigned int pinValue)
配置GPIO相应管脚的高低电平状态。

baseAdd:GPIOn首地址;
pinNumber:GPIO待配置端口号;
pinValue:GPIO相应端口的高低电平状态;
调用:GPIOPinWrite(GPIO_INSTANCE_ADDRESS,
GPIO_INSTANCE_PIN_NUMBER,
GPIO_PIN_HIGH);
置位:向GPIO_SETDATAOUT对应位写1;P4529;
清零:向GPIO_CLEARDA TAOUT对应位写1;P4529;
2.7 注意
在am335x_starterware程序包中,上述同名函数原型可能不止一个。

阅读时注意选beaglbebone目录下的函数。

相关文档
最新文档