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.

BoostC 12F683 Serial I/O Example

Status
Not open for further replies.

Mike - K8LH

Well-Known Member
Anyone interested in seeing BoostC code for interrupt driven bit-banged 9600 baud serial I/O on a little 8 pin 12F683?

This is a novelty project with no practical application I can think of (it ties up interrupt capability). I just wrote it to evaluate BoostC interrupt "overhead" which is pretty high.

Regards, Mike

window-png.20306
 

Attachments

  • window.PNG
    window.PNG
    16 KB · Views: 1,505
Last edited:
Anyone interested in seeing BoostC code for interrupt driven bit-banged 9600 baud serial I/O on a little 8 pin 12F683?

This is a novelty project with no practical application I can think of (it ties up interrupt capability). I just wrote it to evaluate BoostC interrupt "overhead" which is pretty high.

Regards, Mike

Hi Mike,
You seem fascinated with getting the most out of the least :)

I'm guessing you let boost handle the context save? How much overhead, compared to the same example you did a while back, in assembler? How much ROM did you need for the app?

At least this 'little slugger' has some stack space, but given your comments above, would you say it is worth using boost C, or any other C, for these little chips?
 
Oh, I think it's worth it. The code is just so much more readable. I suspect all of the C compilers for 12F' and 16F' devices are going to have caveats to watch out for.

The useless BoostC ISR overhead was about 4 words and 5 cycles. Not much to complain about, really. I did ask the developers why they waste cycles and include code to manipulate bits 3 and 4 of PCLATH on 12F' and 16F' devices with only a single page of memory but I never really got a good answer and I suspect it's just too much work to go beyond using a "one size fits all" library of output code segments. Anyway, I'm not going to complain because they did a pretty good job of coming up with something that's very usable.

Mike
 
Last edited:
The program is attached (with a .txt suffix).

Mike
 

Attachments

  • Serial_12F683.c.txt
    7.2 KB · Views: 728
Last edited:
Hello,
it is possible to create a counter pulses with the 12f683?
My idea is:
When connecting to +5 volts 12f683, Account 1 pulse leaving the pin-5 in the logic 1 (active), switching off the power 12f683 saved in the memory pulse, the pulse rate will scale from 0 to 1000. When there is no more pulses pin-5 is the logic 0 (inactive). To turn again to use another pin count (eg pin 3) clear memory. Is that possible?
santronica.
 
Status
Not open for further replies.

Latest threads

Back
Top