

fourtyseven
-
Content Count
8 -
Joined
-
Last visited
About fourtyseven
-
Rank
Newbie
-
I tried the /dev/mem route and got around 1.6MhZ (on a H3 based board) at best which i arrogantly concluded as 'slow'. Well that may hold true for a lot of SBC's but the major differences come down to the base address and the control/data registers address. The overflow for the BCM2835(faster gpio) with H3 is quite similar when it comes down to the interaction with the GPIO. I however cannot say the same for PWM and anything other then that. honestly i am quite impressed as i have not seen a implementation without sysfs until now. Great Work! i wonder
-
hardware hack Is GPIO on H3 SoC really this slow?
fourtyseven replied to fourtyseven's topic in Reviews, Tutorials, Hardware hacks
Okay so after some fiddling around with registers;it seems like 1.6Mhz is the best for stability and the results seems quite consistent when the pin is checked if it actually changed the register or not. #define GET_GPIO(g) (*(unsigned int *)(gpio+0x10) & (1<<g))// 0 if LOW, (1<<g) if HIGH #define GPIO_SET(g) if(!GET_GPIO(g)){*(unsigned int *)(gpio+0x10) |= (1 << g);} #define GPIO_CLR(g) if(GET_GPIO(g)){*(unsigned int *)(gpio+0x10) &= ~(1<< g);} This is still disappointing but i guess its a 'one up' from the previous results. -
Hello, I'm new here and do not quite understand the sub-forums here but hopefully this is the right one. I got an Orange pi ONE running 4.19 RT kernel with Armbian buster. I was testing out the GPIO capabilities of the H3 SoC without any libraries and got only 1.67 Mhz at best(which is ironically the same as WiringPIOP) with some task interrupt issues. #define INP_GPIO(g) *(unsigned int *)(gpio+0x04) &= ~(7 << (((g) % 10) * 3)) //I did not thoroughly check if the mapping is okay #define OUT_GPIO(g){\ *(unsigned int *)(gpio+0x04) &=