Hi All,
I am currently trying to use a mcu_friend 3.5" TFT (with touch sensitive screen) on a chipKit Uno32 board. I think it is close to be ok, but i can not display anything on the screen I can only get ID, width and height, and it is right!
here is the code i added to the mcufriend_shield.h library for compatibility:
I had some issues with the pic32 RB4 output (LCD_WR), which seemed to be uncontrolled, but i solved the problem, setting the ODCB register to 0 (it controls open drain outputs).
Curiously i can get ID, width and height informations, but nothing displays on the screen.
I tried to add some WRITE_DELAY and READ_DELAY in the write8/read_8 functions but nothing better happened
I have two questions:
Is there anyone knowing something about that issue?
If the problem is solved, where can i upload the patched library?
Thanks a lot
Dominique
Are you are sure that this wiring is correct?
Should you use RG3 instead of PB4 ?
I have checked your macros. (by printing on paper). I am impressed. You have got them correct.
Having never used PIC32 I assume that TRISx registers work like PIC18 TRISx
With all the bit-shifts I doubt that you will need any write delays. But you can add as many as you like.
What ID do you receive?
Have you forced the ID e.g. tft.begin(0x9486);
Hi David,
Thank you for your answer
I have got some few arduino boards but i have that chipKit board for many years (When i started playing with arduinos i bought that board because i believed it was an arduino ) Then i bought real arduinos (but I used some Pics before (16f and 18f))
About the wiring, yes i am sure about it (i agree with you, that it is very stange )
Yes TRISx is the dir register .
About the macros, i had to study how the other macros (for other boards) work to write my own thanks to the guy who wrote them! i am pleased that you are impressed
The ID it returns is 0x6814, it is the same that my arduino mega's got ( the screen works perfectly with mega2560 board)
I will try by forcing that ID (i remember that i tried another one but still same effect )
I will try to ask on Github, thanks for the piece of advice
(maybe my english seems strange, it is because i am french )
Thanks again!
Dominique.
You must select the A4 pin by JP6
You need to disable JTAG because you need A3, A4 as control signals LCD_CS, LCD_RST
I don't know whether any "Arduino ChipKit Core" interferes with the header sockets used by the display.
You can use pinMode(pin, OUTPUT) for 2-9, A0-A4 before you call tft.begin(0x6814);
I will try this. i have already tried to disable JTAG, but the JTAGEN name is not known by the system (i will find what is its right name), the open drain register fixed the first issue, so i forgot to manage with the jtag
Thanks again,
dominique
Here is some lines i had to the main code before asking on the forum
I had to put that lines to have the good IDs:
if i do not deactivate the opendrain with that command
ODCB=0x00;
I get ID=0x00 (because control line could not work properly)
and i had to put the TRISB line in the code to get 0x6814, instead, i got 0xD3D3.
TRISB &= ~0x1514; //0001 0101 0001 0100
With the PIN_OUTPUT macro you guessed to correct, i expected that the TRISB line will not be usefull at all. but 0xD3D3 just came back, so i had to uncomment the TRISB code line
Maybe i have to find a small bug somewhere in my macros ...
Ok! That explains why i get a bad ID if i remove TRISx command before tft.readID() (which is before the tft.begin()
seems we can not put it in constructor
ok for the macro extension
I am a bit confused, i was looking for "re download" the library on github, and i noticed that YOU are the author of that library!! many many many thanks to help me and take time for !!! it is an amazing job you've done with that library!!
Me again , (the display still not works )
The PicKit works at 80Mhz, is there a chance that WR_STROBE is not long enough? as you suggested it, i will experiment ...
the different timings i can test are WRITE_DELAY, READ_DELAY (not sure since readID works fine) WR_STROBE ?
Another thing, picKit is 3.3V, i do not think it would be a problem, do you?
Apologies for the wrong ODCx offset. I typed from a different PC. I have edited #8
I would expect the Beta on GitHub to work with your conditional block. i.e. with the amended PIN_OUTPUT() macro. No changes in sketches.
If readID() works correctly the other methods should work too.
3.3V GPIO is no problem. In fact it solves the Mcufriend pcb design errors. i.e. HC245 instead of LVC245 buffers.
Your board has a 3.3V pin and a 5V pin. Both pins can provide sufficient current to the backlight.
The missing AMS1117 is no problem for your ChipKit.
The DELAY macros are used on 200MHz Cortex-M4 and Cortex-M7 targets. 80MHz is ok.
I will put a test Branch on GitHub tomorrow if you are still having problems.
Hello David,
It works on a Mega, but i do not have UNO (i have nanos) I will have a DUE in a short time (it is somewhere between the seller and my home )
my tft board has HC245 (directly powered by 3.3) and no AMS1117, and the screen does not get hot .
I made a test last night, I just put some leds instead of the screen on the control line (i wish i had my oscilloscope (with a logic analyzer inside) it is at work but i can not go there because of covid... )
I saw something strange, CS pin blinks off regularly and when it blinks off there is also a small fast blinking (on the mega). On the chipKit, almost same thing: the CS has a long blink off, but it is the wr pin which blinks fastly!
So, is there another point where there is a test with board selection in the code? i did not find anywhere, but i am sure you know about it
Dominique
I have put a "test_Uno32" Branch on GitHub. Obviously untested.
If you have a GitHub account you can simply change Branch on your local PC.
If not, you should select "test_Uno32" instead of "master" branch on GitHub. Download ZIP.