- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
I Want to know if is possible change the parity in a uart module in when the code is in execution, I made this code
........
while(1){
TX8_Start(0x02);
TX8_PutSHexByte(0x08);
TX8_Start(0x00);
TX8_PutSHexByte(0x03);
.............
}
Can I change the parity with this manner?
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I personally would issue a TX8_Stop() in between to shut down the UART. Your example should work, but I didn't go through the generated code yet. Do you have got a PSoC1 Development Kit to proof-read with a logic-analyzer?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It would be safer to check and make sure the previous byte was completly shifted out before you do anything with the UM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
unfortunately I don´t have a PSoC1 Development Kit, but I will prove TX8_Stop() and see what happen 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello HL
I proved using TX8_Stop() function sending the data to hyperterminal by Bluetooth but I don't receive any data this is the code that I have used
TX8_Start(0x02);
TX8_PutSHexByte(0x08);
TX8_Stop();
TX8_Start(0x00);
LCD_Delay50uTimes(248);
TX8_PutSHexByte(0x08);
TX8_Stop();
When I use the code that I wrote before, I received the data that I sent but I don't know if the parity really change.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are not using BYTE UART_bReadTxStatus(void)
To test if first put was finished before you stopped UART. So
your first 2 byte xmit may have been prematurely terminated.
As HL mentioned earlier.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are not using BYTE UART_bReadTxStatus(void)
To test if first put was finished before you stopped UART. So
your first 2 byte xmit may have been prematurely terminated.
As HL mentioned earlier.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks dana
It's correct this code
TX8_Start(0x02);
TX8_PutSHexByte(0x08);
while( !( TX8_bReadTxStatus() & TX8_TX_BUFFER_EMPTY ) );
TX8_Stop();
TX8_Start(0x00);
LCD_Delay50uTimes(248);
TX8_PutSHexByte(0x08);
while( !( TX8_bReadTxStatus() & TX8_TX_BUFFER_EMPTY ) );
TX8_Stop();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you look into the datasheet of the TX8 you will see that there is a TX-Buffer and a Shift register. Data is transferred from the Buffer to the shifter which frees the buffer again, but nothing has been shifted out yet. When the shifter is ready, it is signalled by the TX8_TX_COMPLETE bit set in the status. So, to make a long story short: You ought to monitor the TX_COMPLETE.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So I only change TX8_TX_BUFFER_EMPTY for TX8_TX_COMPLETE in the code that I put Before?
Thanks 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If i am using the buffer, i would check buffer empty first and then tx complete. Or check both in one instruction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I proved Using TX8_TX_BUFFER_EMPTY and then TX8_TX_COMPLETE but I recieved the data incompletely, I send 0xA8 and 0xC8 with the TX8_PutSHexByte but only recieved 8 (the Byte A is missing) and then C8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Manual states that reading the status-bits will clear them! So if you do not intermediately keep the result from the status-read you might clear a "transfer complete" when looking for a "buffer empty".
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bob, your thread you referred to should be looked at by Cypress
to create/incorporate an API to make this bulletproof for users in
a future Designer release.
Just a thought.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Dana,
tell to Robyn, she'll take care of.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
My problem was resolved,I used the TX_Complete and TX_BUFFER_EMPTY and use the function SendData and work perfect Thanks for your help 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
glad to here that