First look at the following schematic diagram of the STM32 Gpio as follows:
When the port is configured for output:
Open-Drain mode: output 0 o'clock, N-mos conduction, P-mos not activated, output 0.
Output 1 o'clock, N-mos high resistance, p-mos not activated, Output 1 (requires external pull-up circuit); This mode allows the port to be used as a bidirectional IO.
Push-Pull mode: output 0 o'clock, N-mos conduction, P-mos high resistance, output 0
In this tutorial, we will study the programming method of MSP430 MCU Gpio. This article also applies to the MSP430X2XX devices used on the Launchpad Development Board, such as msp430g2553, msp430g2231, etc. Most pins on the MSP430 microcontroller are grouped into up to 8 ports, P1 to P8. Each port is 8-bit wide and has 8 related I/O pins. These pins are mapped directly to the appropriate port registers, so the I/O pins can be operated independently. O
. The higher the resistance, the lower the speed and power consumption. And vice versa.
The push-pull output is generally called the push-pull output. It should be more suitable than the CMOS output in the CMOS circuit. The push-pull output capability in the CMOS circuit cannot be as large as the bipolar output capability. The output capability depends on the area of the N-tube p-tube output in the IC. Compared with the open-drain output, the level of push-pull is determined by the IC power sup
When I learned the board_init () function, I found that the value of the CPU register can be set through the structure pointer. This is quite interesting. Study it ~
After research, I found that the principle is very simple and I am sorry to write it here. Therefore, if you see this article, please move to it ~
In the final analysis
S3c24x0_clock_power * const clk_power = s3c24x0_getbase_clock_power ();S3c24x0_gpio * const gpio = s3c24x0_getbase_gpio
Gpio (2) C program
@*************************************** ***************************************@ File: crt0.s@ Function: transfer it to the C program@*************************************** ***************************************
. Text. Global _ start_ Start:LDR r0, = 0x53000000 @ watchdog Register addressMoV R1, #0x0STR R1, [R0] @ write 0, prohibit watchdog, otherwise the CPU will continue to restartLDR sp, = 1024*4 @ set the stack. Note: it can
1 for Port 2 p2out (30; // bit 3 Output 0 for Port 24. Port bit field outputDefines a port bit field that defines 16 bits (STM32F1XX) with a port of 16 bits and a 32-bit port to define 32 bits (LPC17XX).#pragmaAnon_unions//so that the struct or the common body does not need another nametypedef union{UINT32_T WORDS; struct{intbit00:1; intBIT01:1; intBIT02:1; intbit03:1; intbit04:1; intbit05:1; intbit06:1; intbit07:1; intbit08:1; intbit09:1; intBit10:1; intBIT11:1; intBIT12:1; intBIT13:1; intB
: Setting the direction of the IO Pin-Bit = 0: input (default)-Bit = 1: Outputpxren: Enable pin internal pull-up/pull-down, typical pull-up/pull-down resistor resistance 35KOHM-bit=0: Disable the upper/lower pull resistor function (default)-Bit=1: Enable up/down resistor functionpxin: reflects the level on the PIN-Bit=0: input is low level-Bit=1: input is high levelpxout:-When the up/down resistor is disabled, the function is to set the output level high and low--bit=0: Output High Level--bit=1:
after the bit-band operation is supported, a single bit can be read and written using normal load/store instructions. In CM3, there are two zones in which a bit band is implemented. One is the lowest 1MB range of the SRAM area , and the second is the minimum 1MB range of the inside and outside zones . The addresses in these two districts, in addition to being used as normal RAM , have their own "bit-band alias area", which expands each bit into a 32-bit word with the alias area. When you acc
(1) Makefile fileOne of the arguments in the command is: Text 00000000.2440 of the two startup modes: NAND start and NOR startNOR Flash belongs to the memory class, it can read like memory, but cannot write like memory, it must go through complicated steps to write.NAND Flash does not belong to a memory class device and has no address lines.Nor at the start of the 0 address on nor onWhen NAND starts, the 0 address is on the on-Chip SRAM,Gpio Experimen
Two ways of assembling, assembling +c***************************************Assembler Programming LED_ON.S****************************************. text. Global _start_start:LDR ro,=0x***//register address to operate GpfconMOV r1, #0x * * *//Register value to be modifiedSTR R1,[R0]LDR ro,=0x***//register address to operate GpfdateMOV r1, #0x * * *//Register value to be modifiedSTR R1,[R0]Main_loop:b main_loop***********************MakefileLed_on:led_on.sArm_linux_gcc-g-C Led_on.s-o led_on.o.Arm_
Zookeeper
Lab Purpose: Use the C language to implement the flow lamp on jz2440
Tutorial principle:
Here, an nLED_1, nLED_2, and nLED_4 is illuminated. The pins used for this pair are GPF5, GPF6, and GPF7. In GPIO, each pin has configuration registers and data registers, in this example, the configuration register is GPFCON: 0x56000050, and the data register GPFDATA: 0x56000054, [] = 01) is the output pin, and according to the circuit schematic, it can
(1#define Gpf0_reset (3#define Gpf2_reset (3#define Gpg3_reset (3#define GPF0_IN (0#define GPF2_IN (0#define GPG3_IN (0int main (){Gpfcon =~ (Gpf4_reset | Gpf5_reset | Gpf6_reset);//OutputGpfcon |= Gpf_out4 | GPF_OUT5 | GPF_OUT6;Gpfcon =~ (Gpf0_rest | Gpf2_reset);Gpfcon |= gpf0_in | gpf2_in;//the place can not be, because [x:x]=00, through the above statement has been implementedGpgcon =~GPG3_reset;Gpfcon |= gpg3_in; The service can savewhile (1){if (Gpfdat (1Gpfdat |= (1Elsegpfdat =~ (1if (Gp
Reprinted please indicate the source and author of the article Source: http://blog.csdn.net/lbmygf
1. In the board-Level Initialization File mx53_smd_c, configure the gpio1-1 to the PWM mode:/* Gpio1 for PWM */
Mx53_pad_gpio_1108pwm2_pwmo, 2.
The example is simple, mainly the button and led lamp test, Red Bull and em-stm3210e buttons and LEDs are different, so targeted on both the PIN has been defined (this information, you can directly see the development Board corresponding to the
In stm32f407, there is a structure controlling the high and low levels of the pin: Gpiox (x∈ (A, G)
Typedefstruct
{
__io uint32_t Moder; /*!
__io uint32_t Otyper; /*!
__io uint32_t Ospeedr; /*!
__io uint32_t pupdr; /*!
__io uint32_t IDR; /*!
__io
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.