Hi,
Create a byte array and index the individual bits in that instead of the other way around. Have a look at Melanies excelent write up on how to access whatever within whatever (almost).
/Henrik.
Hi,
Create a byte array and index the individual bits in that instead of the other way around. Have a look at Melanies excelent write up on how to access whatever within whatever (almost).
/Henrik.
i managed to get this routine to scan the grids, and im able to display characters. however, the above piece of code prevents the program from going to the main program. so im forced to put the whole routine into the "buttons:" interrupt.Code:grid var byte[5] scan var byte ;timer 0 interrupt routine BUTTONS: GRID.0(SCAN) = 0 IF SCAN >= 39 THEN SCAN = 0 ELSE SCAN = SCAN + 1 ENDIF GRID.0(SCAN)= 1
if i comment this exact piece of code, both main and interrupt routines run, but no scanning, ofcourse. i read up on the << shift command, and that can only go from 0 to 31. (i need 40)
is there any other way to increment the bits in a byte array?
thanks
NAG CON WIFE!
WIFE VAR MOOD
i forgot; this is in a 18f4431 running at 40mhz. i also tried all kinds of different speeds, but same results; program on main routine will not run
after more troubleshooting, i found out that its the line highlighted with red that's causing the program not to go to the main loop. any workaround?Code:BUTTONS: GRID.0(SCAN) = 0 IF SCAN >= 39 THEN SCAN = 0 ELSE SCAN = SCAN + 1 ENDIF GRID.0(SCAN)= 1
NAG CON WIFE!
WIFE VAR MOOD
Well, dont know if this helps at all, but here is how I did it with a 16 segment 10 character display.
I created a word size variable for the 16 segments. There was a look up table to determine which segments to light. Lets say that variable is seg
Then I had 10 bits for the grids, so lets say that was named grid. since it is more than 8 bits I also made that a word variable
So, to shift out my code I used:
Shiftout data,clk,mode [seg/16,grid/16]
Now to make this more applicable lets say I had a VFD with 20 characters on a 10x2 grid. I could name the first 10 grids grid1 and the 2nd 10 grid2
shiftout data,clk,mode [seg/16,grid1/16,grid2/16]
That shifts out a total of 48 bits.
My problem is figuring out how to get the proc to do other tasks while its still shifting out data. I cant recall the whole code right off but if I recall because the pic was doing all the character generation even with it doing nothing but updating the display it would either be too dim or there would be too much flicker.
Bookmarks