Hi Heimir,

It has been so long since I did anything with serial ports on the TMS570 that I totally forgot something important.  I'm putting this on the software list too to help anyone else remember what is going on, and especially Zach.  Also on the pacsat list mainly because of the info about the HET, which some pacsat people may need (my condolences).  Pacsat folks, Heimir has written a code loader that loads over the serial port via the satellite umbilical so we can update code after the satellite is assembled.

First you need to know that the TMS570 has a gadget called the HET (High End Timer). 
This is a programmable peripheral that has a fairly high-speed and accurate clock.  The "programmable" part is really microcode in the old computer sense.  It uses an "assembly language" to do low level things like wait for a clock tick, raise this pin, and branch to one of 3 or so different places depending (and do something else too by the way).  I am pretty good at assembly language in several computers, and this is really horrible.  TI gives you a special "HET IDE" to write programs in it but I mainly found example programs and modified them slightly.  Here is an example of what it looks like:

SCITX    CNT     { next= Lm10,  reg = T, max= 64, irq = OFF,data=0} ;****Baud rate writes to max value here!
Lm10     BR      { next= SCIRX, cond_addr= Lm11, event = ZERO}
;Every BAUD_DIVIDER + 1 LRP, send out one bit
;DJZ checks if any active bits needs to send out
Lm11   DJZ { next=SendOverINT,cond_addr=SCIRX,reg=A,irq=OFF,data=0};***set to number of bit to transfer
;CNT is used to generate the interrupt when sending is done
SendOverINT   CNT { reg=A,irq=ON,max=9,data=0};
;SHFT out the data to the TX1_PIN
Lm12   SHFT { next=SCIRX,smode=OR0,prv=OFF,cond_addr=SCIRX,cond=UNC,pin=TX1_PIN,reg=A,irq=OFF,data=0x0}; **Data goes here

Next, the TMS570 has two serial port hardware devices called SCI and SCILIN (LIN has some fancier capabilities that I don't right now remember).  However, we needed three serial ports:

1) The console line and code loader.
2) Talk to the SDR (Ettus E310)
3) Talk to the ADAC

What I did was assign the 2 and 3 to the SCI and SCILIN, and the console to one of the two HETs.  Yes, that HET has firmware to make it emulate a serial port.  (The other HET has firmware to emulate an I2c master peripheral because the TMS570 has only one hardware I2c peripheral). 

So here is the critical thing, Heimir:  We either will need to include the HET firmware as part of the flash loader or else use one of the hardware serial lines for the console.  And if we do that, it will mean changes to the V2 RT-IHU (the pins for the two hardware serial ports currently go through a bus switch, while the console for each processor has its own set of bus lines).

I don't know where you are now, but I'd suggest you get it working with one of the hardware serial lines--probably just what you did with the LaunchPad--and we can decide how we are going to do this a bit later (but before Zach finishes the layout for RTIHU V2).  Just remember that when you are using the hardware serial lines, they go through the bus switch and only connect to one of the processors at a time.

Sorry to throw this in...I had totally forgotten, as I said before.


73,

Burns Fisher, WB1FJ
AMSAT(R) Engineering -- Flight Software