Larry Bank

Members
  • Content Count

    161
  • Joined

  • Last visited


Reputation Activity

  1. Like
    Larry Bank got a reaction from gounthar in ArmbianIO API proposal   
    I was chatting with @tido about ways to help the Armbian community and I came up with the idea of a common C library to access the I2C, SPI and GPIOs of all supported boards. There are of course kernel drivers to communicate with these things, but there are differences between boards that this API could help smooth out. For example, different CPUs (and boards) map the GPIO pins very differently. Projects such as WiringOP and WiringNP try to copy the Raspberry Pi library, but this is also flawed because it's based on the BCM283x GPIO numbering. What I propose is to create a set of simple functions for accessing GPIO pins using the physical pin number as a reference. On all boards, the 5V pin will be considered pin 2 and the numbering goes from there. There are also sometimes pushbuttons present on the board which are mapped to GPIO inputs. These are also covered by my API. Much of the code is already written and I will release it shortly.  I'm posting this topic to get feedback and to reach out to people who might make use of this. Here is a list of the functions so far:
     
    int AIOInit(void);
    void AIOShutdown(void);
    const char * AIOGetBoardName(void);
    int AIOOpenI2C(int iChannel, int iAddress);
    int AIOOpenSPI(int iChannel, int iSpeed);
    int AIOCloseI2C(int iHandle);
    int AIOCloseSPI(int iHandle);
    int AIOReadI2C(int iHandle, int iRegister, unsigned char *buf, int iCount);
    int AIOWriteI2C(int iHandle, int iRegister, unsigned char *buf, int iCount);
    int AIOReadSPI(int iHandle, unsigned char *buf, int iCount);
    int AIOWriteSPI(int iHandle, unsigned char *buf, int iCount);
    int AIOReadWriteSPI(int iHandle, unsigned char *inbuf, unsigned char *outbuf, int iCount);
    int AIOReadButton(void);
    int AIOAddPin(int iPin, int iDirection);
    int AIORemovePin(int iPin);
    int AIOReadPin(int iPin);
    int AIOWritePin(int iPin, int iValue);
  2. Like
    Larry Bank got a reaction from tkaiser in Testing NanoPi NEO Core for gaming potential   
    Update: Everything working now. These issues are resolved:
     
    1) Constant hangs were due to the cheap wifi adapter. It would hang the ssh session after 5-10 minutes of use. Switched to a better one and it now works reliably
    2) GPIO didn't behave the same as other systems. I had to add lseek(handle, 0, SEEK_SET) before each read from a GPIO pin. I should have done it earlier, but other machines seem to work without needing that
    3) Now I need to solder a 3.5mm socket onto the analog audio out to hear the output...
     
    Here's a video of it in action:
     
    https://photos.app.goo.gl/zLZS3Pw3iABCXVkK9
     
  3. Like
    Larry Bank got a reaction from tkaiser in Testing NanoPi NEO Core for gaming potential   
    Today's project is trying to get my game emulator to run on the NanoPi NEO Core board. Lots of exposed I/O, but I'm getting random hangs and some odd behavior with the latest Armbian. In the photo is a ILI9342 (landscape version) 2.3" display and some ugly protoboards I created to allow reliable wiring + sockets for the Core board. I just updated my SPI_LCD project to include support for both the ILI9342 and the Core board's strange header: https://github.com/bitbank2/SPI_LCD
     
    I had to wire the USB-A socket to the header because the OTG port is not properly enabled (in the available Armbian build). If I spent some time messing with it, there's probably a bunch of patches to get it working, but soldering 4 wires seemed like the quicker fix for me.
     
    I'll keep you posted on my progress (if anyone is interested)
     
     

  4. Like
    Larry Bank got a reaction from tkaiser in Animated GIF player for framebuffer and SPI LCD   
    I just released some new code on github to play animated GIF files directly on a Linux framebuffer or SPI LCD (using my SPI_LCD code). It doesn't have any 3rd party dependencies and can easily be made to run on systems with no operating system or file system. This is part of my imaging library that I've been working on for more than 20 years. I'm slowly releasing parts of it as open-source. This code was sliced out of a much larger project which supports a whole bunch of image formats.
     
    https://github.com/bitbank2/gif_play
     
    Comments/feedback welcome.
     
  5. Like
    Larry Bank got a reaction from tkaiser in Animated GIF player for framebuffer and SPI LCD   
    I just released some new code on github to play animated GIF files directly on a Linux framebuffer or SPI LCD (using my SPI_LCD code). It doesn't have any 3rd party dependencies and can easily be made to run on systems with no operating system or file system. This is part of my imaging library that I've been working on for more than 20 years. I'm slowly releasing parts of it as open-source. This code was sliced out of a much larger project which supports a whole bunch of image formats.
     
    https://github.com/bitbank2/gif_play
     
    Comments/feedback welcome.
     
  6. Like
    Larry Bank got a reaction from jscax in Pushing the I2C SSD1306 OLED to its limits   
    Thanks for the response. I took the path of least resistance and tested it on a Raspberry Pi Zero. On that platform I can edit the /boot/config.txt to change the I2C speed. It maxes out at 400Khz no matter what value you give it. That's fast enough to do decent animation:
     
     
    I wrote a blog post and shared the code on github:
     
    http://bitbanksoftware.blogspot.com/2018/05/practical-animation-on-i2c-ssd1306.html
     
  7. Like
    Larry Bank got a reaction from jscax in Pushing the I2C SSD1306 OLED to its limits   
    Thanks for the response. I took the path of least resistance and tested it on a Raspberry Pi Zero. On that platform I can edit the /boot/config.txt to change the I2C speed. It maxes out at 400Khz no matter what value you give it. That's fast enough to do decent animation:
     
     
    I wrote a blog post and shared the code on github:
     
    http://bitbanksoftware.blogspot.com/2018/05/practical-animation-on-i2c-ssd1306.html
     
  8. Like
    Larry Bank got a reaction from TonyMac32 in Armbian-Stretch and IR-Remote?   
    I created a NEC IR code receiver. It's really pretty simple. The IR receiver on These ARM SBCs is just a digital signal connected to a GPIO pin. I shared a demo program on GitHub here:
     
    https://github.com/bitbank2/ir_receiver
     
  9. Like
    Larry Bank got a reaction from Vincen in H6 boards: Orange Pi One Plus, Orange Pi 3 Plus and Pine H64   
    It will probably be months (years?) of software problems before a decent Linux distro works on it, but I ordered one anyway  
  10. Like
    Larry Bank got a reaction from Gravelrash in HX1230 LCD (96x68 monochrome)   
    I just received a couple of these inexpensive LCD displays ($1.82 each shipped). They are very low power and look good. I've got them working on Arduino and will now be converting the code to Linux. If anyone is interested in these, let me know. I'll edit this post to add the github link when it's ready.
     

  11. Like
    Larry Bank reacted to Igor in H6 boards: Orange Pi One Plus, Orange Pi 3 Plus and Pine H64   
    First Pine H64/H6 mainline testing images based on @Icenowy patchset https://dl.armbian.com/pineh64/ Boot log: http://ix.io/18DU
  12. Like
    Larry Bank got a reaction from TonyMac32 in ArmbianIO API proposal   
    I just published a simple C project to make use of the IR receiver (either on-board or connected to an arbitrary GPIO):
     
    https://github.com/bitbank2/ir_receiver
     
    It's basically the simplest C code to receive IR codes without the use of external libraries or kernel drivers. It depends on a reasonably accurate system clock. This works fine on Armbian running on OrangePi boards, but doesn't work on my RPI3B.
  13. Like
    Larry Bank reacted to chwe in Why is the Tinker Board GPIO ports so slow?   
    Attachments are not visible... 
     
    to my knowledge, we don't deliver wiringPi with armbian.. So, did you install it or do you use TinkerOS (whitch is no part of Armbian)?
     
    From a quick google search, I might be wrong, but tinkers wiringPi has a 'fallback' to sysFS (/sys/class/gpio) and RPis wiringPi is based on gpiomem (writing direct to the SoCs registers). sysFS in known to be slower than gpiomem. 
     
    in development branch we do provide a rootless gpiomem access, but at the moment you have to build those images on your own.
    https://github.com/armbian/build/pull/907
     
    You might build your own image and test wiringPi again and look if this speeds up the process. Just as a side-note, I've only tested if it works, I didn't do any performance tests, simply cause I don't have any oscilloscope to 'benchmark' the speed.  
     
    How to build images:
    https://docs.armbian.com/Developer-Guide_Build-Preparation/
    How to switch to development branch:
    LIB_TAG="development"
     
    Edit:
    and otherwise, you can test ArmbianIO from @Larry Bank which is also based on sysFS but might be a bit more 'lightweight'.. Not sure, cause I didn't do 'benchmarking' and I don't know if somebody ever tried to get at it's limit.. 
  14. Like
    Larry Bank got a reaction from chwe in ArmbianIO API proposal   
    ** Update **
    I just added support to the ArmbianIO project for accessing the on-board IR receiver (connected to GPIO PL11 on many Orange Pi boards). Use the macro "IR_PIN" when reading the signal from the receiver (instead of specifying the header pin number). I will be releasing a demo app shortly which receives NEC ir codes without the use of the LIRC driver. My demo app will allow you to connect any IR receiver to any available GPIO pin or use the built-in one if present. The IR codes can be received with a simple 1-bit port without the use of a UART by simply timing the on/off signal to a reasonable margin of error using the Linux clock functions.
     
  15. Like
    Larry Bank got a reaction from chwe in ArmbianIO API proposal   
    ** Update **
    I just added support to the ArmbianIO project for accessing the on-board IR receiver (connected to GPIO PL11 on many Orange Pi boards). Use the macro "IR_PIN" when reading the signal from the receiver (instead of specifying the header pin number). I will be releasing a demo app shortly which receives NEC ir codes without the use of the LIRC driver. My demo app will allow you to connect any IR receiver to any available GPIO pin or use the built-in one if present. The IR codes can be received with a simple 1-bit port without the use of a UART by simply timing the on/off signal to a reasonable margin of error using the Linux clock functions.
     
  16. Like
    Larry Bank got a reaction from chwe in RPi SenseHAT on Tinkerboard   
    I wrote some C code to talk to the sense hat from Armbian. The display works fine and so do the sensors:
     
    https://github.com/bitbank2/sense_hat_unchained
     
     
  17. Like
    Larry Bank got a reaction from MitchD in UC1701 LCD library   
    I just released a new C library to draw text and graphics on the UC1701 128x64 monochrome LCD. It makes use of my ArmbianIO library to manipulate the GPIO lines:
     
    https://github.com/bitbank2/uc1701

  18. Like
    Larry Bank got a reaction from guidol in Real time clock DS3231   
    It's not a battery soldered on to that small module, it's a tiny supercapacitor
  19. Like
    Larry Bank got a reaction from chwe in 4-digit LED (TM1637) library for Armbian + Linux   
    I just released a new C library for communicating with those inexpensive 4-digit 7-segment LED displays:
     
    https://github.com/bitbank2/tm1637
     
    They can run on 3.3V or 5V and draw between 1 and 15mA depending on the brightness setting. I purchased mine from an AliExpress vendor for 68 cents each with free shipping.
    They use a custom 2-wire communications protocol and must be "bit-banged" from 2 GPIO pins. In my demo, I assign pins 38 and 40 on my Orange Pi Lite.
     

  20. Like
    Larry Bank got a reaction from Igor in I2C not working on Orange pi zero   
    Thanks for mentioning that @Igor, I share a lot of code, but rarely get any feedback that people are using it.
  21. Like
    Larry Bank got a reaction from Igor in I2C not working on Orange pi zero   
    Thanks for mentioning that @Igor, I share a lot of code, but rarely get any feedback that people are using it.
  22. Like
    Larry Bank got a reaction from Igor in I2C not working on Orange pi zero   
    Thanks for mentioning that @Igor, I share a lot of code, but rarely get any feedback that people are using it.
  23. Like
    Larry Bank got a reaction from TonyMac32 in MAX7219 library   
    I just released a simple library for the MAX7219 LED matrix controller. It allows controlling any number of cascaded controllers in a very simple way. I tested it on an Orange Pi Lite. Even though it says it needs 5V, I ran the board @ 3.3v, it worked fine and didn't require any 3.3v->5v level converters.  Here's the code:
     
    https://github.com/bitbank2/MAX7219
     
    And a video of it in action:
     
    https://photos.app.goo.gl/iO66bsy6Wk13lT1y2
     
  24. Like
    Larry Bank reacted to peter12 in TV out lower resolution   
    H there, 
    I am using OPi0 TV out. I know, there are hardcoded PAL and NTSC resolutions only. But I would like to ask, if there is any tutorial how to build it up with my own lower resolution e.g. 320x240? (i know I should recompile driver for it but any help where to start is appreciated)
     
    Many thanks.
  25. Like
    Larry Bank reacted to Strontium in Orange Pi Zero (H2+/H3) TV Out on Mainline, WORKING   
    Well it took me longer than i hoped but i have managed to forward port icenowys code for TVE on the H2+/H3 to mainline armbian.  It seems to work totally fine, with a few caveats.
    First: Sample images of it in action -> https://imgur.com/a/vXQEM
    Second: the patch itself -> https://github.com/stevenj/h3-tve/tree/v0.0.11
    Third a prebuilt image for Orange Pi Zero: -> https://github.com/stevenj/h3-tve/releases/tag/v0.0.11
     
    Howto:
    just put the patch into userpatches for the sunxi-next kernel, and build.  it should apply cleanly. Its for H2+/H3.  I have only tried it on a orange pi zero, but it should work on all H2+/H3 boards.
     
    You then need to edit /boot/armbianEnv.txt
    add tve to overlays to enable it.  the driver will only run and enable tv out when the tv out devices are specifically enabled, so i created an overlay which does this.  If you want to turn TV out off, just remove tve from the overlays line.
    My armbianEnv.txt overlays looks like this:
    overlays=usbhost2 usbhost3 tve If you want copious amounts of DRM debug info in your logs, add this as well:
    extraargs=drm.debug=0xF Its not needed, unless you really want the debug info.
     
    Notes:
    1. The default mode is PAL, with 720x576 resolution.  Thats outside of normal PAL displayable area, and so the screen overscans.
    I dont know how to correct this, although its mostly just annoying with terminals.
    I also don't know how to change the video mode to NTSC.
     
    2. The standard font is a bit thin for composite video, and causes slight strobing and color impurity.  Its because PAL needs pixels to be a certain MINIMUM width or color information can not be properly encoded.
    A way to resolve this is use :
    # apt-get install fbterm ... $ fbterm -s 20 This will run a terminal which is easy to change the font, and pick a bigger one.  its much easier to read.  Look at the help for fbterm to work out everything it can do.
     
    3. I used the program "fim" to display the test images.  there are others for doing stuff on the terminal.
     
    4. I haven't tried X.  I am not interested in running an X terminal on a TV, but it should probably work fine.
     
    Other than that it all seems good.  I originally tested my hardware with the legacy kernel, and the image quality from this patch seems superior to what the legacy kernel produces. (legacy was noisy)
     
    The only other thing you need to know is Orange Pi Zero is missing filter circuity from its Composite Output, the most important thing you need to do is put a 50 ohm resistor between the signal and GND.  i soldered one inside my RCA connector, it fits fine and isn't too difficult.  IF you don't do this the image will bloom and look like total crap, so you have been warned.
     
    As this patch allows TVE to be enabled/disabled through use of the Device Tree overlays, i think it should be fine if the Armbian devs want to include it.  I am happy to clean out some of the debug messages i added if they are interested in making a standard part of the build.  If not, its easy enough to build your own image, just follow the guides on how to rebuild armbian.
     
    EDIT: I need to mention, all props go to Icenowy Zheng who wrote the original driver.  I just tweaked the device tree stuff and got it in a state where it can apply cleanly to the armbian mainline kernel and build system.
    Original code is here:
    https://github.com/Icenowy/linux/tree/tve-v2