From: gcon <gr...@rg...> - 2007-12-11 14:48:47
|
Hi all, Is it possible to access the two Robostix UARTs from the Gumstix (basix 400xm)? Alternatively, could a TTL device be connected to the I2C port on the Robostix and accessed through the Gumstix? Seeing as I have the Robostix and Gumstix communcating through I2C, I would assume some sort of master-slave driver would be required on the gumstix-robostix respectively. Ultimately I am trying to drive several character LCDs through a simple serial interface. Thanks, Greg -- View this message in context: http://www.nabble.com/Accessing-Robostix-UARTs-from-Gumstix-tp14275438p14275438.html Sent from the Gumstix mailing list archive at Nabble.com. |
From: Dave H. <dhy...@gm...> - 2007-12-11 15:16:01
|
Hi Greg, > Is it possible to access the two Robostix UARTs from the Gumstix (basix > 400xm)? Alternatively, could a TTL device be connected to the I2C port on > the Robostix and accessed through the Gumstix? Seeing as I have the Robostix > and Gumstix communcating through I2C, I would assume some sort of > master-slave driver would be required on the gumstix-robostix respectively. > Ultimately I am trying to drive several character LCDs through a simple > serial interface. You could access the UARTS in an output fashion by using direct register manipulation. To initialize the UART on the robostix, you need to configure the baud rate register. Lets say, that we'll use 38400 baud. The clock is 16 MHz, so we need (16000000 / 8 / 38400 ) - 1 = 51 i2c-io 0x0b writereg UBRR0H 0 i2c-io 0x0b writereg UBRR0H 51 i2c-io 0x0b writereg UCSR0A 0x02 i2c-io 0x0b writereg UCSR0B 0x18 i2c-io 0x0b writereg UCSR0C 0x06 And then you can write characters using: i2c-io 0x0b writereg UDR 0x54 i2c-io 0x0b writereg UDR 0x65 i2c-io 0x0b writereg UDR 0x73 i2c-io 0x0b writereg UDR 0x74 i2c-io 0x0b writereg UDR 0x0d i2c-io 0x0b writereg UDR 0x0a I'm assuming that the overhead involved means that you don't have to check to see if the character actually left the UART shift registers. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: gcon <gr...@rg...> - 2007-12-11 15:46:57
|
AHA! I now see that this is all in the ATmega128 Datasheet. Thanks! -- View this message in context: http://www.nabble.com/Accessing-Robostix-UARTs-from-Gumstix-tp14275438p14276690.html Sent from the Gumstix mailing list archive at Nabble.com. |
From: gcon <gr...@rg...> - 2007-12-12 04:29:13
|
I was able to get this working, although you had a small typo that drove me crazy for awhile :-) Dave Hylands wrote: > > i2c-io 0x0b writereg UBRR0H 51 > Should be: i2c-io 0x0b writereg UBRR0L 51 After reading the datasheet, I learned that UBRRnH contains the 4 MSBs and UBRRnL contains the 8 LSBs -- thanks to your typo for forcing me to finally page through the datasheet. Also, to write characters the register is UDR0 (but this was an easy one to figure out). Thanks again, Greg -- View this message in context: http://www.nabble.com/Accessing-Robostix-UARTs-from-Gumstix-tp14275438p14288871.html Sent from the Gumstix mailing list archive at Nabble.com. |
From: Dave H. <dhy...@gm...> - 2007-12-12 05:59:03
|
Hi Greg, > I was able to get this working, although you had a small typo that drove me > crazy for awhile :-) > > > Dave Hylands wrote: > > > > i2c-io 0x0b writereg UBRR0H 51 > > > > Should be: > > i2c-io 0x0b writereg UBRR0L 51 > > After reading the datasheet, I learned that UBRRnH contains the 4 MSBs and > UBRRnL contains the 8 LSBs -- thanks to your typo for forcing me to finally > page through the datasheet. > > Also, to write characters the register is UDR0 (but this was an easy one to > figure out). Sorry about that. I was making up the i2c-io commands by looking at my C code. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |