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.

Bit banging with C

Status
Not open for further replies.

Mejinx

New Member
Im trying to bit bang for a lab with the pic18f452 without using use RS232 but i wanna write it in C. How would i go about doing this? thanks
 
The 8051 C compilers I've used have non-standard extensions to C to do sets and clears on bit addressable memory.

A good compiler should recognise something like:

PORT |= 0x01;

as a set bit instruction. Try it and look at the disassembly to see what this C line translates to.
 
Mejinx said:
Im trying to bit bang for a lab with the pic18f452 without using use RS232 but i wanna write it in C. How would i go about doing this? thanks

It's a fine example of why you should use assembler, it's trivial to do, and only takes a few lines.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top