hi! another newbie...lol..let me just thanks you guys for bringing out a great software(flowcode) i got the new v3 full version
and im still learning lol.i'm trying to get the pic16f627 to read a 8bit code on portA input and display it on a LCD(portB) in hex format! is this possible ?
the readout it's giving me is in decamal
please help me!!
- Steve
- Matrix Staff
- Posts: 3431
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
There's currently no inbuild way of printing numbers in HEX format on the LCD display. You will need to write your own routine for this. Here's a quick outline:
1) Create a macro that takes one parameter (a single hex digit value, i.e. a byte number between 0 and 15)
2) This macro should display the appropriate number (if it's between 0 and 9) or letter (if it's 10 to 15) onto the LCD
3) Pass the high "nibble" of the value to this function, followed by the low "nibble".
That should be it.
A quick word about "nibbles": these are 4-bit numbers (i.e. 0 to 15) - the high nibble will be the most significant 4 bits of the port value and the low nibble will be the lowest 4 bits.
When converting the port value to a nibble, you will need to have 2 variables - I'll call them "IN" (the port value) and "NIBBLE" the value to be passed to your "PrintHEX" macro. Here's what the program would look like:
1) Create a macro that takes one parameter (a single hex digit value, i.e. a byte number between 0 and 15)
2) This macro should display the appropriate number (if it's between 0 and 9) or letter (if it's 10 to 15) onto the LCD
3) Pass the high "nibble" of the value to this function, followed by the low "nibble".
That should be it.
A quick word about "nibbles": these are 4-bit numbers (i.e. 0 to 15) - the high nibble will be the most significant 4 bits of the port value and the low nibble will be the lowest 4 bits.
When converting the port value to a nibble, you will need to have 2 variables - I'll call them "IN" (the port value) and "NIBBLE" the value to be passed to your "PrintHEX" macro. Here's what the program would look like:
Code: Select all
1) [INPUT] Read the whole of port a into "IN"
IN <- PORTA
2) [CALC] Get the high nibble
NIBBLE = (IN AND 0xF0)
NIBBLE = NIBBLE >> 4
3) [CALL MACRO] Print the high nibble
PrintHEX(NIBBLE)
4) [CALC] Get the lownibble
NIBBLE = (IN AND 0x0F)
5) [CALL MACRO] Print the low nibble
PrintHEX(NIBBLE)
another question?
hi! steve, how do i compile/assemble the flowcode as i got mpasmwin and picstart plus programmer thanks again
Richard..
sorry i meant to say that i programmed the chip with the re-sulting hex file that flowcode gave me and imported it into mplab IDE and programed it that way but the chip do not work?
but i'm sure it's a programming issue
many thanks ..
Richard..
sorry i meant to say that i programmed the chip with the re-sulting hex file that flowcode gave me and imported it into mplab IDE and programed it that way but the chip do not work?
but i'm sure it's a programming issue
many thanks ..
-
- Posts: 209
- Joined: Thu Oct 19, 2006 11:46 am
- Location: Bakewell, UK
- Has thanked: 20 times
- Been thanked: 16 times
Hi,
I have had no problems using Flowcode and PIC Start plus. The obvious is to try a simple test programme to flash an LED or something and when that is proven try somethingh more complex. However, I prefer the HP-488 e-block board for development as you can get a fair way down the development track before needing to move to untried hardware.
The programmer Lite e-board would be a good alternative to the HP-488 if the project is not complex (and it is still available).
Mark
I have had no problems using Flowcode and PIC Start plus. The obvious is to try a simple test programme to flash an LED or something and when that is proven try somethingh more complex. However, I prefer the HP-488 e-block board for development as you can get a fair way down the development track before needing to move to untried hardware.
The programmer Lite e-board would be a good alternative to the HP-488 if the project is not complex (and it is still available).
Mark
Go with the Flow.
Re: please help me!!
Hello Steve,
I am having the same problem with the hex format coming out of the RTC.
Above at your code, I assume that I will NOT copy it directly in the :"C code" icon in flowcode? But I will put in a :calculaion icon" and call an LCD macro to print the nibbles?
Also Steve you wrote "printHex" in order to print the "IN" and "NIBBLE", how I tell to the macro to print on LCD the Hex? Should I select "print number" or "print ASCII"?
Also is there any macro that can calculate time/date/year without an RTC being involved?
Thank you in advance,
Best Regards,
Achillis.
I am having the same problem with the hex format coming out of the RTC.
Above at your code, I assume that I will NOT copy it directly in the :"C code" icon in flowcode? But I will put in a :calculaion icon" and call an LCD macro to print the nibbles?
Also Steve you wrote "printHex" in order to print the "IN" and "NIBBLE", how I tell to the macro to print on LCD the Hex? Should I select "print number" or "print ASCII"?
Also is there any macro that can calculate time/date/year without an RTC being involved?
Thank you in advance,
Best Regards,
Achillis.