PDA

View Full Version : How to saparate variable to array and GLCD Question



pramarn
- 2nd October 2006, 09:59
1.I define

##temp var word ' Storage for temperature

##Shiftout DQ, CLK, LSBFIRST, [$aa] ' Send read command
##Shiftin DQ, CLK, LSBPRE, [temp\9] ' Read 9 bit temperature to temp

I need to put value in temp variable to array

how to do?


2.I use PIC 18-458 connect GLCD for show picture
I neet to draw meny picture but PIC 18F458 have flash memory 32K
it can't support my program( My program show picture 40 - 50 screen).
please guide me how to add memory to PIC 18F458

Thank you vrey much

sayzer
- 2nd October 2006, 10:21
For Item 1;

Take a look at the code under this post.
http://www.picbasic.co.uk/forum/showthread.php?t=3494

Easy to figure out an array with ShiftIn.


-------------------------------

pramarn
- 2nd October 2006, 10:32
Thank you sayzer

SHIFTIN DAT,CLK,3,[psxdata[0]\8,psxdata[1]\8,psxdata[2]\8,psxdata[3]\8,psxdata[4]\8,psxdata[5]\8,psxdata[6]\8]

This syntax can be use other command?

sayzer
- 2nd October 2006, 10:45
Could you be more specific pls?

Like what command?

---------------

pramarn
- 2nd October 2006, 11:14
Command

ADCIN 0, Readvolts 'Get value.

Count 3, 1000, W1 ''Get value.


can use this command?

ADCIN 0, [psxdata[0]\8,psxdata[1]\8,psxdata[2]\8,psxdata[3]\8,psxdata[4]\8,psxdata[5]\8,psxdata[6]\8]
'---------------------------------
Count 3, 1000, [psxdata[0]\8,psxdata[1]\8,psxdata[2]\8,psxdata[3]\8,psxdata[4]\8,psxdata[5]\8,psxdata[6]\8]

sayzer
- 2nd October 2006, 11:55
You can not do that.

But what is it you want to do?

Why do you need to read ADC 0 and put the result in an array? or Count?

Give more info about your idea. I am sure there is an easy way to get your idea working.

SteveB
- 2nd October 2006, 14:58
2.I use PIC 18-458 connect GLCD for show picture
I neet to draw meny picture but PIC 18F458 have flash memory 32K
it can't support my program( My program show picture 40 - 50 screen).
please guide me how to add memory to PIC 18F458

Thank you vrey much

You will probably have to use an external EEPROM or flash memory. Microchip (http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=80) has some serial EEPROMs up to 1Mbit. If you need even more storage, try Flash. I've actually used the Atmel Dataflash AT45DB321C (http://www.atmel.com/products/DataFlash/) for a datalogging application. It worked quite well.

Steve

pramarn
- 4th October 2006, 03:42
Thank you all

My idea is use result show in GLCD but function gengrate font to GLCD can gengrate by character can not generate by word How to generate word or read data from
-Read 9 bit temperature
-Count
- ADCIN
function to draw in GLCD

This function

'---------------------------
************************************************** ******************
CHARTABL: 'CHARACTER LOOK-UP TABLE FOR COLLUMS
' ************************************************** ******************
IF CHARACTER > 31 THEN
' " ","!",""","#","$","%","&","'","(",")","*","+",",",
'"-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?",
'"@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R",
'"S","T","U","V","W","X","Y","Z","[","\","]","^","_","`","a","b","c","d","e",
'"f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x",
'"y","z","{","|","}","~"]


LOOKUP CHARACTER - 32,[$00,$00,$00,$14,$24,$23,$36,$00,$1C,$00,$14,$08,$0 0,_
$08,$80,$20,$be,$80,$ba,$aa,$8e,$ae,$be,$82,$be,$a e,$00,$00,$08,$14,$00,$02,_
$32,$bc,$be,$9c,$be,$be,$be,$be,$be,$a2,$90,$be,$b e,$be,$be,$be,$be,$8c,$be,_
$84,$82,$9e,$8e,$9e,$a2,$8e,$a2,$7F,$02,$00,$04,$4 0,$00,$20,$7f,$38,$38,$38,_
$08,$0c,$7f,$00,$00,$7f,$00,$7c,$7c,$38,$7c,$08,$7 c,$48,$04,$3c,$1c,$3c,$44,_
$0c,$44,$08,$00,$00,$00],COLLUM(0)


COL2:
LOOKUP CHARACTER - 32,[$00,$00,$07,$7F,$2A,$13,$49,$05,$22,$00,$08,$08,$5 0,_
$08,$80,$10,$b2,$80,$aa,$aa,$88,$aa,$aa,$82,$aa,$a a,$36,$56,$14,$14,$41,$01,_
$49,$92,$aa,$a2,$a2,$aa,$00,$a2,$88,$be,$a0,$88,$a 0,$82,$84,$a2,$92,$92,$92,_
$aa,$82,$a0,$90,$a0,$94,$a8,$b2,$41,$04,$00,$02,$4 0,$01,$54,$48,$44,$44,$54,_
$7E,$52,$08,$44,$20,$10,$41,$04,$08,$44,$14,$14,$0 8,$54,$3F,$40,$20,$40,$28,_
$50,$64,$36,$00,$00,$08],COLLUM(1)

COL3:
LOOKUP CHARACTER - 32,[$00,$4F,$00,$14,$7F,$08,$55,$03,$41,$41,$3E,$3E,$3 0,_
$08,$80,$08,$aa,$80,$aa,$aa,$88,$aa,$aa,$82,$aa,$a a,$36,$36,$22,$14,$22,$51,_
$79,$92,$aa,$a2,$a2,$aa,$00,$a2,$88,$a2,$9e,$94,$a 0,$bc,$98,$a2,$92,$92,$92,_
$aa,$be,$a0,$a0,$9e,$88,$a8,$aa,$41,$08,$41,$01,$4 0,$02,$54,$44,$44,$44,$54,_
$09,$52,$04,$7D,$40,$28,$7F,$18,$04,$44,$14,$14,$0 4,$54,$44,$40,$40,$30,$10,_
$50,$54,$41,$7F,$41,$04],COLLUM(2)



COL4:
LOOKUP CHARACTER - 32,[$00,$00,$07,$7F,$2A,$64,$22,$00,$00,$22,$08,$08,$0 0,_
$08,$a0,$04,$82,$80,$aa,$aa,$be,$aa,$aa,$82,$aa,$a a,$00,$00,$41,$14,$14,$09,_
$41,$bc,$94,$94,$9c,$a2,$82,$ba,$be,$80,$9e,$a2,$a 0,$82,$be,$be,$8c,$be,$ac,_
$aa,$82,$9e,$90,$a0,$94,$be,$a6,$00,$10,$41,$02,$4 0,$04,$54,$44,$44,$48,$54,_
$01,$52,$04,$40,$44,$44,$40,$04,$04,$44,$14,$18,$0 4,$54,$40,$20,$20,$40,$28,_
$50,$4C,$00,$00,$36,$08],COLLUM(3)
COL5:


LOOKUP CHARACTER - 32,[$00,$00,$00,$14,$12,$62,$50,$00,$00,$1C,$14,$08,$0 0,_
$08,$80,$02,$be,$be,$ae,$be,$88,$ba,$ba,$be,$be,$b e,$00,$00,$00,$14,$08,$06,_
$3E,$80,$80,$80,$80,$80,$80,$80,$80,$80,$82,$80,$8 0,$bc,$80,$80,$80,$80,$80,_
$90,$82,$80,$8e,$9e,$a2,$80,$a2,$00,$20,$7F,$04,$4 0,$00,$78,$38,$20,$7F,$18,_
$02,$3E,$78,$00,$3D,$00,$00,$78,$78,$38,$08,$7C,$0 8,$20,$20,$7C,$1C,$3C,$44,_
$3C,$44,$00,$00,$08,$04],COLLUM(4)

ENDIF
COLLUM(5) = $80
FOR INDEX = 0 TO 5

VBUS_DATA = COLLUM(INDEX)
GOSUB CALL_LCD
Pauseus 1
NEXT INDEX
RETURN

'-----------