Touchscreen.h

And kindly let me know if you are familiar with Softwareserial

I want to convert digital pins other than 0 and 1 to UART pins for my sensor.
Library is there for AVR boards but i couldnt find it for Hifive1.

Yes,
Definitely i will try it out
Thanks a lot

I’ve heard of it :slight_smile: I see it uses interrupts. The HiFive1 supports edge and level interrupts on every GPIO pin. I don’t actually know offhand whether attachInterrupt() has been implemented in the Arduino environment, but you can definitely do it from plain C. You can read about that in the E300 Platform Reference Manual. You’ll need assembly language if you write your own interrupt handlers. “attribute ((interrupt))” has recently been added to RISC-V gcc to enable interrupt handlers to be written in pure C but I don’t think the Arduino package has been updated to include that.

okay:+1:
Thank you.:slightly_smiling_face:


I think they are Sifive people!!
These people had tested with touch display shield ,if they could tell the library that they used it would be good .I can try it out with my breakout board.

Interesting. I hadn’t seen that video or those prototype boards before! And those have to be @mwachs5 hands holding that board+shield.

1 Like

yes

Yes, we have ported the Adafruit touchscreen library to the HiFive1. You can find it on our SiFive github:

The compile errors you’re getting may be an Arduino version compatability issue. What version of the Arduino IDE are you using?

1.8.5

This version was mentioned in the hifive1 getting started guide.So i followed the link.

The issue is that…

… does a #include of TouchScreen.h which is not included in that repo, and not in either our or the standard Arduino IDE download.

And then the YP and XM defines in breakouttouchpaint.ino “must be an analog pin”, which the HiFive1 does not have any of.

Yes,even i wanted to say that.

My breakout board is working!!

Compiled with freedom-e-SDk not with Arduino ide:smiley:

Touch functionality is still pending , struggling with ADC ,I dont know much about ADC ,and which one should be selected for this project!

Another issue , my program gets vanished once the power is removed and need to flash the code again.
what is the solution to run the program from non-volatile memory?

Oh! You must have one of the boards that accidentally went from the factory without the flash being programmed correctly. This has actually happened in two different ways at different times, but in both cases you can correct the problem by following the instructions at Arduino programing lost after reset/powercycle

As for ADC, I think absolutely any discrete ADC is going to be as good or better than what is built into the AVR chip on a standard Arduino. This one looks pretty cheap https://www.adafruit.com/product/856 but I suspect it might work out slightly easier to interface to one with I2C rather than SPI if you don’t need super high speed so maybe this one https://www.adafruit.com/product/1083

There’s a lot of information on how to use that I2C breakout board (and its higher precision but slower cousin) at https://learn.adafruit.com/adafruit-4-channel-adc-breakouts

1 Like

Thank you…Bruce.
Really helpful.

Actually i am comfortable with software spi ,will it be ok with MCP3008??
or should i try for software i2c alone?

I’m sure that will be fine.

Thank you.

I feel little bit difficult in pin connections between breakout touch screen display https://www.adafruit.com/product/1770 and MCP3008, i tried breakout paint example, when i touch in one place it prints some where else.

So can i go ahead with STMPE610 resistive touch screen controller?https://www.adafruit.com/product/1571
it has SPI also.