Hi,
Sorry for this seemingly simple question, but I'm quite the n00b.
I've bought a mini thermal printer which I want to control using the VoCore (v1.0).
The printer interfaces using a simple serial connection (TTL).
Using an arduino I've already been able to print all sorts of stuff, but I don't know how to do the same on vocore.
Can I connect the tx/rx pins on the printer to the G#16/RXD2 and G#15/TXD2 pins on vocore?
How do I setup the serial connection in code?
Here is an example on arduino of what I want to accomplish on vocore:
http://pastebin.com/YJ1NpyFg
Using serial on VoCore
- DuckerDuck
- Posts: 3
- Joined: Mon Jun 01, 2015 12:49 pm
- Vonger
- Posts: 897
- Joined: Sun Oct 19, 2014 6:00 am
Re: Using serial on VoCore
Please check my blog about using second UART, you have to update openwrt code to make the driver support second UART. http://vonger.cn/?p=1409. Once the driver works, linux UART interface /dev/ttyS1 should work, and then you can use linux uart api to control it, such as termios.h(standard UART library).
My blog has some note that I write for my develop, it might help you.
And I am interesting on your project, could you put it to project page after it is done?
My blog has some note that I write for my develop, it might help you.
And I am interesting on your project, could you put it to project page after it is done?
- DuckerDuck
- Posts: 3
- Joined: Mon Jun 01, 2015 12:49 pm
Re: Using serial on VoCore
Thanks for the reply vonger!
I had not seen this blog post, now I have a place to start.
If I ever finish this thing I'll post it to the projects page
I had not seen this blog post, now I have a place to start.
If I ever finish this thing I'll post it to the projects page
- DuckerDuck
- Posts: 3
- Joined: Mon Jun 01, 2015 12:49 pm
Re: Using serial on VoCore
Succes!
Thanks for the help!
If anyone is interested here is the simple example that printed this:
http://pastebin.com/Gdw42CEU
Thanks for the help!
If anyone is interested here is the simple example that printed this:
http://pastebin.com/Gdw42CEU
- maurymaury
- Posts: 1
- Joined: Fri Jan 15, 2016 10:31 am
Re: Using serial on VoCore
Hi Vonger,
I need to conserve the serial console on TX2,RXD2 pin (I have no LAN connection so I need it) and I want to use the other uart (RXD,TXD) to talk with a serial device.
I followed your instrution to enable the second serial port but afterthat It seems that booting console is lost when switching form "bootconsole" to "console"
[ 0.460000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 0.470000] console [ttyS0] disabled
[ 0.480000] 10000500.uart: ttyS0 at MMIO 0x10000500 (irq = 13, base_baud = 25
00000) is a 16550A
[ 0.500000] console [ttyS0] enabled
[ 0.510000] bootconsole [early0] disabled
After this message I have no more control over the booting process though my serial terminal (original firmware upgrade in KERMIT mode is needed to restore the board). Is there a way to conserve the serial console while using the second serial port?
maurizo
I need to conserve the serial console on TX2,RXD2 pin (I have no LAN connection so I need it) and I want to use the other uart (RXD,TXD) to talk with a serial device.
I followed your instrution to enable the second serial port but afterthat It seems that booting console is lost when switching form "bootconsole" to "console"
[ 0.460000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 0.470000] console [ttyS0] disabled
[ 0.480000] 10000500.uart: ttyS0 at MMIO 0x10000500 (irq = 13, base_baud = 25
00000) is a 16550A
[ 0.500000] console [ttyS0] enabled
[ 0.510000] bootconsole [early0] disabled
After this message I have no more control over the booting process though my serial terminal (original firmware upgrade in KERMIT mode is needed to restore the board). Is there a way to conserve the serial console while using the second serial port?
maurizo
Vonger wrote:Please check my blog about using second UART, you have to update openwrt code to make the driver support second UART. http://vonger.cn/?p=1409. Once the driver works, linux UART interface /dev/ttyS1 should work, and then you can use linux uart api to control it, such as termios.h(standard UART library).
My blog has some note that I write for my develop, it might help you.
And I am interesting on your project, could you put it to project page after it is done?
- Vonger
- Posts: 897
- Joined: Sun Oct 19, 2014 6:00 am
Re: Using serial on VoCore
maurymaury wrote:Hi Vonger,
I need to conserve the serial console on TX2,RXD2 pin (I have no LAN connection so I need it) and I want to use the other uart (RXD,TXD) to talk with a serial device.
I followed your instrution to enable the second serial port but afterthat It seems that booting console is lost when switching form "bootconsole" to "console"
[ 0.460000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 0.470000] console [ttyS0] disabled
[ 0.480000] 10000500.uart: ttyS0 at MMIO 0x10000500 (irq = 13, base_baud = 25
00000) is a 16550A
[ 0.500000] console [ttyS0] enabled
[ 0.510000] bootconsole [early0] disabled
After this message I have no more control over the booting process though my serial terminal (original firmware upgrade in KERMIT mode is needed to restore the board). Is there a way to conserve the serial console while using the second serial port?
maurizoVonger wrote:Please check my blog about using second UART, you have to update openwrt code to make the driver support second UART. http://vonger.cn/?p=1409. Once the driver works, linux UART interface /dev/ttyS1 should work, and then you can use linux uart api to control it, such as termios.h(standard UART library).
My blog has some note that I write for my develop, it might help you.
And I am interesting on your project, could you put it to project page after it is done?
I guess that the console is change to ttyS1 after you update the driver, so maybe you can continue get the console output by changing your uart port to RXD2 and TXD2.
Another way, I think modify boot up parameters might fix such issue, I did not try yet. it should be linux system config in device tree or uboot, or somewhere.
- noblepepper
- Posts: 240
- Joined: Sat Nov 29, 2014 3:22 pm
Re: Using serial on VoCore
I think this is due to the way the linux kernel parses the device tree (dts and dtsi files) when booting.
I make the beginning of my VOCORE-16M.dts file look like this and the console stays on the uartlite:
This way the kernel finds uartlite before uart and uses it for console output.
I make the beginning of my VOCORE-16M.dts file look like this and the console stays on the uartlite:
- Code: Select all
/dts-v1/;
/ {
palmbus@10000000 {
uartlite@c00 {
status = "okay";
};
};
};
/include/ "VOCORE.dtsi"
/ {
This way the kernel finds uartlite before uart and uses it for console output.
- Vonger
- Posts: 897
- Joined: Sun Oct 19, 2014 6:00 am
8 posts
Page 1 of 1
Who is online
Users browsing this forum: No registered users and 9 guests