caramoan tour package

caramoan tour package

Author Topic: Interrupt/Timer based Software UART - Noise  (Read 1453 times)

Offline rdpzycho

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 10731
  • Pogi/Ganda Points: 632
  • Gender: Male
  • Respect Begets Respect
    • rdpzycho
Interrupt/Timer based Software UART - Noise
« on: July 24, 2008, 11:21:54 PM »
sa mga nakagamit na ng Software UART sa Industrial Environment, pwede po pahingi ng comment sa susceptibility or immnity to noise. ;D

Data will come from RS485 lines (mataas na immunity sa noise) pero worry ko pa rin kung may glitches at puro resend na lang yung master, baka masyadong matagal na ang communication.

ang plano ko rather than taking a single sample of the bit, thrice ako kukuha ng sample (tulad ng hardware UART). medyo malaking time ang kukunin sa CPU ko pero mukhang mas immune to noise and false start bits.
‎"Divide each difficulty into as many parts as is feasible and necessary to resolve it."
- Rene Descartes

"For every difficult problem there is always a simple answer and most of them are wrong."
- Clayton Paul

Philippine Electronics Forum

Interrupt/Timer based Software UART - Noise
« on: July 24, 2008, 11:21:54 PM »

Offline paranz

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4525
  • Pogi/Ganda Points: 177
  • Gender: Male
  • 1/4W resistor specialist
    • RapidSignal Electronics
Re: Interrupt/Timer based Software UART - Noise
« Reply #1 on: July 24, 2008, 11:42:12 PM »
if im not mistaken, UART chips sample the incoming bits 16 times faster than the baudrate.

The MCU timer can still be used to generate the sampling freq. for the software UART
PIC16 Programming Tutorial using MPLAB and Hi-Tech C
www.rapidsignalph.com/tutorials/pic16-tutorials

Arduino & gizDuino Tutorials
www.rapidsignalph.com/tutorials/arduino-tutorials

Philippine Electronics Forum

Re: Interrupt/Timer based Software UART - Noise
« Reply #1 on: July 24, 2008, 11:42:12 PM »

Offline glutnix_neo

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4162
  • Pogi/Ganda Points: 166
  • Gender: Female
  • A journey to a thousand lines begins w/ LED Blink
    • Underground Workbench
Re: Interrupt/Timer based Software UART - Noise
« Reply #2 on: July 25, 2008, 07:40:01 AM »
sa mga nakagamit na ng Software UART sa Industrial Environment, pwede po pahingi ng comment sa susceptibility or immnity to noise. ;D

Data will come from RS485 lines (mataas na immunity sa noise) pero worry ko pa rin kung may glitches at puro resend na lang yung master, baka masyadong matagal na ang communication.

ang plano ko rather than taking a single sample of the bit, thrice ako kukuha ng sample (tulad ng hardware UART). medyo malaking time ang kukunin sa CPU ko pero mukhang mas immune to noise and false start bits.

yup, kailangan talaga isample ng maraming beses ang isang bit,
pwede mo rin bagalan ang baudrate mo kung hindi naman ganun kacritical ang speed.
If we hear,we forget;if we see, we remember;if we do,we understand.
Let's support the use of free and open source softwares...
http://UndergroundWorkbench.wordpress.com

Philippine Electronics Forum

Re: Interrupt/Timer based Software UART - Noise
« Reply #2 on: July 25, 2008, 07:40:01 AM »

Offline Ganda692002

  • Size D Battery
  • ******
  • Posts: 458
  • Pogi/Ganda Points: 13
Re: Interrupt/Timer based Software UART - Noise
« Reply #3 on: July 25, 2008, 08:29:41 AM »
Yung ibig mo ba sabihin ay example send 1011 then you send
111 001 111 111 then you will do error correction and 001 error will be 000 cause thre are two zero.. kung ganto ay..

pwede naman isend ito 3 times 1011 1011 1011...

di mo na kelangan mag bitbang you can use hardware instead.. pareho lang sila.. kelangan mo lang ng 3 level buffer..

Philippine Electronics Forum

Re: Interrupt/Timer based Software UART - Noise
« Reply #3 on: July 25, 2008, 08:29:41 AM »

Offline rdpzycho

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 10731
  • Pogi/Ganda Points: 632
  • Gender: Male
  • Respect Begets Respect
    • rdpzycho
Re: Interrupt/Timer based Software UART - Noise
« Reply #4 on: July 25, 2008, 09:52:22 AM »
wala kasing hardware UART yung gagamitin ko at hindi ko rin gustong i-resend. marami kasing data yung dadaan (up to 1024 nodes pero less than 10 yung initial number of nodes ko ngayon).

@paranz: yup 16x faster normally using samples 8, 9, and 10 (halfway) or sometimes 8x faster using samples 4, 5, and 6 then doing a majority vote.

baka gawin ko lang 8x, or 4x using samples 2, 3, and 4. pwede ko rin sanang gamiting yung hardware ng SPI pero meron namang nakakabit sa SPI. hehe.
‎"Divide each difficulty into as many parts as is feasible and necessary to resolve it."
- Rene Descartes

"For every difficult problem there is always a simple answer and most of them are wrong."
- Clayton Paul

Philippine Electronics Forum

Re: Interrupt/Timer based Software UART - Noise
« Reply #4 on: July 25, 2008, 09:52:22 AM »

Offline Born2BeWired

  • Technical People
  • Diesel Generator
  • *****
  • Posts: 1114
  • Pogi/Ganda Points: 168
  • Gender: Male
  • Analog and Precision Circuits Junkie
    • e-Gizmo Mechatronix Central
Re: Interrupt/Timer based Software UART - Noise
« Reply #5 on: July 25, 2008, 10:17:09 AM »
Sa industrial setup, the usual way is to insert an 8 or 16 bit checksum to verify the integrity of the transmitted packet. I always do it this way, and so far reliable naman ang transmission.

Agree din ako sa comment ni glutnix_neo, use only the speed you really need. Mas mataas ang baud rate, mas susceptible sa noise at iiksi ang usable control distance. Sa wiring side, it may be prudent to remind you to use twisted pairs para magamit mo nang husto ang advantage ng RS485. I have seen installations na ginamitan ng loose wires, sayang lang ang effort :).
Electronics <- Once you got a taste of it, you will never get enough.

Insanity <- Doing the same thing, expecting different results.

"The more I learn, the more I am humbled."

Offline rdpzycho

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 10731
  • Pogi/Ganda Points: 632
  • Gender: Male
  • Respect Begets Respect
    • rdpzycho
Re: Interrupt/Timer based Software UART - Noise
« Reply #6 on: July 25, 2008, 10:34:42 AM »
hehehe. marami na rin akong nakitang ganun. terminal kasi yung dulo kaya bahala na yung nag-install. I'll be using standard UTP cables and magpapadaan din ako ng supply voltage like Power over Ethernet.

mag-include talaga ako ng Checksum or CRC para ma-check talaga kung may error and use handshaking. iniiwasan ko lang na laging magkaroon ng resend dahil sa noise spikes kaya gagawa ako ng software filter. hindi pa kasi ako nakagamit ng interrupt based software UART on long distance transmission (mostly sa experiments lang) kaya uunahan ko na (proactive ;D) yung cases na magkakaroon ng spikes during sampling. ;D
‎"Divide each difficulty into as many parts as is feasible and necessary to resolve it."
- Rene Descartes

"For every difficult problem there is always a simple answer and most of them are wrong."
- Clayton Paul

Offline glutnix_neo

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4162
  • Pogi/Ganda Points: 166
  • Gender: Female
  • A journey to a thousand lines begins w/ LED Blink
    • Underground Workbench
Re: Interrupt/Timer based Software UART - Noise
« Reply #7 on: July 25, 2008, 10:44:33 AM »
hehehe. marami na rin akong nakitang ganun. terminal kasi yung dulo kaya bahala na yung nag-install. I'll be using standard UTP cables and magpapadaan din ako ng supply voltage like Power over Ethernet.

mag-include talaga ako ng Checksum or CRC para ma-check talaga kung may error and use handshaking. iniiwasan ko lang na laging magkaroon ng resend dahil sa noise spikes kaya gagawa ako ng software filter. hindi pa kasi ako nakagamit ng interrupt based software UART on long distance transmission (mostly sa experiments lang) kaya uunahan ko na (proactive ;D) yung cases na magkakaroon ng spikes during sampling. ;D

gagamit ka ba ng level shifter?(MAX232 etc)mas maganda yata kung RS232 ang level rather than 0V-5V level.
If we hear,we forget;if we see, we remember;if we do,we understand.
Let's support the use of free and open source softwares...
http://UndergroundWorkbench.wordpress.com

Offline rdpzycho

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 10731
  • Pogi/Ganda Points: 632
  • Gender: Male
  • Respect Begets Respect
    • rdpzycho
Re: Interrupt/Timer based Software UART - Noise
« Reply #8 on: July 25, 2008, 10:59:08 AM »
RS485 yung gagamitin kong driver, bali differential lines ang output, TTL naman sa MCU side. pero kailangan ko pa rin ng MAX232 sa side nung PC para sa RS232 to RS485 conversion.
‎"Divide each difficulty into as many parts as is feasible and necessary to resolve it."
- Rene Descartes

"For every difficult problem there is always a simple answer and most of them are wrong."
- Clayton Paul

Offline glutnix_neo

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4162
  • Pogi/Ganda Points: 166
  • Gender: Female
  • A journey to a thousand lines begins w/ LED Blink
    • Underground Workbench
Re: Interrupt/Timer based Software UART - Noise
« Reply #9 on: July 25, 2008, 11:01:51 AM »
Ah ic, tingin ko hindi naman magkakaproblema masyado sa MCU, pero good practice pa rin na may filter ka ng sample.
If we hear,we forget;if we see, we remember;if we do,we understand.
Let's support the use of free and open source softwares...
http://UndergroundWorkbench.wordpress.com

Philippine Electronics Forum

Re: Interrupt/Timer based Software UART - Noise
« Reply #9 on: July 25, 2008, 11:01:51 AM »

 

Privacy Policy

Contact Us: elabph@yahoo.com