I am trying to implement UART using HET timer. Required baud rate is 2400 (i.e. 416us/bit). During receive I am receiving an falling edge interrupt from GPIO. When I receive this interrupt, i need to start HET timer and get an interrupt at 208us. Have difficulty achieving this.
Is there a minimum time to get an interrupt using HET timer?
Do you have any sample code that you can share?
My sysclock = 7.2738 MHz and iclk=3.686 MHz
Prasad
Prasad,
Thanks for using our forum.
Which device are you using?
Best regards,
Jean-Marc
Application Engineer
If my reply answers your question please click on the green button "Verify Answer".
TMS470R1B1M
Using this device with 7.3728 MHz oscillator, sysclock = 7.3728 MHz and iclk=3.6869 MHz
Please let me know ur suggestions.
One option is to use a CNT instruction in your HET code. This instruction can generate an interrupt on overflow.You have to set the MAX count value (25bits) that will match your 208us interrupt requirement.CNT Instruction counts HET Loop Resolution.
Are you using your HET for something else? If yes can you provide the definition of LR and HR so I can make the math for you?
Attached are the HET files and main application file with sysclock=7.3728MHz.
Code in main file uses HET to get timing for 2400 baudrate serial communication. 1bit length = 416us and 1/2 bit lenght =208us. Data is received and sent using GPIO and not HET pins.
So, during transmit, ucontroller starts HET to interrupt at 416us. and clocks out a bit on GIOA[0] every HET interrupt. Command sent out is a 1byte with 1start bit, 1 parity bit and 1stop bit.
During receive, on receiving a falling edge interrupt, HET is initialized for 1/2 bit length (208us) and when the HET interrupt occurs, input bit is read from GIOA[4]. After reading the GIOA[4], HET is initialized for 1bit length (416us). When HET interrupt occurs, input bit is read from GIOA[4]. After reading HET is initialized for 1bit length (416us). This process repeats untill the complete response is read -- response is a total of 22 bits.
startbit - 8bitdata - paritybit - stopbit - stopbit - startbit - 8bitdata - partitybit - stopbit
I am having difficulty achieving 208us with HET. Please review and let me know ur findings.
I don't see any attachment.
Can you resend?
3201.TISupport_1wire7MHz.zip
I'm working on your question.I have to reproduce your environment to be able to understand the problem.Without the full project, I have to re-write some test code. Will it be possible to share the full project?I can provide my email address if you don't want the code to be public.(I'm not familiar with the specific HET code, I did not write it)
If you find a solution to your problem, please let me know.
Sure,Please send me ur email so I can send you the project in zip.
thanks
I've send you a "friend request" via the forum. Once you accept it we should be able to exchange emails.
What is the status on your post? Did I answered your question?If so, can you mark it as "Verified Answer" so I can close this thread?