/My english isn't good. Tabsoft got it right.
I'll try to explain better...
I have word variable Pressure.
I need to extract digits from Pressure variable to 4 different variables for displaying on static 7 segment LCD.
Offtopic:
To dive LCD just connect pin to pin LCD with MCU, and in ISR XOR LAT with mask every 20mS or so...
BANKSEL PORTA 'Select Bank
MOVLW 11101111b 'Mask unused pins
XORWF LATA,F 'Invert unmasked pins and write to LATA
It should have lower power consumption than multiplexed LCD wit LCD module on PIC.
Back to topic:
One thing that I tried is to use DIG and 4 variable. If I can extract one digit much faster, then do same thing for all 4 digits. That is why I ask for faster extracting for one variable...
Other way is to use arraywrite, and DEC4 to extract digit. Each byte in array will have one digit.
Tabsoft, thank you. You give me an idea:
Pressure = 1234
tmpDig0 = Pressure // 10 'tmpDig0 =4
pressure = Pressure / 10 'Pressure=123
tmpDig1 = Pressure // 10 'tmpDig1=3
pressure = Pressure / 10 'Pressure=12
tmpDig2 = Pressure // 10 'tmpDig2=2
tmpDig3 = Pressure / 10 'tmpDig3=1
This will be probably ok. It takes just under 1,5mS.
I didn't mention that I'm using PBPL and running on intosc at 16MHZ for all test.
I'm waiting boards to arrive, so I can't measure current consumption jet. So there is always option to go back to PBPW.
Thank you all.
Bookmarks