Problem with ports help plz


Closed Thread
Results 1 to 34 of 34

Hybrid View

  1. #1
    Join Date
    May 2009
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    i need help i've tryed this code and when i add more text in ldata var it says error enable to fit ldata variable, and i changed ldta to var bit but it shows all LDEs on how can i fix this problem to add more scrolling text please help

    Code:
        DEFINE OSC 4
    TRISA = %00000
    TRISB = %00000000
    
    	column		var	byte
    	dchange		var	byte
    	scan 		var byte
    	scroll		var	byte
    	ldata 		VAR BYTE [59] when i change to bit it shows all leds on?
    START:
    	CLEAR
        ldata [0]  = %11111
    	ldata [1]  = %11111
    	ldata [2]  = %11111
    	ldata [3]  = %11111
    	ldata [4]  = %11111'END OF CLEAR
    	ldata [5]  = %01000	
    	ldata [6]  = %01010	
    	ldata [7]  = %00010 ' S 
    	ldata [8]  = %11111  '_
    	ldata [9]  = %00000
    	ldata [10] = %11011
    	ldata [11] = %00000 'H
    	ldata [12] = %11111	
    	ldata [13] = %00001
    	ldata [14] = %11010
    	ldata [15] = %00001 'A 
    	ldata [16] = %11111
    	ldata [17] = %00110
    	ldata [18] = %01010	
    	ldata [19] = %01100 'Z
    	ldata [20] = %11111 
    	ldata [21] = %11111
    	ldata [21] = %00001
    	ldata [22] = %11010
    	ldata [23] = %00001 'A
    	ldata [24] = %11111
    	ldata [25] = %11111	
    	ldata [26] = %00000
    	ldata [27] = %11101
    	ldata [28] = %11011 
    	ldata [29] = %00000 'N
    	ldata [30] = %11111
    	LDATA [31] = %00000
    	LDATA [32] = %01110
    	ldata [33] = %10001 'D
                 ldata [34] = %11111
                 ldata [35] = %11111
                 ldata [36] = %11111
                 ldata [37] = %00000
                 ldata [38] = %11101
                 ldata [59] = %11011
                 ldata [39] = %11101
                 ldata [40] = %00000 'M
                 ldata [41] = %11111
                 ldata [42] = %00000
                 ldata [43] = %01111
                 ldata [44] = %00000 'U
                 ldata [45] = %11111
                 ldata [46] = %01000	
                 ldata [47] = %01010	
                 ldata [48] = %00010 ' S 
                 ldata [49] = %11111
                 ldata [50] = %11111
    	ldata [51] = %11001
    	ldata [52] = %10110
    	ldata [53] = %01101
                 ldata [54] = %10110 
                ldata [55] = %11001 'HEART
                ldata [56] = %11111
                ldata [57] = %11111
                ldata [58] = %11111
                ldata [59] = %11111 'SPACE
    	
    	
    	
    	
        	
     LOOP:
    	FOR scroll = 0 TO 54		
    	FOR scan = 0 TO 59	
    	PORTB = 1
    	FOR column = 0 TO 7
    	PORTA = ldata [column]
    	PAUSE 1
    	PORTB = PORTB * 2
    	NEXT
    	NEXT 
    	FOR dchange = 0 TO 59
    	ldata [dchange] = ldata [dchange+1]	
    		NEXT 
    	NEXT
    	GOTO START
    END
    Last edited by Mus.me; - 1st August 2009 at 00:01.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Which PIC are you using? It might be full.
    Start on post #11
    http://www.picbasic.co.uk/forum/showthread.php?t=10381
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    May 2009
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Which PIC are you using? It might be full.
    Start on post #11
    http://www.picbasic.co.uk/forum/showthread.php?t=10381
    im using 16f84 but when i change ldata var byte to ldata var bit it complier but it doesnt work it keeps blinkin leds,i think the problem in the code and scrolling, and pic16f84 it takes 1024 words i think but i see just between 258 to 300 word, it works when i change to var bit but it doesnt scroll it shows LEDs blinkin and all off them on ????

    AND I WANT TO USE DATA EPPROM INSTEAD THE VARIABLE ldata IF SOMEONE CAN HELP ME
    Last edited by Mus.me; - 1st August 2009 at 00:53.

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Mus.me View Post
    im using 16f84 but when i change ldata var byte to ldata var bit it complier but it doesnt work it keeps blinkin leds,i think the problem in the code and scrolling, and pic16f84 it takes 1024 words i think but i see just between 258 to 300 word, it works when i change to var bit but it doesnt scroll it shows LEDs blinkin and all off them on ????

    AND I WANT TO USE DATA EPPROM INSTEAD THE VARIABLE ldata IF SOMEONE CAN HELP ME
    Hi Mus.Me,
    OK the 16F84 does not have enough code space to do that, it will fit into a 16F628A, BUT ah say BUT, you will have to reorder the listing of the variables to avoid a bank error from PBP, and no it is not the crossing boundries error either. So I did like so:
    Code:
    	ldata 		VAR BYTE[59] 'when i change to bit it shows all leds on?
    	column		var	byte
    	dchange		var	byte
    	scan 		var byte
    	scroll		var	byte
    EEprom is not so hard to do . . .why not use a lookup table ?
    Code:
    for index = 0 to 19
            'ldata 0 1  2  3  4  5  6  7  8 9 10 11 12 . . . . . 
    lookup index,[31,31,31,31,31,8,10,10,31,0,27,0,31,1,26,1,31,6,2,12]ldata
    Portb = ldata
    next index
    Last edited by Archangel; - 1st August 2009 at 03:48.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    May 2009
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    thank u joe for the help i will try it out and change to 628.

Similar Threads

  1. sleep problem help plz >>>.
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 16th November 2009, 08:21
  2. Replies: 6
    Last Post: - 10th January 2008, 10:38
  3. ESC problem plz help
    By al000y in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st January 2007, 10:21
  4. Problem reading multiple ADC ports
    By jswayze in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2004, 16:46
  5. Problem with intensity.. plz help
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th October 2004, 17:25

Members who have read this thread : 0

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