Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Oshonsoft Serial DATA

Status
Not open for further replies.
When you mix integer and floating point variables in calculations, the compiled code will be bigger and slower.
I checked the simple calculation in the servo interrupt:
Timr1word = 65535 - t_on
If t_on is a word, it takes 8 instructions and over 30 when t_on is floating point.
If you really need in the future to use floating point on servo times, save and use them with another names, but use integers in the interrupt routine.
Hi J,
SERVO times are a red herring really, I was using them for tests, but anything could have been used. (I'll do the SERVO PIC later)

If I follow you, Use INTEGERS, then convert them to FLOATING POINT when needed for a calculation.

Here is the latest 18F46K20 program (Restart from here) I've removed all of the SERVO stuff. It now READS and PARSES the HSERIN SENTENCE, and returns to MAIN and sticks. I've now got to go and relearn about INTERRUPTs to get it to keep looking at the HSERIN.

C.
 

Attachments

  • 18LF4620 32Mhz RX 2XPIC COMPASS HC-12 100918 1100.bas
    17.5 KB · Views: 206
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top