Setting Pullup/Pulldown Resistors

Moderators: lily.li, violet, jessie, chao.zhang

Post Reply
kaktus.martin
Pre-kindergarten
Pre-kindergarten
Posts: 13
Joined: Tue Dec 29, 2015 9:33 pm

Setting Pullup/Pulldown Resistors

Post by kaktus.martin » Thu Jan 07, 2016 12:02 pm

I'm think I'm a little bit out of luck.....

today I tried to program Pull UP/DOWN resitors of the pins but it doesn't worked for me. Here is my example code where I try to pullup the internal resistor of GPIO49. Other pins doesn't worked also ....

Code: Select all

#include "vmsystem.h"
#include "vmthread.h"
#include "ResID.h"
#include "vmdcl.h"
#include "vmdcl_gpio.h"

VMINT32 main_thread(VM_THREAD_HANDLE thread_handle, void *user_data)
{
	VM_DCL_HANDLE gpio_handle = vm_dcl_open(VM_DCL_GPIO, 49);
	vm_dcl_control(gpio_handle, VM_DCL_GPIO_COMMAND_SET_MODE_0, NULL);
	vm_dcl_control(gpio_handle, VM_DCL_GPIO_COMMAND_SET_DIRECTION_IN, NULL);
	vm_dcl_control(gpio_handle, VM_DCL_GPIO_COMMAND_ENABLE_PULL, NULL);
	vm_dcl_control(gpio_handle, VM_DCL_GPIO_COMMAND_SET_PULL_HIGH, NULL);

	while(1)
	{
		vm_thread_sleep(1000);
	}

	return 0;
}

void vm_main(void)
{
	//Eine Sekunde warten um dem System Zeit zu geben sich zu aktivieren.
	vm_thread_sleep(1000);

	//System Callback Funktion wird hier registriert.
	VM_THREAD_HANDLE main_handle;
	main_handle = vm_thread_create(main_thread, NULL, 200);
}
I just wonder because in the technical datasheet of the MTK2502A almost every pin is programmable to Pull UP/DOWN in mode 0
http://labs.mediatek.com/fileMedia/down ... ae990d83e3

Post Reply