Forgot to ask in my previous mail :
Do I need an other sketch for MEGA instead UNO to recognize the SD-card ?
sorry for all the troubbles I make .
Forgot to ask in my previous mail :
Do I need an other sketch for MEGA instead UNO to recognize the SD-card ?
sorry for all the troubbles I make .
Yes , I do it that way whit my radio's ( old school ). But I builded and repared so many radio's in my life time that I can do it blindly .
C++ is a whole other story - still learning every day but hard to find the right info .
I will do it on paper and then we , will see .
thanks ,
Marco
Yes, the MEGA2560 has different SPI pins. You have to use the "not_Uno" sketch and follow the instructions.
OK , I followed the instructions ( #define .....1 and SdFatSoftSpi<50, 51, 52> SD;) , I have the sketch uploaded , a blue screen and the Serial.print : cannot start SD .
So , I must do something wrong .
Marco
I checked the Library Manager. SdFat is currently v1.0.14. So I updated my SdFat library and edited my
C:\Users\David Prentice\Documents\Arduino\libraries\SdFat\src\SdFatConfig.h (around line #82)
/**
* If the symbol ENABLE_SOFTWARE_SPI_CLASS is nonzero, the class SdFatSoftSpi
* will be defined. If ENABLE_EXTENDED_TRANSFER_CLASS is also nonzero,
* the class SdFatSoftSpiEX will be defined.
*/
#define ENABLE_SOFTWARE_SPI_CLASS 1
You do not need to edit the example sketch.
David.
OK David , thanks a lot ,
I'll work tomorrow because my brain stopped after one day trying . ![]()
I have the new SDFAT master library ( latest version ) with
/**
I have MISO 50 , MOSI 51 and SCK 52
I use de MCUFRIEND_kvb_master ( latest download )
Problem now : SDFatsoftspi doen not name a type
I do something wrong but will not find out this night what it can be .
Thanks for all you did to help me but it will not work today .
have a nice evening , Marco ![]()
Good morning David ,
I deleted this morning the sdfat.master.zip in the "Add.zip.library ".
I placed the unzipped sdfat.master.file ( the whole folder ) directly in c:users.f8voa.documents.arduino.libraries ( the contributed library )
I have now following new lines in my sketch ( they appeared automaticly when I clicked on this library )
#include <BlockDriver.h>
#include <FreeStack.h>
#include <MinimumSerial.h>
#include <SdFat.h>
#include <SdFatConfig.h>
#include <sdios.h>
#include <SysCall.h>
I have no longer this " not mention a type " problem
The only warning I have is : we are using a special custom driver ( that's normal , I suppose )
but the serial outputgive still : cannot start SD
I read on the forum some answers ( from 2015 ) with the same problem .
Following this instructions I tried to change : #define SD_CS 53//10 but without results.
One thing : I plugged the screen 3.5" directly in the MEGA-board , I do not use Dupont bridges .
The screen react correctly with my rotator sketch and even with a bitmap ( no SD-card ) , but this bitmap is a very low quality .
Marco on a cloudy sunday morning.
God gave you the Library Manager.
When you build a sketch the IDE reports how much Flash / SRAM and which library versions were used.
Yes, I know you get a whole load of dross but you can paste the important lines to your message e.g.
Using library U8g2 at version 2.24.3 in folder: C:\Users\David Prentice\Documents\Arduino\libraries\U8g2
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino-1.8.1\hardware\arduino\avr\libraries\SPI
Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino-1.8.1\hardware\arduino\avr\libraries\Wire
Sketch uses 11606 bytes (35%) of program storage space. Maximum is 32256 bytes.
Global variables use 605 bytes (29%) of dynamic memory, leaving 1443 bytes for local variables. Maximum is 2048 bytes.
or
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino-1.8.1\hardware\arduino\avr\libraries\SPI
Using library SdFat at version 1.0.14 in folder: C:\Users\David Prentice\Documents\Arduino\libraries\SdFat
Using library Adafruit_GFX_Library at version 1.3.6 in folder: C:\Users\David Prentice\Documents\Arduino\libraries\Adafruit_GFX_Library
Using library Mcufriend_kbv at version 2.9.9-Beta in folder: C:\Users\David Prentice\Documents\Arduino\libraries\Mcufriend_kbv
Sketch uses 32148 bytes (12%) of program storage space. Maximum is 253952 bytes.
Global variables use 1057 bytes (12%) of dynamic memory, leaving 7135 bytes for local variables. Maximum is 8192 bytes.
I can deduce a lot of things from these lines e.g. UNO or MEGA2560, U8g2 sketch or Mcufriend_kbv, ...
and most importantly where the libraries were found.
Quite honestly. It is a nuisance to install and configure the SdFat library. You only do it once.
You do not edit the showBMP_not_Uno.ino sketch. It should run straight out of the box.
David.
I use Enable Verbose Compilation in File->Preferences to control were and what .
but I don't know how to copy all those files .
You don't have to copy any files.
You just copy-paste a few lines from the verbose compilation report.
You can copy the complete report with ctrl-A, ctrl-C.
As long as you put it in a Code Window your message is still readable.
It is just easier when you paste specific lines instead of the whole output.
Most Arduino problems go away when you use the Library Manager.
And it certainly makes it easier to reply to questions when we can see the library versions and locations.
David.
So , I deletd all files SDFAT , ....... And runned the sketch again .
I got , of course , the classic error " not installed .... " and I installed with the Library manager the latest sdfat library founded .
I runned the sketch ( I changed this line to the MEGA - SdFatSoftSpi<50, 51, 52> SD; //Bit-Bang on the Shield pins )
I copied the error information
attached this information in a txt-file.
I hope , I did all right .
Marco , a windy sunday ,
Arduino.txt (34.1 KB)
You plug the shield into the MEGA2560. The shield routes the microSD signals to 10, 11, 12, 13
Multiple libraries were found for "Adafruit_GFX.h"
Used: D:\ARDUINO ALLES\TEST ARDUINO\libraries\Adafruit_GFX_Library
Not used: C:\Program Files (x86)\Arduino\libraries\Adafruit_GFX_Library
Multiple libraries were found for "MCUFRIEND_kbv.h"
Used: C:\Program Files (x86)\Arduino\libraries\MCUFRIEND_kbv-master
Not used: C:\Program Files (x86)\Arduino\libraries\MCUFRIEND_kbv-2.9.8
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
Using library SdFat at version 1.0.14 in folder: D:\ARDUINO ALLES\TEST ARDUINO\libraries\SdFat
Using library Adafruit_GFX_Library at version 1.3.6 in folder: D:\ARDUINO ALLES\TEST ARDUINO\libraries\Adafruit_GFX_Library
Using library MCUFRIEND_kbv-master at version 2.9.9-Beta in folder: C:\Program Files (x86)\Arduino\libraries\MCUFRIEND_kbv-master
I am surprised that anything ever works at all.
leave the IDE
delete C:\Program Files (x86)\Arduino\libraries\MCUFRIEND_kbv-master
delete C:\Program Files (x86)\Arduino\libraries\Adafruit_GFX_Library
delete C:\Program Files (x86)\Arduino\libraries\MCUFRIEND_kbv-2.9.8
start the IDE
run Library Manager. install MCUFRIEND_kbv
plug shield into MEGA2560. place microSD in socket
run MCUFRIEND_kbv/examples/showBMP_not_Uno sketch
Do NOT make any edits to showBMP_not_Uno sketch
Do NOT install any Beta libraries
You should get similar memory / libraries report to the one that I showed in #27
Obviously you will use the official Release (v2.9.8 ) instead of the Beta that is on my PC.
You are not alone. Many punters use MEGA2560. They all have difficulty with installing / configuring SdFat.
Many of them have difficulty lining up the pins on a shield to mate with the MEGA2560.
David.
Thanks David , I'm a very difficult customer .
I deleted all you wrote , following every step .
Now , I have only 1 MCUFRIEND , 1 ADA..GFX aso aso ....
I must be haunted with this MEGA.
Marco
Arduino.txt (32.5 KB)
Double-check the SdFatConfig.h file
Is your ENABLE_SOFTWARE_SPI_CLASS edit still valid ?
If in doubt. Leave IDE. Delete SdFat. Start IDE. Re-install SdFat. Re-edit SdFatConfig.h
Thanks for the verbose report. It makes life much easier for me.
David.
Problem solved ,
I changed again 0 to 1 and .......
What a wonderful world we live in .
I even have a very nice Marilyn on my screen .
Thanks a lot for all your time and efforts .
Once again , I learned a lot today.
I'll send you the sketch , once finished and working.
Have a nice evening , David
Marco
Well done.
I think that the important lesson is: always use the Library Manager
If you have some User libraries in the wrong place, check that they are available from the Library Manager first.
Then delete and re-install as in #31
In the early days of Arduino, the System SD.h library could be configured for software SPI on 11, 12, 13
But you still had to edit a Config file somewhere.
In hindsight, the SdFat.h procedure was not very hard with the Library Manager.
It is the result of using a Uno Shield on Mega hardware.
The Uno shield works fine on Uno hardware.
David.
Hi David ,
As promised :
This is my first attempt.
I used a bitmap ( no SD-card ) for this sketch
All suggestions to improve the sketch are mostly welcom
Marco
characters.h (4.25 KB)
degrees.h (1.72 KB)
directions.h (1.46 KB)
motor_sketch_ellips.ino (10 KB)
world.h (117 KB)
I ran your program on a Mega2560. I suggest that you should use readID() to identify the controller. I used it with a Himax controller.
Yes, you could use the hardware instead of drawBitmap() of the world. This would be a lot faster but it is a one-off.
Iceland and Greenland look very BIG.
What antenna arrays do you use?
How far have you reached on your world map?
David.
Hi David ,
Over the years , I worked all countries all over the world .
As antenna I use a 3 el TRIBAND antenna ( home made ) , a 4 el for 15m (21 MHz ) also home made and several wire antennas ( the longest is 80 meters long )
I could change the read(ID) lines , perhaps better if someone will use the sketch .
The only problem with this sketch I have sofar , : If I turn the pot-meter ( HAM-IV potmeter ) to quick ( normally it will take one minut for 360° ), the void adjust is not working well , some information is not removed from the screen . ( potmeter = 500 Ohm on A7 + 5VDC )
Anynway , Arduino act like a drug , it's habbit-forming .
73, Marco
Hi David ,
Once more your help is wanted in the 3.5" screen matter.
I have this screen directly fixed on the MEGA like I did on a UNO .
In order to make the communication between screen and MEGA better and for all faster , I like to connect the screen with wires on the right pins ( 50 = MISO , 51 = MOSE ...and ... )
I suppose the MCUFRIEND_kbv.h is no longer usable at that moment .
Could you put me in the right direction ?
Marco