- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm thinking of how to constantly output a character from the UART.
For example, the character 'h' will be outputted from the UART constantly.
The challenge is, I want to do it without calling a function like printf (ie. I don't want to use the CPU) AND without using the DMA.
Is that even possible? Or am I being too imaginative?
I know that the TX reg for the UART is a FIFO type, so I don't think I'd be able to hold data in there permanently.
Thanks,
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Easiest would be in an interrupt routine reacting un fifo empty and stuffing the fifo up to the top.
DMA is possible as well, choose your favorite method.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if it is always the same character - perhaps a LUT/constant +
shift register ? ))))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can create your own TX UART doing that. As a starting point, look at the PSoC Sensei blog. You just need to change it so it transmits the same character again if the last one has been sent out completely.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I think I'll just go with DMA, like Bob suggested. Much simpler IMHO.
Is it possible to transfer a constant situated in memory to UART Tx reg? I tried defining a region using the __attribute__ macro. Not sure now where I could put it in memory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Declare a global byte var (may be a const) and take it as source of DMA, Use 1 byte transfer and use the Tx int as start of DMA.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did this :
const uint8 car __attribute__ ((section(".CARCONST"))) = 'H';
I added an extra line in the linker to start the section at 0x00001000 (should be in Flash I think).
Not sure how to configure DMA TD.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is a DMA wizard to specify your Td.
Skip all that _attibute_ junk and the linker stories, you do not need that at all.
Pich a DMA-example from creator (for PSoC5) and see how it is organized.
Bob
(Sorry, no time at the moment to build an example myself)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alright,
It's okay, you guys helped me with this DMA stuff back then, still got those files handy.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok it's working.
Seemingly I forgot to enable the DMA, I've been going thru the codes for a while now