please help me!!

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
numnutts
Posts: 6
Joined: Sun Dec 31, 2006 12:37 pm

please help me!!

Post by numnutts »

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

User avatar
Steve
Matrix Staff
Posts: 3431
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

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:

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)

numnutts
Posts: 6
Joined: Sun Dec 31, 2006 12:37 pm

thanks

Post by numnutts »

thanks for your quick reply i will have a go at it tonight and let you know how i get on thanks again..

numnutts
Posts: 6
Joined: Sun Dec 31, 2006 12:37 pm

another question?

Post by numnutts »

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 ..

User avatar
Steve
Matrix Staff
Posts: 3431
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

Most likely, it is a configuration word setting problem - make sure the oscillator settings are appropriate for your hardware, and that you have turned off the watchdog timer.

Mark
Posts: 209
Joined: Thu Oct 19, 2006 11:46 am
Location: Bakewell, UK
Has thanked: 20 times
Been thanked: 16 times

Post by Mark »

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
Go with the Flow.

User avatar
Steve
Matrix Staff
Posts: 3431
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

The "lite" programmer is not available anymore, but the EB006 "multiprogrammer" is a good alternative and cheaper than the HP488 dev board (although you will need other E-Blocks and/or your own electronics to add functionality).

numnutts
Posts: 6
Joined: Sun Dec 31, 2006 12:37 pm

settings?

Post by numnutts »

hi ! mark you said you had no problems with picstart plus what settings have you changed? and did you compile it with flowcode or mpasmwin??

thanks !

Richard..

User avatar
achillis1
Posts: 347
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 91 times
Been thanked: 8 times

Re: please help me!!

Post by achillis1 »

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.

Post Reply