Simple answer, yes.  

As part of fopen, you need to flush and set up the buffers, and decide 
whether it is blocking or not, and check for initialization errors, but 
once you get the hang of that, it is not hard.

Being a "legacy" protocol, serial is very mature, and lots of good example 
code out there, that has not needed revision in the last 20 years. 

All of this dates to the dawn of UN*X.

The operator console on the very first UN*X machines were teletype (tty) 
machines or early electronic terminals that emulated teletype machine 
serial communications.

Your PICs will enjoy talking to ole Grand Dad.

--- Graham

==


On Monday, January 30, 2017 at 2:31:57 PM UTC-6, woody stanford wrote:
>
> Thank you for the quick and informative reply, Graham.
>
> So ttyOx IS the UART abstraction that is used by UN*X typically? So I 
> should just be able to fopen (speaking C) /dev/ttyO1 and have read write 
> stream access to the TX and RX pins of UART1, assuming of course I've setup 
> the "overlays" correctly? Is my question.
>
> Sorry, just so used to being able to read from and write to COM1, that 
> this process sounds so involved.
>
> I have some PIC's that want to make serial love to my BBBW is all. And I'm 
> not used to letting my PIC's down. I will have you know that my PIC16Fx's 
> are pretty good "bitbangers" themselves.
>
> On Monday, January 30, 2017 at 5:55:06 AM UTC-7, woody stanford wrote:
>>
>> I'm of the opinion that a lot of the terminology being used is being 
>> mixed, slurred, shifted in such a way to make basic concepts difficult to 
>> understand. I thought I would just talk about it.
>>
>> What is SPI? You can use the terms UART and SPI interchangably. Bear with 
>> me on this...my point is cultural. SPI is ***serial***, asynchronous (in 
>> that it doesn't require a clock line, it uses timing purely) and 0V meaning 
>> zero and +5V meaning one (TTL). That I suppose you can have SPI use +3.3V 
>> to represent one is acceptable.
>>
>> This whole idea about SPI "throwing ioctl errors" is preposterous based 
>> on the previous. SPI is generated by a UART, a chip, a piece of hardware 
>> (that you can code a software UART not withstanding). SPI is the protocol 
>> that is the raw output of a UART.
>>
>> I2C is understood to be (1) a protocol that uses a clock signal in 
>> conjunction with a data line, and (2) has something to do with being able 
>> to multiplex several "peripherals" at the same time with allusions to being 
>> the little brother of RS485. And no one really knows what CAN does, only 
>> that it is there and is comforting to know that you can connect as many 
>> things to your CPU as you could possibly conceive. It is a mystery lol. 
>>
>> That we are being held hostage by electrical engineers and the whole 
>> microcontroller community does in no way change the fact that the BBB is a 
>> true UN*X host. Its just the way that it is.
>>
>> Which leads to the inevitable question, why this ambiguity regarding the 
>> correct procedure to configure and utilize the P8 and P9 connectors. This 
>> is a TRIVIAL issue on a microcontroller. You just set the configuration 
>> registers such and communicate. Why this ambiguity on the BBB, whether real 
>> or perceived? I suppose that someone in authority at Beagleboard has to 
>> settle the issue for the prime path to success in using the P8/9 
>> connectors. This ambiguity is killing me. Does libpruio do it? I don't know 
>> :)
>>
>> My understanding of it is thus (and I'm sure its inaccurate and I beg 
>> someone to definitively explain it better so that I might understand), that 
>> it is a combination of a systems administration task combined with a 
>> programming task, that both must be done in order to unlock the potent 
>> connectivity powers of the BBB's P8 and P9 headers.That the crux of the 
>> issue is two fold, that I must add some lines to various configuration 
>> files so that it activates the ttyO1 thru ttyO6 "terminals" which allows 
>> civilized serial (and other communication like GPIO) to happen. My 
>> instincts tell me that this pertains intimately to the UN*X concept of a 
>> "stream", a concept of power and thus an element of our UN*X faith.
>>
>> Is this so? And if not, how is it? Is my question to the minds greater 
>> than my own.
>>
>> Thenwe use such programming concepts such as fopen() and open() to 
>> communicate with ttyO1 thru ttyO6 providing abstraction yet nimble, 
>> universal connectivity.
>>
>> Thoughts?
>>
>>
>>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/9b53a20f-1064-42cd-bfbe-8e90c3531d55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to