1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

ARM Cortex

Discussion in 'ARM' started by millwood, Jun 20, 2009.

  1. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    hey :D i got another GLCD issue. I know im a pain in the butt.... but when using proteus is it supposed to show like this? I have used the equevilent code on a PIC and it works but for this proteus it doesnt seem to show it right:
    Code (text):

    void PutMsg(unsigned char left, unsigned char tLine, unsigned char *msg){
    unsigned char side;
    screen_left = left;
    screen_line = tLine;

            if(screen_left > 64){
                screen_left -= 64;
                SetPin(GLCD_CS1);
                ClrPin(GLCD_CS2);
                side = 1;
            }else{
                SetPin(GLCD_CS2);
                ClrPin(GLCD_CS1);
                side = 0;
            }

            GLCD_Write_Cmd(0xB8+screen_line);
            GLCD_Write_Cmd(0x40+screen_left);

        while(*msg){
            if(screen_left > 63){
                screen_left=0;
                if(side == 0){
                    SetPin(GLCD_CS1);
                    ClrPin(GLCD_CS2);
                    side = 1;      
                    GLCD_Write_Cmd(0xB8+screen_line);
                    GLCD_Write_Cmd(0x40);
                } else {
                    screen_line+=1;
                    SetPin(GLCD_CS2);
                    ClrPin(GLCD_CS1);
                    side = 0;
                    GLCD_Write_Cmd(0xB8+screen_line);              
                    GLCD_Write_Cmd(0x40);
                }
            }

            PutChar(*msg++);
            screen_left += 8;
           
        }
           
    }
     
    [​IMG]

    If i change the 63 to a 95 it works fine but there are only 64 pixels on each CSx am i right? so this would have to count to 64
     

    Attached Files:

    • text.jpg
      text.jpg
      File size:
      26.7 KB
      Views:
      401
  2. millwood

    millwood Banned

    Joined:
    Jun 17, 2009
    Messages:
    191
    Likes:
    2
    you will have to consult the datasheet for your display for that. for some of them, you just pull down both cs0/cs1 and tread both halves as one continuous page from 0 - 127.

    try that to see if it works.
     
  3. Salgat

    Salgat New Member

    Joined:
    Nov 23, 2007
    Messages:
    195
    Likes:
    7
    Location:
    Michigan, US
    I currently work with the LM3S8962 microcontroller for my research group, so I may be able to help if you have questions. However, my work has been with adding support to the operating system (such as I2C recently), the firmware I work on already has the hard stuff done for me (the NVIC seemed really goofy to work with at first haha). Our group bought a really cheap LM3S9B92 eval board but unfortunately OpenOCD is not working for me for it.
     
    Last edited: Jun 23, 2009
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. DirtyLude

    DirtyLude Well-Known Member

    Joined:
    Aug 5, 2003
    Messages:
    1,904
    Likes:
    56
    Location:
    Toronto, Canada

    I have a couple LM3S811 on my Digikey order sheet, but all the transceivers I want are currently out of stock, so I'm holding the order until they get something in. I just plan to play with them a bit. My initial optimism is a little worn on these things. 128k and 256k parts are pretty close to ARM7 prices on Digikey.
     
  6. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    There are 128 Pixels on the screen but split in half

    CS1 (side LEFT)
    CS2 (side RIGHT)

    Those lines are active low. If i set both low then i am writing to both at 1 time. There is no way to set it to write to 0 - 127 pixels. Its 0-63(left) then 0-63(right) which is what my code does.

    The image above shows 8 Characters on left and right. Each character is 8x8 Pixels. Now if there are 8 on the left 8x8CHAR * 8 times = 64 Pixels for 8 chars. Since there are eight on each side and a huge gap in the middle im thinking its a proteus issue.
     
  7. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    hey guys i just noticed with uVision when you create a project it makes a startup.s file. As default this enables the PLL which in turn amps the 10mhz crystal into 40MHz. Maybe im moving too fast through code. The LCD can go about 300kHz.

    So the delays should be more like:
    Code (text):

    void Delay_uS(unsigned long time){
        unsigned long x,y;
        for(x=0;x<time;x++){
            for(y=0;y<10;y++){
                ;
            }
        }
    }
    void Delay_mS(unsigned long time){
        unsigned long x;
        for(x=0;x<time;x++){
            Delay_uS(1000);
        }
    }
     
     
  8. millwood

    millwood Banned

    Joined:
    Jun 17, 2009
    Messages:
    191
    Likes:
    2
    jason, the font looks like 5+1 font (5 columns of letters + 1 empty column). so 6*8=48, and you are short of 64-48=16 columns, which may be that gap.
     
  9. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    lol you was close....
    its 7 bytes long but the loop ends then it adds a 0x00.
    It has special code for font 0x55 is supposed not print. Like if the loop encounters a 0x55 in the loop it doesn't put it on screen. I guess i was retarded back then lol... so i edit the code and not its GREAT!
    [​IMG]
    Code (text):

    void PutChar(unsigned char data){
    unsigned char i,d;
        if(data >= 0x20){
            data -= 0x20;
            for(i=0;i<7;i++){
                d=Font[data][i];
                if(d == 0x55)
                    GLCD_Write_Data(0x00);
                else
                    GLCD_Write_Data(~d);
            }
        }
            GLCD_Write_Data(0x00);      //Noir sur Blanc
    }
     
    I will edit the font to show only the 8x7 and remove the blank 0x00
     

    Attached Files:

    • font.jpg
      font.jpg
      File size:
      27.8 KB
      Views:
      402
    Last edited: Jun 23, 2009
  10. millwood

    millwood Banned

    Joined:
    Jun 17, 2009
    Messages:
    191
    Likes:
    2
    char '\' is a control sequence in C. to print it, you have to print it twice.
     
  11. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    This GLCD Stuff is killing me lol im going to start from scratch but this time im going to learn about the LPC2106 OSC. And try my best to get timing down pack.

    I know how to control pins, create ports and get input from a Pin/Port so now i need to know how the PLL and stuff fits in with that startup.s file :D
     
    Last edited: Jun 23, 2009
  12. millwood

    millwood Banned

    Joined:
    Jun 17, 2009
    Messages:
    191
    Likes:
    2
    Jason, you can control the startup.s file through a GUI, in case you haven't noticed.
     
  13. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    yeah i noticed it... i disabled all PLL stuff and doing it in CODE. Simpler to me.
    Code (text):

    void init_PLL(void)
    {
        PLLCFG = 0x00000024;    //Set Multiplier and Divider of PLL to give 60MHz
        PLLCON = 0x00000001;    //Enable the PLL

        PLLFEED = 0x000000AA;   //Update PLL registers with feed sequence
        PLLFEED = 0x00000055;  

        while(!(PLLSTAT & 0x00000400));     //Test Lock bit

        PLLCON = 0x00000003;    //Connect the PLL

        PLLFEED = 0x000000AA;   //Update PLL registers with feed sequence
        PLLFEED = 0x00000055;  

        VPBDIV = 0x00000002;    //Set the VLSI peripheral bus to 30MHz
    }
     
     
  14. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Small nice BLINK.C ... i made the delays they seem to work as supposed to but not 100% sure :D
    Code (text):

    #include <LPC210x.h>
    #define LED 0

    void SetPin(unsigned long tPin){
        IOPIN = IOPIN | (1<<tPin);
    }
    void ClrPin(unsigned long tPin){
        IOPIN = IOPIN & ~(1<<tPin);
    }
    void delayus(unsigned int time){
        unsigned int x, delay;

        for(x=0;x<time;x++){
            for(delay=0;delay<8;delay++){
                ;
            }
        }
    }
    void delayms(unsigned int time){
        unsigned int x, delay;

        for(x=0;x<time;x++){
            for(delay=0;delay<7540;delay++){
                ;
            }
        }
    }
    void init_PLL(void){
        PLLCFG = 0x00000024;    //Set Multiplier and Divider of PLL to give 60MHz
        PLLCON = 0x00000001;    //Enable the PLL

        PLLFEED = 0x000000AA;   //Update PLL registers with feed sequence
        PLLFEED = 0x00000055;  

        while(!(PLLSTAT & 0x00000400));     //Test Lock bit

        PLLCON = 0x00000003;    //Connect the PLL

        PLLFEED = 0x000000AA;   //Update PLL registers with feed sequence
        PLLFEED = 0x00000055;  

        VPBDIV = 0x00000002;    //Set the VLSI peripheral bus to 30MHz
    }

    int main(void){
        init_PLL();

        PINSEL0 = 0x00000000;
        IODIR = 0xFFFFFFFF;

        while(1){
            SetPin(LED);
            delayms(300);

            ClrPin(LED);
            delayms(300);
        }
    }
     
     
    Last edited: Jun 24, 2009
  15. Tang

    Tang New Member

    Joined:
    Jun 11, 2011
    Messages:
    5
    Likes:
    0
    Location:
    shenzhen china
    hi
    anyone do wince on arm cortex A8/A9? i want to run wince/win8 on samsung cortex A9 s5pv310, can you give me some advise?
    the board is below:
    [​IMG]
     
  16. Ubergeek63

    Ubergeek63 Well-Known Member

    Joined:
    Apr 16, 2008
    Messages:
    1,886
    Likes:
    37
    my new pcb

    it had been requested so here is a partial (the board is huge) graphic from the cad package

    Dan
     
  17. Ubergeek63

    Ubergeek63 Well-Known Member

    Joined:
    Apr 16, 2008
    Messages:
    1,886
    Likes:
    37
    and working:
     
  18. tgil

    tgil New Member

    Joined:
    Apr 13, 2011
    Messages:
    3
    Likes:
    0
    It seems the conversation has veered a bit from the original discussion about Cortex M3.
     
    Last edited: Aug 19, 2012
  19. riya78992

    riya78992 New Member

    Joined:
    Mar 5, 2012
    Messages:
    7
    Likes:
    0
    Hi,

    There are plenty of ARM cortex mcu available now days like NXP, TI, Freescale and others as well, but it also depend on your application and what you want to do with it, accordingly you can choose one.
     
  20. anny0498

    anny0498 New Member

    Joined:
    Apr 23, 2012
    Messages:
    2
    Likes:
    0
    Hi,

    This board seems to be an awesome platform to work with. The memory footprints are enough. We can do much using this. I will surly try this for my future project.
     
  21. Ubergeek63

    Ubergeek63 Well-Known Member

    Joined:
    Apr 16, 2008
    Messages:
    1,886
    Likes:
    37
    that board IS a Cortex M3 ... and so is this one:
     
    Last edited: Oct 2, 2012

Share This Page