TM1640 (16 digit display) with PicBAsic Pro, possible is? How?


Results 1 to 36 of 36

Threaded View

  1. #21
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,622


    Did you find this post helpful? Yes | No

    Default Re: TM1640 (16 digit display) with PicBAsic Pro, possible is? How?

    Hi,
    For what it's worth I'm not an experienced programmer but If I'm wrong I'd like to know for future use. In the few prorams I've written I've always had to use caps for the defines to work but I haven't been calling asm routines. So I'd at least try it to see if it matters.
    But you have been calling ASM routines since that is exactly what PBP does, it "builds" your code into an ASM program by "stitching together" different library routines which are all in ASM. Some of these routines have "settings" which can be "configured" and this is done with the DEFINE directive. The DEFINE directive is a PBP "command" and PBP is not case sensitive so the DeFiNe can be any case but the name of the "setting" you want to configure must match the case of how it is written in the ASM routine it "configures" - and all the PBP library routies use all upper case.

    Let's take the simple example of DEFINE OSC 20, in the library file you'll find something like (and this is ASM):
    Code:
        ifndef OSC
    OSC = 4
        endif
    See, here OSC is all upper case and since this is code that is directly used by the assembler IS case sensitive so if you, in your program, would do define osc 20 it wouldn't work. Not because define is lower case but because osc is. What happens is that the assembler creates a constant named osc (which is different from OSC that the library routines is looking for) and assignes the value 20 to it. The library routines checks if OSC has been defined but doesn't see it so it sets its value to 4 - when you intended for it to be 20.

    If you write a ASM routine where the assembler is looking for aBc then you'd need to use DEFINE aBc for it to work, define ABC wouldn't, neither would DEFINE ABC.

    Man, I really hope I got that right but if I didn't I hope someone will jump in and correct me.

    /Henrik.
    Last edited by HenrikOlsson; - 13th August 2013 at 17:13.

Similar Threads

  1. HSEROUT full 3 digit display of variable howto ?
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th October 2008, 14:53
  2. Replies: 2
    Last Post: - 14th July 2008, 23:11
  3. Replies: 2
    Last Post: - 22nd January 2008, 15:25
  4. How to display dot on 7-seg , 4 digit
    By chai98a in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 19th January 2007, 19:17
  5. SMART Serial 4 Digit LCD Display (SMARD4)
    By paul borgmeier in forum Adverts
    Replies: 0
    Last Post: - 5th January 2005, 06:50

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts