Jump to content


Photo

New RC-CAM Project: Bit-Switch


  • Please log in to reply
29 replies to this topic

#1 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,559 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 28 August 2006 - 10:13 AM

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.

Attached Thumbnails

  • pic10fc.jpg

- Thomas

#2 H.J.Gelsthorpe

H.J.Gelsthorpe

    RC-Cam Visitor

  • Members+
  • Pip
  • 10 posts

Posted 28 August 2006 - 12:07 PM

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?

#3 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,559 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 28 August 2006 - 12:17 PM

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.
- Thomas

#4 rick

rick

    RC-Cam Visitor

  • Members+
  • Pip
  • 4 posts

Posted 24 June 2007 - 05:55 AM

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.

#5 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,559 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 24 June 2007 - 07:28 AM

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.
- Thomas

#6 rick

rick

    RC-Cam Visitor

  • Members+
  • Pip
  • 4 posts

Posted 24 June 2007 - 11:11 AM

How did you compiled the C or ASM file to hex ?

#7 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,559 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 24 June 2007 - 12:42 PM

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.
- Thomas

#8 rick

rick

    RC-Cam Visitor

  • Members+
  • Pip
  • 4 posts

Posted 25 June 2007 - 08:00 AM

Tomorrow i try it on a ICD 2 programmer, i let you now if it works.

#9 ThomasScherrer

ThomasScherrer

    RC-Cam Mentor

  • Members+
  • PipPipPipPipPip
  • 492 posts
  • Gender:Male
  • Location:Denmark
  • Interests:Electronics-Radioamateur-Modelplanes-Video-Homebrew electronic projects.

Posted 25 June 2007 - 10:59 AM

just incase you have tiny avr's and avr programmer avail:
http://www.webx.dk/r...-bit-switch.htm
this could be a just as nice solution.
but if you have PIC and a PIC programmer avail just fine stick to that.
Thomas Scherrer OZ2CPU www.webx.dk

#10 rick

rick

    RC-Cam Visitor

  • Members+
  • Pip
  • 4 posts

Posted 26 June 2007 - 12:51 PM

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

#11 skonkworkstexas

skonkworkstexas

    RC-Cam Visitor

  • Members+
  • Pip
  • 6 posts

Posted 24 July 2007 - 08:24 AM

Is this something that can be purchased preprogrammed?

#12 Petrus

Petrus

    RC-Cam Visitor

  • Members+
  • Pip
  • 4 posts

Posted 23 October 2008 - 02:12 AM

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.

#13 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,559 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 23 October 2008 - 08:38 AM

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.
- Thomas

#14 Petrus

Petrus

    RC-Cam Visitor

  • Members+
  • Pip
  • 4 posts

Posted 13 November 2008 - 05:47 AM

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 !

#15 Petrus

Petrus

    RC-Cam Visitor

  • Members+
  • Pip
  • 4 posts

Posted 13 November 2008 - 07:07 AM

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, 17 November 2008 - 05:56 AM.


#16 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,559 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 20 November 2008 - 05:09 PM

I successfully realised this circuit and it works.


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

#17 Telemachus

Telemachus

    RC-Cam Visitor

  • Members+
  • Pip
  • 4 posts

Posted 05 January 2010 - 04:27 AM

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

#18 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,559 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 05 January 2010 - 08:49 AM

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.
- Thomas

#19 Telemachus

Telemachus

    RC-Cam Visitor

  • Members+
  • Pip
  • 4 posts

Posted 10 January 2010 - 09:44 PM

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!

#20 Mr.RC-Cam

Mr.RC-Cam

    RC-Cam Mentor

  • Admin
  • PipPipPipPipPip
  • 4,559 posts
  • Location:USA
  • Interests:R/C video and photography.

Posted 11 January 2010 - 01:52 AM

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.
- Thomas