Jump to content


  • Content Count

  • Joined

  • Last visited

Posts posted by kuldeepdhaka

  1. i did some work on SSD1289 (3.2"  320x240)

    Im using two 74xx595 IC for data lines (to save pins).

    here's the repo: https://github.com/kuldeepdhaka/bitbang-ssd1289-using-msp430g2553


    schematics : .../doc/schematics


    TODO: driver for touchscreen not working.

    PENIRQ is working perfect.


    Compiler: msp430-gcc


    note for admin: i wasnt able to upload svg file (tried twice, "This upload failed") , is their any problem with svg's. :smile:


  2. it's a matter of programing style i guess. i would minimize things i do in interrupt handlers as u may have timing / re-entrant issues if u do too much there.


    i would suggest also turn off timerA1 and rely only on your led to diagnosis the problem. your timerA1 is clocked at 500Khz u said and can easily run into your port2 interrupt (ps/2 clk at about 20khz). (check datasheet and see who has higher priority).


    also it looks like your port2 interrupt is not disabling / re-enabling interrupts while servicing them. it's timing critical so u don't want any unnecessary blocking otherwise u will miss the beat readying from the keyboard.


    both timerA1 and port2 access your queue. i did not examine it in detail but generally u would want to have some kind of locking.


    well, not sure if my input can help. yours a big project and i don't have the h/w hook-up.


    yes, one of the interrupt that i didnt disable (timer A1) was causing performance bottleneck.

    i moved the code in main and goes to sleep inside while.

    next time , timer A1 interrupt, it just wake up mps430. so their is not delay and when their are other interrupts, it plainly execute the main inside while() code and again goes to sleep.

    in your previous comment , i think you mentioned something like this.

        register uint8_t data;
            _BIS_SR(LPM1_bits + GIE);
            /* screen refresh { */
                vt100.data = cqueue_pop(&uart_cqueue_rx);
            /* } */
            /* cursor blinking { */
            /* make sure we dont overflow the cursor */
            if(vt100.screen[vt100.cursor.row][0].double_width && vt100.cursor.col > VT100_WIDTH/2)
                vt100.cursor.col /=2;
            nokia1100_gotoyx(vt100.cursor.row, vt100.cursor.col * NOKIA1100_WIDTH_CHAR);
            vt100_print_char(vt100.cursor.row, vt100.cursor.col, vt100.mode.cursor_state);
            /* } */
    void timerA0_interrupt()
        vt100.mode.cursor_state ^= TRUE;
    void timerA1_interrupt()
        /* exit sleep mode to refresh screen */
        /* clear the interrupt flag */
        TACCTL1 &= ~CCIFG;

    your code indicates that if there is a parity error, u had it enter a green led blink indefinitely. it is then locked up. additional key stroke would end up at the same place via interrupt.


    may be u should let it thru (just turn on green led and pass) so u can see what happens w/ the next key stroke.

    earlier i was doing so, then i wrote this "infinite blinking led" to check if im getting a parity error.



    also u are doing some business logic in your interrupt handler (when u see stop bit), are u sure u have enough time (every round) to do everything? i only look at it briefly and it appears to do uart / nokia display, etc.


    it would be a good idea to move your business logic out of your interrupt handler.

    i also tried circular queue.

    but no help.




    u make effort and created various object modules but they are interlaced w/ one and other. a better approach would be to employ a "controller" module in your main.c to direct traffic.


    not sure but lemme see.

    till now i think my code is more optimized.

    just to save push and pop in stack.

    elaborate a little :).




    • i disabled all interrupts except port2(receive data from keyboard) & timerA1 (this is needed to print data on screen) but it didnt helped.
    • keyboard left alone for some time , shows same problem.
  4. A:

    • yes mostly at 25 keys when i type "a for apple b for boy ".... slowly in one go, (sometimes it start occuring at 4/7/15 key but thats very rare, i think when i type fast error occurs early.)     near 25 means between 18 - 27 is more frequent.
    • Not tested
    • tried diferent keystrokes, didnt work
    • im supplying power to msp430 from USB and keyboard from external supply.
    • Not-tested
    • i have never seen any correlation between the error data and actuall data, though one thing was common that , everytime the error-data was mostly same as previous one. and some times no data was received.
  5. i have been sucessful(somewhat) in interfacing a PS2 keyboard with MSP430.
    usually for about ~25 keystrokes it works perfectly.
    after that parity error occurs in data and data after the corrupt-data is also corrupt.
    im supply keyboard 5V from external source and using POT to convert 5V to 3V.
    communication with keyboard is at 20-25Khz and MSP430 is running at 16Mhz.
    thing i tried (and didnt worked :-( ):
    tried another keyboard.
    circular queue to store temp data and then timer A1 to extract and decode.

    if im able to get first n data's then why is their a problem after that.
    im having 4 more interrupts going on (usci0_rx (@ 9600 baud, 4Mhz), usci_tx, timerA0 ( @ 7Hz), timerA1 ( @ 500Khz )).
    i have a MSP430G2553IN2.
       text       data        bss        dec        hex    filename
       6604          6        342       6952       1b28    build/diy-vt100.elf
    total code(see below) is in diy-vt100.tar.gz
    i had to remove doc/ , .git/ (size was ~100MB's)
    schematics are not according to project right now.







  • Create New...