caramoan tour package

caramoan tour package

Author Topic: Question on Synchronization and/or Re-assembly of transmitted digital data  (Read 1020 times)

Offline sirc4527

  • CR2032 Battery
  • **
  • Posts: 29
  • Pogi/Ganda Points: 0
  • Gender: Male
I have made 2 programs and 2 circuits for an encryption system. I used c8051F330 from SiLabs.

My plan is to create deviceA for accepting the voice then converting it to digital then encrypt it then transmit it as PCM signal. (I'm done with this)
then create deviceB for accepting the output of deviceA which is PCM signal then recreate that PCM signal back to bytes of data, decrypt it and then output using a speaker.

My problem is that I don't know how I can convert the PCM signal back to bytes of data using the microcontroller.

I don't know if I have explained it clearly. please let me know if you have not understand it. thanks!
Mapúa Institute of Technology
SY 2004-2008
Licensed Electronics Engineer

Philippine Electronics Forum


Offline anthonydp

  • Size D Battery
  • ******
  • Posts: 320
  • Pogi/Ganda Points: 54
  • Gender: Male
    • My Empty Blog
You may look in this thread:

http://www.electronicslab.ph/forum/index.php/topic,7421.msg188658.html#msg188658

Sevenstring's code is an elegant way of doing what I think you want to do.
your question appears to be an XY Problem.

why don't you just tell us exactly what you're trying to do?

Philippine Electronics Forum


Offline sirc4527

  • CR2032 Battery
  • **
  • Posts: 29
  • Pogi/Ganda Points: 0
  • Gender: Male
Thanks! I'll check it now
Mapúa Institute of Technology
SY 2004-2008
Licensed Electronics Engineer

Philippine Electronics Forum


Offline sirc4527

  • CR2032 Battery
  • **
  • Posts: 29
  • Pogi/Ganda Points: 0
  • Gender: Male
Quote
Quote from: marcelino on September 06, 2009, 11:21:12 PM
pwede magrequest ng code snippet for sampling?

di ba yung pagsend ng serialized data ang tawag "bit bangging!" in reverse, ayon sa wiki, sampling naman.

for example may 16bit ako na irereceive, papano ko yun isesave sa isang 16-bit variable?

BTW, para sa to sa TMP124. SPI ang protocol na gamit. kaso di ko naman kailangan iwrite. sabi daw sa datasheet,  once CS becomes low, it will send the 16-bit temperature right away...

eto yung graphical sequence:


thanks in advance...


parang nabobobo ako ngayon ah...  
i am thinking of bit shifting, pero talgang di umaabot ang utak ko ngayon. heheheh


yes bit shifting....

parang ganito (based sa graphical sequence)

unsigned int myData=0;
unsigned char ctr= 15;
CLK=0;
CS=0;
do
{
if(SO) myData|=(1U<<ctr);
CLK=1;
CLK=0;
ctr--;
}while(ctr!=255);// let it overflow hehe
CS=1
return myData;

dagdagan na lang ng delay hehe

ito ba ung tinutukoy nyo? di ko makita ung sevenstring's code. thanks sa help! I'll research on reception of serially sent data
Mapúa Institute of Technology
SY 2004-2008
Licensed Electronics Engineer

Philippine Electronics Forum


Offline anthonydp

  • Size D Battery
  • ******
  • Posts: 320
  • Pogi/Ganda Points: 54
  • Gender: Male
    • My Empty Blog
heto po (courtesy of XNA_7 aka sevenstring):

Code: [Select]
unsigned int SerialToParallel_16bit(void)
  {
  unsigned int myData=0;
  unsigned char ctr = 15;  //we have 16 bits to shift in
  CLK=0;  //map to port pin
  CS=0;   //map to port pin. SO is also mapped to a port pin
 
  do
    {
    if (SO) myData |= (1U<<ctr); //if the SO pin is high, shift 0x0001 "ctr" times to right then logical-OR that value to myDATA's value.
    CLK=1; //shift in the next serial data bit using this high-to-....
    CLK=0; // ... low clock transition.
    ctr--;  // update our bit counter
    }
  while (ctr != 255);// let it overflow hehe (because when ctr == 0, the SO pin still holds the last data bit and must be process still)
  CS=1
  return myData;
}

your question appears to be an XY Problem.

why don't you just tell us exactly what you're trying to do?

Philippine Electronics Forum


Offline sirc4527

  • CR2032 Battery
  • **
  • Posts: 29
  • Pogi/Ganda Points: 0
  • Gender: Male
Thanks please check my other post too. nagpost din kasi kos sa PIC section dahil mas active dun. thanks ulit!
http://www.electronicslab.ph/forum/index.php/topic,14185.0.html
Mapúa Institute of Technology
SY 2004-2008
Licensed Electronics Engineer

Philippine Electronics Forum


 

Privacy Policy

Contact Us: elabph@yahoo.com