This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

herucles launchpad

Other Parts Discussed in Thread: HALCOGEN

Sir

i bought hercules launchpad and interfaced lcd keypad to GIO, halcogen used even made LINTX rx SPI as gio

but now i m confused how to access particular bit in LIN/SCI.

on lintx, i have enable pin

onlinrx, i have rs pin

i know in PIC but here confused

if full code can be given or just tell how to access

thanks

  • Here is one example you can reference. It is using SPI5 as GIO. Check the HalCoGen setting under the SPI5 Port tab. This example tries to use the SCS[0] as a GIO pin. The concept is the same that you can extend to LIN or SCI.

    Once you set the HalCoGen you can do something like below 

    gioInit();
    gioSetDirection(linPORT, 0x4); // Set TX pin to GIO output direction
    gioSetBit(linPORT,0x2, 0x1); // to drive a '1' to LINTX pin
    gioSetBit(linPORT,0x2, 0x0); // to drive a '0' to LINTX pin

    3404.LS12x_SPI5_GIO_Mode.zip

     

     

  • Hi Ravi,
    You cannot combine GIO pins from different modules into a 8-bit port. The data registers associated with GIO pins are memory mapped to different addresses. For example, the SPI GIO DOUT register is at different address from NHET GIO DOUT register. Your option will be to use a module that can support the number of bits that you intent to write and read at once. For example, all NHET pins are GIO capable. I don't know what device you have. You should be able to find 8 NHET pins that you can use for GIO purpose. This way you can read and write the 8-bit port at once.
  • I don't understand what you meant by codelines.

    You need to refer to the TRM for how to use these modules in GIO mode.

    Let's use the NHET as an example. In NHET there is the HETDIR register which is a 32-bit register. If you want to use NHET02-18 as GIO output then you will just set 1 to these associated bits. Same for HETDOUT which is another 32-bit register where you can write the values to appear on these pins. You need to also check the datasheet to see which NHET pins are brought to the device package.  

  • Thanks but i did not needed that

    I  have read TRM it thats why i was able to do  (linBASE_t *)0xFFF7E400U)->PIO0 = (uint32)((uint32)0U << 2U)

    5282.Hercules_LaunchPad_Header.pdf

     I have attached pdf

    ,see if i connect 8-bit LCD to  N2HET and want to write "welcome"

     hope i clear now

  • Suppose you do the below connection and it should provide the 8-bit data to the LCD.

    MCU LCD
    N2HET[0] -> DB0
    N2HET[2] -> DB1
    N2HET[4] -> DB2
    N2HET[6] -> DB3
    N2HET[10] -> DB4
    N2HET[12] -> DB5
    N2HET[14] -> DB6
    N2HET[16] -> DB7

    If you want to write the ASCII 'w' with ASCII code of 0x77 then below is an example.

    gioInit();
    gioSetDirection(hetPORT, 0x15455); // Set NHET pins 0,2,4,6,10,12,14,16 to output
    gioSetPort(hetPORT, 0x05415);// Write 0x77 to pins 0,2,4,6,10,12,14,16
  • value 0x15455 is clear but
    how you got 0x05415
    gioSetPort(hetPORT, 0x05415);// Write 0x77 to pins 0,2,4,6,10,12,14,16

    i tried many binary but cannot find out how you made it 0x05415

    pls tell

  • I don't know which LCD you use but I guess this is how it writes to the LCD on the data bus.You need to check your LCD for confirmation.

     

    NHET pin LCD Bus ASCII=0x77 for 'w' Dout Value
    0 DB0 1 5
    1   0
    2 DB1 1
    3   0
    4 DB2 1 1
    5   0
    6 DB3 0
    7   0
    8   0 4
    9   0
    10 DB4 1
    11   0
    12 DB5 1 5
    13   0
    14 DB6 1
    15   0
    16 DB7 0 0
  • Thanks but if i have to write a long string " Please click the Verify Answer button on this post if it answers your question.Texas Instruments,
    welcome to 2017 , new long string up to date  ,more lenghty 5-10 lines". i cannot do this for each alphabet.
    can you give program (zip) for it . I also need same with kepad, on keypad (4x4 matrix) typing "Texas Instruments " and it is getting displayed on LCD

    LCD 20x4

    lcd connections -

    LINTX

    RS

    LINRX

    R/W

    GIOA[0]

    EN

    NHET04

    DB0

    NHET06

    DB1

    NHET10

    DB2

    NHET12

    DB3

    NHET14

    DB4

    NHET16

    DB5

    NHET18

    DB6

    NHET22

    DB7

    Also use timer for delay ,

    Keypad connections -

    GIOA[4]

    GIOA[7]

    GIOA[6]

    GIOA[1]

    MIBSPI1CLK

    MIBSPI1nCS1

    MIBSPI1nCS2

    MIBSPI1nCS3

    Please give program (zip ) with keypad , lcd interfacing and timer ,  i have read data sheet ,can do on pic but here i  am confused
    Thank you in advance

  • i need answer for this , please give program (zip ) with keypad , lcd and timer , whole long string 10 lines should come not alphabet

  • We don't have any LCD example. You can take a look at the below website and note and they may be useful to your project. The website has some example.

    learningmsp430.wordpress.com/.../
    mil.ufl.edu/.../LCD_Notes_8-bit.pdf