This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Guys, The F28377D LQFP has 3 32bit data ports. I'm using one port as a 32bit databus and the IN instruction only reads the lower 16bits and ignore the upper 16bits.
How do I read the full 32bit port?
The code I'm using is:
IN AL, *(PORTA) ; This works ok but only reads the lower 16bits.
IN ACC,*(PORTA); This does not work. The ACC is a 32bit register and the assembler will not allow it.
Any ideas?
Peter
Hi Peter,
Yes, the IN instruction only works on 16-bit data moves. To perform a 32-bit read from external memory on this device you'll need to set up an XAR register and do a MOVL into the accumulator. Something like:
MOV AH, #0x8000
MOV AL, #0x0000
MOVL XAR2, ACC
MOVL ACC, *XAR2
Regards,
Richard
Hi Richard, thank you for this. I thought it could do it but using the IN command.
Can I ask you one more thing. In CCS9 I created a mixed C and assembler project and let C know about the external asm file.
All built fine and downloaded and run on my 28377D.
I've now created a who new CCS project but assembler only and now when I build CCS 9 tells me NO SUITABLE ENTRY POINT - SETTING to 0.
And when I run the assembler program it doesn't run.
Can you let me know how to set the entry point please. Oh, in assembler. I'm guessing its not .ORG like the old times. LOL.
Thanks Richard, hope to hear from you soon.
Peter
Hi Peter,
No, the good old days have gone.
It's unusual to have an "assembly only" program on this device, but there's no reason why it shouldn't be done. If you've configured the device to boot into RAM, the PC will go to address 0x00000000. You'll need to place an LB instruction at that location to branch into wherever your program is. For example, in your linker file you might have:
MEMORY
{
PAGE 0 :
BEGIN : origin = 0x000000, length = 0x000002
...
}
SECTIONS
{
cstart : > BEGIN, PAGE = 0
.text : >> RAMD0 | RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4, PAGE = 0
...
}
Then, in your code:
.def _start ; code entry point
.def _c_int00 ; C boot label to avoid linker warning
; branch to start of program: place at boot exit point in .cmd file
.sect "cstart"
_c_int00:
LB _start ; jump to start of program
.text
_start:
; your code starts here
MOV @SP, #0x0400
...etc.
If you're building for flash you'll need to place cstart into 0x80000. This seems to work on my LaunchPad - let me know if you run into any difficulty.
Regards,
Richard
Thanks Richard, you're the best. :)
A while ago I developed a hand held game using the F28377D and in CC6 (I think) it was years ago, had a problem.
I needed to store all the game graphics and sound FX (sampled 8 bit samples) in to the 28377D's flash memory. FLASH B, C, D, E are all 32k in size and when my assembler listing size exceeded 32K the assembler CC6 would NOT write the rest of my code to the other FLASH banks.
The error I was receiving was CODE TO LARGE TO FIT IN TO BANK B and then it would not compile anymore so I was stuck with 32k only.
I was wondering if CC9 has fixed that problem? Would you know? I suppose I could try it myself and see. I will let you know.
Again, thank you so much for your help, it's truly appreciated.
Pete. :)
Hi Peter,
Glad to help. The flash question is a little outside my knowledge so I've asked a colleague to look into it. Thanks.
Regards,
Richard
Hi Peter,
I discussed this briefly with a colleague but it didn't ring any bells. If you can provide a little more background on the issue it will help us work out what's happening.
The flash sectors you listed are all 8K (not 32K) so maybe that was the issue? It might be just a matter of combining the sectors into one unit in the linker command file. Anyway, if there's a old forum thread or something you can point me at I'll be glad to spend some time on it. Thanks.
Regards,
Richard