Jump to content
Mr.RC-Cam

New RC-CAM Project: Bit-Switch

Recommended Posts

Microchip has a family of tiny microcontrollers that are the size of a grain of rice. If you can solder a typical SMT transistor, then you are ready to try one of these little fellows. This project puts one to use by turning it into a R/C servo signal decoder. It provides remote On/Off control, plus lost servo signal detection.

The details can be found on the project page: http://www.rc-cam.com/projects.htm.

If you have questions about it, that are not covered on the web site, then please ask them here. That way everyone can share and learn.

post-7-1156789024_thumb.jpg

Share this post


Link to post
Share on other sites

HI Mr RC CAM

Thanks for a great project, was it written in assembler or Basic?.

I have a limited experience in Proton developement suite (basic compiler and IDE)

As i have only used 16f and 18f devices i was curious and looked to see if my compiler supported 10f series which it does.

Can you use any of the 10f series as some only have half the ram?.

Any chance to see the source code as a learning oportunity? if the oscal is wiped / overwritten does that render the device useless?

Share this post


Link to post
Share on other sites

1) Written in assembly and C.

2) Project can use PIC10F202 or PIC10F206.

3) Source code is not public. However, there are plenty of examples of PIC based R/C decoding if you just Google a bit.

4) Altering the factory stored OSCAL value may adversely affect operation since the R/C decoding routines are dependent on its accuracy.

Share this post


Link to post
Share on other sites

Hello,

The RC switch looks like a cool project but i got a problem with programming the hex file into the pic. Im using a pic start plus programmer with mplab v7, when verifying the program after burning i got a lot of errors:

PICSTART Error Log File

24-Jun-2007, 15:32:50


Device Type: PIC10F206

Address Range 0-fe



Program Memory Errors


Address  Good  Bad


0000:    0025  3FFF

0001:    0AC6  3FFF

0002:    0A05  3FFF

0003:    0A1A  3FFF

0004:    0A77  3FFF

0005:    0213  3FFF

0006:    0643  3FFF

0007:    0A19  3FFF

0008:    0C01  3FFF

0009:    0029  3FFF

000A:    0CBF  3FFF

000B:    0028  3FFF

000C:    0004  3FFF

000D:    02E8  3FFF

000E:    0A0C  3FFF

000F:    02E9  3FFF

0010:    0A0A  3FFF

0011:    0C4A  3FFF

0012:    0028  3FFF

0013:    02E8  3FFF

0014:    0A13  3FFF

0015:    0000  3FFF

0016:    0004  3FFF

0017:    02F3  3FFF

0018:    0A08  3FFF

0019:    0AF5  3FFF

001A:    0073  3FFF

001B:    043F  3FFF

001C:    0666  3FFF

001D:    053F  3FFF

001E:    073F  3FFF

001F:    0A51  3FFF

Any additional errors are not displayed.



Configuration Bits Errors


Configuration Setting            Expected               Received


Master Clear Enable              Functions as GP3       Functions as Master  lear



ID Errors


Address  Good  Bad


0000:    0031  3FFF

0001:    002E  3FFF

0002:    0030  3FFF

0003:    0020  3FFF

MCLR is configured as GP3 in mplab, when i change this to 'Functions as MCLR' then the configuration bit error is gone but the other errors still remain. I'm using the PIC10f206 but I've tried the PIC10f202 to but i still get the same errors. Hopefully you know a solution to this problem.

Rick.

Share this post


Link to post
Share on other sites

I don't use a Pic Start Plus system, so I can't offer any advice on how to fix its problem. Microchip's tech support should be able to help though.

Do not change GP3 to MCLR. The project will not work if you do that. If PIC Start Plus requires that pin to be MCLR, then that programmer cannot be used.

Share this post


Link to post
Share on other sites

It is an industry standard hex file that was compiled using the Microchip IDE, tested on a Microchip MPLAB ICD, verified by building several that were programmed on a commercial chip programmer, as well as successfully duplicated by other users using their programmers.

From what you have reported here, it appears that your problem is with the chip programming system or something related to its setup. It is failing the verify cycle and appears to show a blank (or missing) chip after programming.

There are an endless number of things that can cause that. For example, are you sure the programming is compatible with the PIC10F? Are you sure the chip's connections to the programmer are correct? Have selected the correct PIC part in its menus? Does the programmer work if you program another PIC project that uses the PIC12F family?

I can't help much since I do not use the programmer you own. It would be best to contact Microchip to see if they can help. They know their programmer well and can offer advice on it.

Share this post


Link to post
Share on other sites

Nice link, thnx. Today i programmed the Uc's with an ICD 2 programmer en they work fine now. Thnx for the information.

Share this post


Link to post
Share on other sites

I am trying to assemble this circuit. I have purchased the 10F202 PIC.

There is an error when I transfer the hex file to the device : the check fails.

As it is written at the end of the hex file, it seems to be designed for the 10F206 PIC. How can I use it with my 10F202 ? Should I only change the number in the hex file ? Should it work directly ? Should I download another hex file ?

Thank you for your answers !

Best regards.

Share this post


Link to post
Share on other sites

The hex file is designed so that a 10F202 or 10F206 can be used. The last line in the file (;PIC10F206) is a comment that your programmer should ignore. However, it sounds like yours is confused by it, so just edit it out.

Share this post


Link to post
Share on other sites

First, thank you very much for your help.

I also tried without the comment. Same thing. And I tried to load it to a 10F206, still the same. There is an error during verification, the code is not loaded. I use a PICkit 1 programmer. I was able to load the hex to the featured 12F675, and it succeeded (that was no use, of course, but it shown the programmer works).

I am quite desperate. Do you have any more trick ?

Thanks again !

Share this post


Link to post
Share on other sites

Self-answer (after hours of work) : PIC10F (8 pins) needs adapters to be programmed with PICkit 1 : the pins are not at the right place. You may find how to make an adapter in this file.

I successfully realised this circuit and it works.

Thanks for all !

Edited by Petrus

Share this post


Link to post
Share on other sites
I successfully realised this circuit and it works.

Thanks for the feedback. It is great to hear that you found the problem.

Share this post


Link to post
Share on other sites

I plan on using one of these with a MOSFET to control a source that runs at about 3 amps, 12 volts.

Does the power circuit that I am switching through the MOSFET have to have a common ground with the bit-switch, or can it be a completely isolated circuit from the ESC and receiver?

Thanks

Share this post


Link to post
Share on other sites

If you need to isolate power, then use an opto-isolated FET switch design. Otherwise, the FET will need common ground or power, depending on your design.

Share this post


Link to post
Share on other sites

Thanks.

I breadboarded a bit switch tonight with a DIP 8 pin variety of the PIC, and it seems to work well. I am easily able to turn of a set of LED's with a switch on the radio.

I ripped apart one of my kids broken Fairy Wands from Disneyland to convert it into a fancy LED light show on one of my RC aircraft. The PCB with a small IC that is controlling the LED flashing pattern has a tiny push button that shorts a 3v output to ground, and by doing so, it alternates the pattern of LED blinking.

I plan on hooking up the LED's directly to 5 volt output from a BEC, but would like to be able to switch (short) the two wires that go to the little button while flying.

Could the bit switch be used to do this? If so, do you think it would be better to use a small solid state relay to do this? The current is VERY low. The Bit Switch can't drive a pin to ground selectively, can it?

Thanks again!

Share this post


Link to post
Share on other sites
Could the bit switch be used to do this? If so, do you think it would be better to use a small solid state relay to do this?

BitSwitch's output will sink to ground. But it will also source (drive) it to V+. So, if the Fairy Wand's mode input cannot tolerate the positive signal, install a diode to block it.

Share this post


Link to post
Share on other sites

Upon retesting, the mode input actually runs off of the same voltage as V + (about 5 volts) so I don't think having source feed into it will cause a problem. Just in case, I have some Radioshack 5.1V zender diodes on hand. Would these work as you described?

This little bit switch is great! Online places charge as much as $15 for little RC switches, and with some free samples from Microchip, this thing was FREE!

Thanks again.

Share this post


Link to post
Share on other sites

Thanks for this information. I am pretty new to this so I have a few questions.

1. I went to the mouser site for the PIC10F202 (http://www.mouser.com/search/refine.aspx?Ntt=PIC10F202) and there are several to choose from. Can you tell me the part # that should be used for the project.

2. I am interested in buying a PIC programmer. Do you have a recommendation for one?

3. Is anyone interested in programing one of these chips and sending it to me? I would pay you for your time.

Thanks in advance.

Sam

Share this post


Link to post
Share on other sites
Can you tell me the part # that should be used for the project.

Choose a part number that is in the IC package style you want.

Share this post


Link to post
Share on other sites

hi,

This project is work so fine,I use it for a year.After electric shocking, the 10F202 SO-23 was dead completely.

I went to the shop but it's out of stock.

So,I decided to use DIP8 for instead,it's more easy for programming also, i though.

After i modified the circuit for DIP8 then begin to program the new 10F202 with Pickit2 via USB.

Unfortunately, it have some error,

when i open the program "VPP voltage level error"

and"Programming failed at Program Memory address 0X000000" after i had try to write it.

Anyone can help?

Sorry about my english

Thanks,

BUN

Edited by bbgun98

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×