• The below code (as published on espruino.com) yields:

    ERROR: INTERNAL: Timeout on SPI RX
    

    whenever the touchscreen is drawn upon.
    Have tried different setIntervals ranging from 10 to 100 touchFinc but with no change -any ideas?

    this is observed with Espruino 1v39

    var onInit = function () {
    	  SPI1.setup({sck:A5,miso:A6,mosi:A7})
    	  SPI1.send([0x90,0],A4); // just wake the controller up
    	};
    
    var touchFunc = function () {
    	  if (!digitalRead(B6)) { // touch down
    	    var d = SPI1.send([0x90,0,0xD0,0],A4);   
    	    var pos = {x:(d[1]*256+d[2])*LCD.WIDTH/0x8000, 
    	               y:(d[3]*256+d[4])*LCD.HEIGHT/0x8000};
    	    touchCallback(pos.x, pos.y);
    	    lastPos = pos;
    	  } else lastPos = null;
    	};
    
    var touchCallback = function (x,y) {
    	  if (lastPos!=null) { 
    	    LCD.drawLine(x,y,lastPos.x,lastPos.y,0xFFFF);
    	  }
    	};
    
    onInit();setInterval(touchFunc, 50);
    
  • I think this was a regression on 1v39 - it does work on the latest version in Git. You just need to hang on until I release a new one - or you can use an unofficial nightly build: https://espruino-nightly.noda.se/

  • I saw on another post somewhere .... was getting alot of Timeout on SPI Rx errors....

    Someone suggested changing the SPI1.setup to read....

    SPI1.setup({sck:A5,miso:A6,mosi:A7,baud:100000})

    This actually worked for me on a different LED project that was reading a touch screen.

    hope this works for you

  • Great - thanks for the update. I think this is an issue with older versions of Espruino - unfortunately as you'll be aware, newer versions don't work reliably on the HY-32 boards at the moment :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

internal SPI timeout on 3.2" HY board using published code example for servo laser control

Posted by Avatar for neil @neil

Actions