bit banging variable in assembly

  • Ronald Marcus

    Ronald Marcus - 2008-12-10

    I am writing a short I2C routine for sending characters to a character display.
    I #defined LCD_Data as P0_2, and LCD_Clock as P0_3
    The routines work in C, but when I create an inline assembly routine using _LCD_Data and _LCD_Clock to manipulate the port pins, I get an "unassigned global LCD_Data" and the same for LCD_Clock.
    How do I need to declare them for use in assembly?

    • Maarten Brock

      Maarten Brock - 2008-12-10

      The assembler does not use the C preprocessor which converts LCD_Data to P0_2. Instead you must use P0_2 itself. You have correctly added the leading underscore, so _P0_2 should work.


    • Ronald Marcus

      Ronald Marcus - 2008-12-11

      I will try it...


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks