CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
9 databits in Device::SerialPort

 



FPeter
Novice

Nov 9, 2012, 2:17 PM

Post #1 of 5 (4820 views)
9 databits in Device::SerialPort Can't Post

Hi All!

As i see, its not possible to set databits to 9 directly when using Device::SerialPort. Is there any way to read 9 bit frames from a special serial source? 9th bit means the starting of new packages, so it should be handled somehow... Is it possible to use the parity bit for this? Only reading is required, sending is not necessary...

Best regards


Laurent_R
Veteran / Moderator

Nov 10, 2012, 12:51 AM

Post #2 of 5 (4813 views)
Re: [FPeter] 9 databits in Device::SerialPort [In reply to] Can't Post

Hmm, not sure what you mean exactly by databits, but it could be that the number of bits has to be a power of 2.


FPeter
Novice

Nov 10, 2012, 1:06 AM

Post #3 of 5 (4812 views)
Re: [Laurent_R] 9 databits in Device::SerialPort [In reply to] Can't Post

in normal case, we use 8N1 mode, means 1 startbit + 8 databit + 1 stopbit

but now i need 1 startbit + 9 databit + 1 stopbit, where the 9th databit is a control bit. on PIC microcontrollers, You can write/read the parity bit register by software to implement the 9th bit - but i dont know if its possible in perl...


Laurent_R
Veteran / Moderator

Nov 10, 2012, 3:39 AM

Post #4 of 5 (4809 views)
Re: [FPeter] 9 databits in Device::SerialPort [In reply to] Can't Post

I had not seen that you were dealing with serial ports, and understood something different, therefore my previous answer was irrelevant.

I know nothing about serial ports, but the CPAN documentation (http://search.cpan.org/~cook/Device-SerialPort-1.000002/SerialPort.pm) seems to be saying:


Quote
databits

An integer from 5 to 8.



FPeter
Novice

Nov 10, 2012, 4:50 AM

Post #5 of 5 (4806 views)
Re: [Laurent_R] 9 databits in Device::SerialPort [In reply to] Can't Post

yes, it gives error message when i try to set databits parameter to 9

so im asking if there is an alternative roundabout to handle 9th bit, like soft reading of parity bit or any other way

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives