Hi, i want to use the HIF PIO in I/O mode.
That's why I wrote this code:
//IOC_ACCESS_KEY – IO Configuration Access Key Register
Drv_PioGetInputs(0x00100070, &Test);
Test=Test & 0x0000FFFF;
POKE(0x00100070, Test);
//IOC_CR – IO Configuration Mask Register
POKE_OR(0x00100008, 0x40000000);
//IOC_CR – IO Configuration Mask Register
POKE_OR(0x00100004, 0x40000000);
//IOC_ACCESS_KEY – IO Configuration Access Key Register
Drv_PioGetInputs(0x00100070, &Test);
Test=Test & 0x0000FFFF;
POKE(0x00100070, Test);
//IOC_CR – IO Configuration Register
Drv_PioGetInputs(0x00100004, &Test1);Abslimo
M T
Hilscher Gesellschaft für Systemautomation mbH
The upper code is completely wrong.
1. Drv_PioGetInputs expects a handle to a PIO area. Not any absolute address you might have found somewhere in the manual.
2. If you want to use HIF Pios, you won't get far using Drv_Pio. (HIF Pio != PIO). HIF PIO registers, reside in DPMAS Area of the netX memory.
3. You will never update "IO Configuration Mask" (0x100008) register
The IO configuration register has nothing to do with the HIF PIOs, besides enabling Pin multiplexing.
If you want the external HIF Pios enabled you will need to clear Bit31 (0x80000000) in the IO Configuration Register (0x100004). But this only needs to be done once.
For using HIF PIOs take a look at the DPMAS chapter in netX Program Reference Guide (DPMAS_IFCONF, DPMAS_IO_XXXX), or use the Drv_HifPio module, which does the upper 3 codes lines internally.
The handle to the call of Drv_PioGetInputs is totally wrong (see point 1). Maybe you should take a look at the sample PIO (rcX-based) and HifPIO(lowest C-Level) examples which are freely available on the Homepage.
Regards
MT