bit banging variable in assembly

2008-12-10
2013-03-12
  • 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?
    Thanks,
    Ron

     
    • 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.

      Maarten

       
    • Ronald Marcus
      Ronald Marcus
      2008-12-11

      Thanks,
      I will try it...
      Ron