playing with serial transceivers
Ramon
Posts: 484
Yesterday I spent three ours reading the 3500 lines of "Prop2_Docs". The sections called "PIN TRANSFER" and "SERIAL TRANSCEIVERS" are GREAT ! I have two questions. The first for all you gurus, (the second for myself):
1) Is it possible to use three serial connections with 1 cog DE0-nano?
How can I make a small full-duplex code that takes byte "x" from SERA, and send "x+1" to SERB?
and (viceversa) takes byte "y" from SERB and send out "y+1" to SERB.
So I mean: one serial connection for programming (propeller plug) + 2 serial applications (SERA & SERB).
1) Is it possible to use three serial connections with 1 cog DE0-nano?
How can I make a small full-duplex code that takes byte "x" from SERA, and send "x+1" to SERB?
and (viceversa) takes byte "y" from SERB and send out "y+1" to SERB.
So I mean: one serial connection for programming (propeller plug) + 2 serial applications (SERA & SERB).
Comments
Why serial transceivers are not designed to automatically send transfers in the background? (Like SETXFR that use WIDE/AUX and moves from/to PINs in the background.) Is it because we need a way to check completition/status? That is the reason why we have two type of instructions: blocking instructions (until completition) and single clock instruction that writes status to carry.
I read that AUX memory already has pointers to make LIFO stacks. I wonder if AUX can also work as FIFO and in that case, if there is a way to make serial transfers in the background like SETXFR. What would be the pro/cons? (and if this makes the work easier forcommunications (like synchronous serial, SERDES, or even 8b/10b and CRC?)
Read on use FLAG's on serout, serin
That send receive with no wait on them
Ramon
DE0-Nano will only support one counter, so only SERA is supported.
In answer to your other question, multi-tasking would support 2 HW serial and 1 SW serial easily.
Brian
Each SER has its own baud rate generator, so you can use both at once. They don't use the counters, at all.
You have 3 choices as to where you buffer the data.
Cog ram, Aux ram and Hub ram.
Take a look at the INDA/B,PTRX/Y and PTRA/B registers for use as buffer pointers.
Edit: Yes that's basically it, no nops required though.
Imagine that each task have only one hand (for task one everything it takes from A goes to B; for task 2: everything that comes from B goes to A).
And order changed so first pass doesn't send a zeoo byte.
Andy
Read this post from Chip.
http://forums.parallax.com/showthread.php/154230-playing-with-serial-transceivers?p=1245926&viewfull=1#post1245926
SER have its own counters
This is what got removed for DE0: ... and I think in the last build also the output logic for CTRA.
Andy
I don't have the PropPlug, I have two USB-TTL transceivers (one is CP2102 and the other is PL2303).
CP2102 gets COM9
PL2303 gets COM10
I have tested p2load and PNUT at 9600 baud and both failed. (PNUT only with CP2102 because PNUT cannot count more than 9
I remember there was some post that said that only RX/TX are needed. Or do I need RESn connected to make it working?
What I am doing wrong?
And remember, there is no SERB on the current DE0 build, so some examples above will not work.
See this thead for the right pins, or here.
It should be possible to talk to the monitor without the Reset pin onnected (maybe you need to pull Reset high with a resistor). You also can load and start some programs with the monitor. Prop2Terminal for example has an upload feature that loads a .obj file from PNUT over the monitor, but I'm not sure if this still works after all the chances since I made Prop2Terminal.
Andy