I try to configure pin gpmc_ad8 and gpmc_ad9 of BeagleBone Black(BBB) operating as an eHRPWM (PWMSS2) in QNX RTOS as these lines of code below:
#define conf_gpmc_ad8 (0x44E10000+0x0820) #define conf_gpmc_ad9 (0x44E10000+0x0824) #define CONTROL_CONF_MUXMODE(n) (n) uintptr_t GPMC_AD8_REG = mmap_device_io(4, conf_gpmc_ad8); if(GPMC_AD8_REG == MAP_DEVICE_FAILED) { perror("Can't map GPMC_AD8_REG"); return 0; } reg_val = CONTROL_CONF_MUXMODE(4); out32 (GPMC_AD8_REG, reg_val); usleep(10000); stt_done = in32(GPMC_AD8_REG); printf("CONTROL_CONF_GPMC_AD8 = %x (#4)\n", stt_done); uintptr_t GPMC_AD9_REG = mmap_device_io(4, conf_gpmc_ad9); if(GPMC_AD9_REG == MAP_DEVICE_FAILED) { perror("Can't map GPMC_AD9_REG"); return 0; } reg_val = CONTROL_CONF_MUXMODE(3); out32 (GPMC_AD9_REG, reg_val); usleep(10000); stt_done = in32(GPMC_AD9_REG); printf("CONTROL_CONF_GPMC_AD9 = %x (#4)\n", stt_done);
But I can not change mode of pin AD8 and AD9 to EHRPWM2A and EHRPWM2B. Value of 2 registers are always equal 0x27 (maybe this is an default value). Anyone who has experiment with QNX can help me pls. Thanks so much.