init_uart_clock ?

9 5553
Post Last Edited by vk4tux at 2014-7-16 04:57

Post Last Edited by vk4tux at 2014-7-16 04:49

..   --  ..  --   .. -- ..

Reply 3# vk4tux
In Banana Pi, we can use the uart0(for debug), uart2 , uart3 or uart7.  For example, if you opened the uart0, uart2, uart7. Then the uart0is "ttyS0", uart2 is "ttyS1", uart7 is "ttyS2".
OK, in wringPi, if we use uart2 :
  1. serialOpen("ttyS1", 15200)
Copy the Code

It will work on 115200 bound rate.

I want to see your full [uartX_para] configure, and wiringPi code.

I try the serial example of wiringPi, it works well.

So long your code. But it seems that your code do not use the wiringPi to do the serial port operation, you just use the wringPi to do digitalread and digitalwrite.  You use the write and read function to do the serial communication. OK. Did you have a separate program just to test the serial port? It works well ? By default the uart works at 9600 baund rate when the board boot up.

Reply 12# vk4tux

It says the serial can work, but the baud rate is not satisfied with your requirement. Yes???
  1. port = serial.Serial("/dev/ttyS1", baudrate=SERIAL_BAUD, timeout=1.0, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, xonxoff=False, rtscts=False, dsrdtr=False)
Copy the Code

I find you set the baud rate here.

You say you want the default baud rate is 3686400 when the board boot up. Not the 9600. Yes???

I think you can add a shell script that set serial baud rate into the init.d file or the rc.d file.  That's my suggestion. You can also Google how to achieve that.

Reply 18# vk4tux

I don't see any parameter set baud rate in the script.bin. Maybe I don't know how to set.

Reply 21# vk4tux

It works now?

You have to log in before you can reply Login | Sign Up

Points Rules