Well there is a slight problem for me.
Can I convert a hex value (which I get as char byte) to decimal value and then transmit that as my output ?
I am using C to program my 16F76.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Tue Aug 04, 2009 12:17 am
Quote:
Can I convert a hex value (which I get as char byte)
1. What device sends the "hex value" to your PIC ?
2. Explain what you mean by a "char byte".
myumair
Joined: 19 Jul 2009 Posts: 11
Posted: Tue Aug 04, 2009 3:41 am
well ad7705 which is operating with pic in SPI mode sends that data and it is 16 bit long so PIC reads that twice from the adc register and store that in a stack [2] each 8 bits long.
so i wanted to converted that data in a decimal form. it is possible?
as i hv to send this to a bluetooth transmitter in UART mode.
mkuang
Joined: 14 Dec 2007 Posts: 257
Posted: Tue Aug 04, 2009 8:21 am
myumair wrote:
well ad7705 which is operating with pic in SPI mode sends that data and it is 16 bit long so PIC reads that twice from the adc register and store that in a stack [2] each 8 bits long.
so i wanted to converted that data in a decimal form. it is possible?
as i hv to send this to a bluetooth transmitter in UART mode.
Let's call your high byte High_Byte, your low byte Low_Byte, and the assembled value Final_Value for example. You can try something like:
Code:
long Final_Value;
char High_Byte = stack[0];
char Low_Byte = stack[1];
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum