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.

printing integer values using hyperterminal

Other Parts Discussed in Thread: MSP430F2274, MSP430FG4619

Hello everyone,

          I'm currently experimenting on the MSP430F2274 microcontroller using the ez430-rf2480 demo kit. As for now, I'm working on the ADC and Uart modules. I'm using the internal temperature sensor (A10) wherein the reading is sample and converted by the ADC. My problem now is that I want to display the integer value of the temperature reading in the hyperterminal using the Uart module. Another thread had a similar problem with mine(http://e2e.ti.com/forums/p/2458/9438.aspx#9438). The only difference is that it displayed the ADC10MEM(hex) value in the hyperterminal. What I want to do now is that I want to display the exact temperature value in the hyperterminal such as 23, 24, 25(in celsius). Is this possible in the hyperterminal?Are there any ways in manipulating the value of ADC10MEM such that an integer value will be displayed in the hyperterminal? Many thanks ahead for the reply.

Best regards,

Kristoffer

 

  • Kristoffer,

    I believe Brandon Azbell correctly answered this question in the thread you've referenced: The value you receive should be converted into degrees with user software, then translated to ascii before transmission.

  • Hi Brandon,

                 Thanks for the reply. Is my understanding correct that I have to create a PC application in order to convert the ADC10MEM hex value transmitted through UART to integer values such as 23,24,25 celsius? Basically my question was that:  is it possible to use hyperterminal to display converted integer values from its corresponding hex values? By the way, I was able to successfully display the hex value of ADC10MEM in the hyperterminal using Brandon Azbell's code. Looking forward for your reply on this one.

    Regards,

    Kristoffer

     

  • There is a similar thread discussing this that should help.

  • Hi Brandon,

               This is the code that I needed! Thanks a lot! This forum really helps a lot to beginners like me. More power to you guys!

    Cheers,

    Kristoffer

  • None of the old links work anymore. This affects results from Google and links previously posted in old forum messages. I'm quite irritating with your web staff :-/

  • Hi Paul,

    I did something similar for printing integer values to a 16x2 LCD. Find the related code snipped below. You can also find it in my files here (http://e2e.ti.com/members/1371069/files/default.aspx).

    Print unsigned char bcd0 to bcd3 to hyperterminal and your done.

    Rgds
    aBUGSworstnightmare

    //-----------------------------------------------------------------------------

    // Module name: void LCD_output_result(unsigned char cursorpos, unsigned int data)

    // Description: Formating and output of integer value

    //-----------------------------------------------------------------------------

    void LCD_output_result(unsigned char cursorpos, unsigned int data)

    {

    unsigned int tmp_result;

    unsigned char bcd0,bcd1,bcd2,bcd3;

     

    tmp_result = data;

    bcd0 = (tmp_result / 1000) + 48; // divide by 1000 and add 48 for ASCI

    tmp_result = tmp_result % 1000;

    bcd1 = (tmp_result / 100) + 48; // divide by 100 and add 48 for ASCI

    tmp_result = tmp_result % 100;

    bcd2 = (tmp_result / 10) + 48; // divide by 10 and add 48 for ASCI

    bcd3 = (tmp_result % 10) +48;

    LCD_cursor(cursorpos);

    if (!bcd0)

    {

    LCD_char(0x20);

    LCD_char(0x20);

    }

    else

    {

    LCD_data(bcd0);

    }

    LCD_data(bcd1);

    LCD_data(bcd2);

    LCD_data(bcd3);        

  • Hi,

      Really like the looks of the driver you posted here.  I'm interested in how you connected the LCD module to the IC. I have a Lumex LCM-S01602DTR/M (Digikey part 67-1781-ND).  It is the same basis module.  I have heard horror stories about internal pullup resistors in the module and interfacing it to a 3.3V controller.  I'm using the MSP430FG4619.  I have Paralleled a 2.2K resistor on each pin to ground and then put a 1K resistor in series with it to the display to make sure that if the display tries to force 5V to the MCU, it gets divided down to at most 3.4V (perhaps a 2.7K would have been a better choice?). I am using it in 4bit mode and have placed these resistors on all interface leads.  Did you find yourself having to do something similar?  The particular module I am using has the ST7066 from Sitronix on it for the controller, but it appears to implement the same protocol.  Any thoughts are greatly appreciated.

    yeltrow

  • Hi yeltrow,

    connecting the LCD is quite simple since you can directly conncect the MCU outputs to the LCD as long as you don't attempt to read from the LCD (i.e. by checking BUSY)!

    My driver is quite simple; I don't care about BUSY and implemented a timing based on the MCU main clock. Because of that you maybe need to adapt the __delay_cycle()-functions to the main clock you're using to give you the best LCD-performance. The display operates in 8-bit mode; you can change this easily to use it in 4-bit mode.

    Since the LCD is used with write operations only you can pull-down the WR-signal with a 1k Ohm resistor (pull down to GND). By doing this you save one I/O. You should run your MSP430 a at VCC-level above 3V; this will be a good HIGH for the display and because of that you don't need any external level translators.

    I don't know the SITRONIX exactely, but it should be one of the many HD44780 clones out there (maybe with a different character ROM). Have a look at the LCD data sheet to find out if there are any pull-ups on it. The ST7066 doesn't have any internal ones. I'm using the driver with modules based on the HITACHI original and a SAMSUNG clone without facing any problems.

    In case of any questions do not hesitate to ask them! Kind regards
    aBUGSworstnightmare

  • Hi yeltrow,

    just ckecked the ST7066 data sheet; it will operate from 2.7V to 5.5V; it has no internal pull-ups. I will upload the data sheet to my files later this day.

    Rgds
    aBUGSworstnightmare

  • I too am having the same problem. The link you posted: http://e2e.ti.com/forums/p/8741/33733.aspx is down.

**Attention** This is a public forum