Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 14th June 2008, 08:39 PM   (permalink)
Default

sorry i understood the byte and bit stuff, i just made a mistake there. The aim of the project is simply to test the how well data can be transmitted over a power line. the data i send is not the problem. but i think i'll send ASCII characters just to see if i can send an "A" and receive an "A" on the other end. like i said i could also transmit single or byte data also not necessaritly ASCII, is there much of a diffrence so long as it is binary data?
ulot is offline   Reply With Quote
Old 14th June 2008, 09:46 PM   (permalink)
Default

Since i'm better on programming than analog electronics, i can give a little tip on this, well by convension, any String sequence is ended with an "invisible" character wich is the '\0', this is the same as the ASCII value 0, in other words, it means nothing LOL, you don't need to detect an String start because you know when it ends !
One last thing, this one last tip is used in a many protocols that use RS-232 as an transmittion channel, since you will send Strings, send all kinds of data as String, convert all numbers to Strings, that way it will be easy to decode and parse the values on the other side

One example of one know protocol that do things this way is the NMEA0183 for GPSs

(don't complicate something as simple as this...)

Have Fun !
__________________
Best Regards,
Tiago Silva.
TiagoSilva is offline   Reply With Quote
Old 15th June 2008, 08:04 AM   (permalink)
Default

Quote:
Originally Posted by ulot View Post
sorry i understood the byte and bit stuff, i just made a mistake there. The aim of the project is simply to test the how well data can be transmitted over a power line. the data i send is not the problem. but i think i'll send ASCII characters just to see if i can send an "A" and receive an "A" on the other end. like i said i could also transmit single or byte data also not necessaritly ASCII, is there much of a diffrence so long as it is binary data?
hi,
From what you are saying, its just for demonstrating data transimission using the local power lines,
I would suggest ASCII coding would be easier to use as a starting point.
By using ASCII you will be able to use a simple program in your PC, something like the free version of Procomm,
there are lots of free Comms programs on the web.

Terminate the transmitted byte/character with a CRLF code, thats your data, then 0Dh and then 0Ah.
Some PC programs will wait for this CRLf before they display the data/string.

For the Binary data, intially use say 4800,N,8,1 the 8 is the width of the byte [number of bits that make the byte]
The PC program will have to be able to decode the binary data and print the corresponding character.
Note: byte from 0d thru 31d are control characters.

With Binary data transmission you cannot use CRLF as a terminator.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 15th June 2008 at 08:05 AM.
ericgibbs is offline   Reply With Quote
Old 16th June 2008, 01:03 PM   (permalink)
Default

The power line modem IC is the ST7540 FSK modem.
It simply receives binary data, modulates it using the FSK modulation scheme and transfers the data over the power line. In receiving mode, the chip demodulates the FSK signal and recovers the digital signal, transmitting it back to a receiving PC or any device.

the problem is that the chip takes some time to analyse the FSK signal before it starts to demodulate it. within this time, some of the data modulates will be lost. this is why a preamble must be added to the actual data so that none of the data is lost. The technical suport from the manufacturer recormends about 2bytes of preamble to be sent with the data

so i need a microcontroller to manage the communication between the PC and the chip, not to mention the fact that it chip has a select pin that changes its mode from transmission to reception and well as a configurable register.

the register selects which kind of transmission mode, (Sync or Async), channel frequency, baud rate with which to expect incoming serial data and many other functions.

i already have a PC program to send ASCII characters over the serial port which i intend to use to test the power line interface.

so i guess thats it about the kind of data i'm using and why the preamble is needed.
ulot is offline   Reply With Quote
Old 16th June 2008, 01:25 PM   (permalink)
Default

Quote:
Originally Posted by ulot View Post
The power line modem IC is the ST7540 FSK modem.
It simply receives binary data, modulates it using the FSK modulation scheme and transfers the data over the power line. In receiving mode, the chip demodulates the FSK signal and recovers the digital signal, transmitting it back to a receiving PC or any device.

the problem is that the chip takes some time to analyse the FSK signal before it starts to demodulate it. within this time, some of the data modulates will be lost. this is why a preamble must be added to the actual data so that none of the data is lost. The technical suport from the manufacturer recormends about 2bytes of preamble to be sent with the data

so i need a microcontroller to manage the communication between the PC and the chip, not to mention the fact that it chip has a select pin that changes its mode from transmission to reception and well as a configurable register.

the register selects which kind of transmission mode, (Sync or Async), channel frequency, baud rate with which to expect incoming serial data and many other functions.

i already have a PC program to send ASCII characters over the serial port which i intend to use to test the power line interface.

so i guess thats it about the kind of data i'm using and why the preamble is needed.
hi,
The preamble for the string is so that the FSK circuit can lock onto to the incoming FSK, you have answered this part.

You could try having a fixed length data string, say 2 bytes of preamble, 12bytes of data and CRLF, a total of 16 bytes.

In the PC program save all the received bytes in a string, get the length of the string, which may vary on how well the FSK locked on during the preamble.
You could use a ASCII Control code for the two pre bytes.

Use the right 14 bytes of data in the string as 'valid' data.

Which part do you require a more detailed explanation.?
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 16th June 2008 at 01:26 PM.
ericgibbs is offline   Reply With Quote
Old 17th June 2008, 02:53 PM   (permalink)
Default

2 byte string, 12byte data and 2bytes of CLRF. what is CRLF or did you mean CRC?

my main proble now is how to detect the beginning of my data since i know my first two bytes before the data will not be complete?

What do you mean by save the received data is a string? is that the same as creating a number of registers to store each byte?

Or are you asking that i send all the data received straight to the PC and let it sort out the data itself? Implying that the PLC simply keeps storing the data until the line is empty then transfers it raw to the PC to process. if that's the case, i have to break up the entire data into RS232 data size then have a PC program reassemble the data.
ulot is offline   Reply With Quote
Old 18th June 2008, 12:07 AM   (permalink)
Default

Quote:
Originally Posted by ulot View Post
2 byte string, 12byte data and 2bytes of CLRF. what is CRLF or did you mean CRC?
"CRLF" = carriage return, line feed; two characters with the values 0x0A 0x0D.
David James is online now   Reply With Quote
Old 18th June 2008, 08:45 AM   (permalink)
Default

Quote:
Originally Posted by ulot View Post
2 byte string, 12byte data and 2bytes of CLRF. what is CRLF or did you mean CRC?
CRLF Carriage return Line feed,, 0dh,0ah

my main proble now is how to detect the beginning of my data since i know my first two bytes before the data will not be complete?
You detect the END of the string, that is the CRLF

What do you mean by save the received data is a string? is that the same as creating a number of registers to store each byte?
As each byte is received in the PC program, it adds the latest byte to the end of the string, when it gets CRLF its knows thats the end of the string and it will display the righthand 14 bytes of the string.

Or are you asking that i send all the data received straight to the PC and let it sort out the data itself? Implying that the PLC simply keeps storing the data until the line is empty then transfers it raw to the PC to process. if that's the case, i have to break up the entire data into RS232 data size then have a PC program reassemble the data.
hi,
The nature of the transferred data, raw or processed, is a decision you make when you are writing
the programs for the PC and the PIC,
The UART's are not bothered if the data is raw or processed.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 18th June 2008 at 08:46 AM.
ericgibbs is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
project ideas for final year project! AceOfHearts Electronic Projects Design/Ideas/Reviews 3 24th April 2007 05:42 PM
need suggestions on uni project. (mechatronics project) konzen General Electronics Chat 16 13th March 2006 11:56 AM
electronics project for btech mini project sujith123 Electronic Projects Design/Ideas/Reviews 4 23rd September 2005 11:28 PM
i need a project idea\concept for a 10 month project..... mackoy General Electronics Chat 3 21st February 2005 11:27 PM
biomedical project(electronic project) naguru Electronic Projects Design/Ideas/Reviews 1 2nd November 2004 11:07 AM



All times are GMT. The time now is 10:28 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.