[MOVED] PIC 18f97j60 issue in transmission

Status
Not open for further replies.

tommy92

Newbie level 4
Joined
Feb 8, 2013
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,319
Hi I am using the Pic 18f97j60 in my project.In that project I am interfacing the 18 Bit DAC with the MicroController .For sending the data to DAC I am converting the 8 Bit data from the Microcontroller to 18 Bit data then I am separating that 18 bit to (2 BYTE + 2 BIT).My doubt is that how to convert that 2 Bit data in to 8 Bit data for transmission ..
Please help me with the suitable example for this particular PIC

Protocol:SPI
 




My doubt is that how to convert that 2 Bit data in to 8 Bit data for transmission ..

so, you need decoder logic for to convert that 2 Bit data in to 8 Bit data
 

Your data is like this 10 11001100 00110011? 2 + 8 + 8 bits? What do you mean by conversion of the two most significant bits to 8 bits? In a variable the last two bits will be stored as 00000010 which is 8 bits.
Will you send data serially? Are you not feeding the 18 bits to DAC?
 
ya ya I am sending the data serially from PIC. So, we need to send in 8+8+8 format only.. My doubt is I dont know how to append the 2bits(MSB) into 8 bits.. I need to send 18 bits to DAC. But how can i send it from PIC which sends 8 bits at a time?
 

Is your DAC a serial DAC i.e., it takes input serially? If yes, have you connected DAC input to Tx pin of PIC? Are you splitting the 18 bits into 2 8 bits and 2 bits and storing the 8 bits in seperate variable before sending serially? The smallest variable char type is a byte sized variable and if you store any value between 0-255 in a char it will be8 bits only. If you store binary 11 or decimal 3 or hex 3 in char it will be stored as 00000011 which is 8 bits. If you have first byte in byte1 and second byte in byte2 and 3rd byte in byte3, you send each variable serially one after another.
 

    V

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…