Far Memory

In the new update pakage there is a subdirectory ..\c51\examples\farmemroy\4MB variable on clasic 8051, the project file "Far 8051" in this DIR can be compiled correct without any error,but when I use the uv2 DEBUG to test the result,
the following phrases and sentences can not work properly:
for (i = 0; i < sizeof (large_array0); i++) {
large_array0[i] = (unsigned char) i; // just an example
large_array1[i] = (unsigned char) i+0x80; // just an example
}
for (i = 0; i < 20; i++) {
printf ("\nRead large_array1[0x%X]=%bX", i, large_array1[i]);
}

can not printf any infomation on the serial window, please tell me what's the matter? are this a BUG?

Parents
  • For a start, please use the &ltpre&gt and &lt/pre&gt tags, so taht we can follow the code you post:

    for (i = 0; i < sizeof (large_array0); i++) 
    {
       large_array0[i] = (unsigned char) i;      // just an example
       large_array1[i] = (unsigned char) i+0x80; // just an example
    }
    for (i = 0; i < 20; i++) 
    {
       printf ("\nRead large_array1[0x%X]=%bX", i, large_array1[i]);
    }

    Putting aside the Far memory, can you get printf to work at all?
    If you just use "ordinary" memory, does it work?

    What data type is i?
    Do you need to add a size specifier; eg, 'L' for long?
    (search this forum for printf problems - and see Appendix F in the manual)

Reply
  • For a start, please use the &ltpre&gt and &lt/pre&gt tags, so taht we can follow the code you post:

    for (i = 0; i < sizeof (large_array0); i++) 
    {
       large_array0[i] = (unsigned char) i;      // just an example
       large_array1[i] = (unsigned char) i+0x80; // just an example
    }
    for (i = 0; i < 20; i++) 
    {
       printf ("\nRead large_array1[0x%X]=%bX", i, large_array1[i]);
    }

    Putting aside the Far memory, can you get printf to work at all?
    If you just use "ordinary" memory, does it work?

    What data type is i?
    Do you need to add a size specifier; eg, 'L' for long?
    (search this forum for printf problems - and see Appendix F in the manual)

Children
More questions in this forum