Skip to main content

Topics

This section allows you to view all Topics made by this member. Note that you can only see Topics made in areas you currently have access to.

Topics - megabug

1
Breakout boards / MCP2200 breakout board free pcb build
Hi,


Just build my MCP2200 board and I am using it for RS485 communication with automatic TX switchover (half duplex bus).

I added a p-channel mosfet to switch the transceiver from receive to send when a low signal is on the uart TX (it goes to GND when sending). Works great and no software is required on the PC for working with RS485. Well, it probably should listen if there is communication on the bus and only send if there is not, but it can be implemented in hardware as well.

Tested it with my PIC on RS485 with ds30loader, could easily flash the PIC! ds30loader is modified to work with RS485, so it uses a TX_Enable line. ;)


Best regards.
4
Bus Pirate Support / [SOLVED]BPv4 free pcb build and some problems.
Hi folks,

I finally had a little bit time to finish my BPv4 and stumbled upon some problems.

The newest firmware works, but the bootloader doesn't. The BP doesn't enumerate with the bootloader. I tried to compile it myself but no change.

The hardware is somewhat strange, I have troubles.

First, the firmware info isn't correct yet (version)
HiZ>i
Bus Pirate v4
Firmware v6.0-a1 (r1400)
DEVID:0x1019 REVID:0x0003 (24FJ256GB106 A5)
http://dangerousprototypes.com

And my errors from the selftest:
Code: [Select]
HiZ>~
Disconnect any devices
Connect (ADC to +3.3V)
Space to continue
Ctrl
AUX OK
MODE LED OK
PULLUP H OK
PULLUP L OK
VREG OK
EEPROM
SCL OK
SDA OK
WP OK
ACKADC and supply
Vusb(4.91) OK
5V(4.93) OK
5V0 VPU(4.38) FAIL
ADC(3.29) OK
3.3V(3.27) OK
3V3 VPU(2.77) FAIL
Bus high
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 0
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 1
MOSI OK
CLK OK
MISO OK
CS FAIL
MODE, VREG, and USB LEDs should be on!
Any key to exit
Found 3 errors.

Nevermind the voltages being too low, this is probably because I used different transistors and need to change the base resistor or so. ;) This doesn't bother me.
CS is the problem here. I checked for solder bridges, but everything is ok. CS is connected to the PIC fine. How can I check the components? The CD4066BM is new, somewhere from china. I ordered some on ebay.


The soldering is not my best job, but since I moved here this month I can't find my good solder. ;)
Picture of my build:


Pushbuttons are from a laptop repair I did some months ago, where I had to order 10 and only needed one for the repair. ;) CD4066 is from ebay, and the rest of the components were around. Some are 0805 on 0603 pads, not pretty but works.

Oh and she couldn't find anything either:
5
Project logs / Another TV B Gone with huge range.
Just saw on the blog a tv b gone build and thought I can post mine from last year, which I gave a friend.

Here are my pictures: http://abload.de/gallery.php?key=dXtsyeIo

Maybe this inspires someone to also build it as a gift. :D

Some info: tvbgone firmware from Ian (irtoy) which works like a charm here. 10 IR LEDs from Vishay (some high power stuff afair) in parallel pulsed with up to 4.2V from the battery! I Think the only voltage drop or resistor is in the mosfet I used. ;)

Had to add 2 capacitors in the battery lines so that the pic doesn't crash while transmitting. (Note: the capacitor by the LEDs is NOT connected to the LEDs but before the mosfet.)

The case is a old pvc pipe i found in my garage. I cleaned it and sprayed it (including a high glossy clear paint) so that it looks better. ;)
A simple pushbutton glued from the inside trough a hole is to control the pic.

Battery is a 17670, a slightly slimmer 18650 which is normally in the most laptop battery packs. Glued to the battery is a miniUSB jack with a MAX1811 and a blue LED which indicates charging. While full charged and connected to USB, the blue led flashes when sending IR. Looks really nice ;). This is just because the voltage drop from the IR LEDs.

The IR LEDs get a bit warm when sending for a while, but still work after a couple of months intensive use. :D


Range? A lot! At home I can point it in every direction and my TV goes off. Haven't tried it in a huge shop yet. But could be fun. :)

thanks for reading.
6
Web platform / SPIFlash instead of EEPROM -> 4MB storage without µSD
Hi,

Just wanted to share my experience with replacing the EEPROM with an SPIFlash from SST (now Microchip).

I used the SST25VF032B (which you can sample ;)) and these are my changes to the sourcecode:

In main.c replace "XEEInit();" with "SPIFlashInit();"

In CustomHTTPApp.c search for "NVM_VALIDATION_STRUCT" and comment out the whole line.

In HardwareProfile.h at EEPROM setup, comment out the EEPROM defines and put this in:
Code: [Select]
#define SPIFLASH_CS_TRIS		(TRISCbits.TRISC7)
#define SPIFLASH_CS_IO (PORTCbits.RC7)
#define SPIFLASH_SCK_TRIS (TRISCbits.TRISC6)
#define SPIFLASH_SDI_TRIS (TRISBbits.TRISB9)
#define SPIFLASH_SDI_IO (PORTBbits.RB9)
#define SPIFLASH_SDO_TRIS (TRISCbits.TRISC8)
#define SPIFLASH_SPI_IF (IFS2bits.SPI2IF)
#define SPIFLASH_SSPBUF (SPI2BUF)
#define SPIFLASH_SPICON1 (SPI2CON1)
#define SPIFLASH_SPICON1bits (SPI2CON1bits)
#define SPIFLASH_SPICON2 (SPI2CON2)
#define SPIFLASH_SPISTAT (SPI2STAT)
#define SPIFLASH_SPISTATbits (SPI2STATbits)

Thats it.

I prefer using the Flash so I don't need to have a couple of µSD (and I always end up killing them somehow) and now I have enough storage. ;) Don't really need 2GB or so. Hopefully this helps somebody.
7
Web platform / Experience with software I2C?
Hi,
Has anyone here used software I2C with the Web platform? I would like to add some GPIOs and other stuff which uses I2C, but cannot use hardware I2C since the data PIN is on one of the EEPROM Pins! (And connot be remapped)

Thanks in advance ;)
8
Web platform / Use FTDI chip to reset PIC
Hi,

I was wondering why the web platform can't reset the PIC for entering bootloader automatically with the FTDI chip? I mean I am wondering why this wasn't implemented.

I found a reset tab in the ds30 Loader tool which pulls a pin (RTS or DTR) low for reset when you klick on "Download". So I soldered a wire from DTR (pin 2, FTDI chip) to MCLR and tried it:



Worked fine. Now I don't need to press the reset button when I want to upload a new firmware. (that was annoying while developing stuff)

Tested it with external power, too. Works fine. (I had feared that the FTDI chip somehow resets the PIC when not powered by USB or whatever) The PIC resets when powered by external supply and USB is plugged in, but thats not really a problem.

So if you have a steady hand just solder a wire and be happy. :)
Or: you can reset the PIC by serial command... but that doesn't involve soldering, so it's not that cool. :D

best regards
9
Web platform / Control your remote outlets (433MHz) with the web platform
Hi,

After playing around with my  web platform I thought I can post some code that maybe help somebody. :)

My project with the web platform is to develop new features and implement them in my actual home automation. In my living room I can control some light (12V) with a couple of MosFETs on "old" 18f97j60 ethernet board. Controlling remote outlets currently is done quite dirty. (Bit banging an PT2262 remote IC)

I knew this could be done with only one pin and much cleaner!

You can see my code at the end of this posting.

Calling the function with: send_rf(0b10010011, 0b0100);

To be honest, you need to have at least a little bit understanding how to configure the function call, but I can help you with that. ;) It's quite easy.

RF is defined as an output pin. (of course!)

Works here at my home flawless! My test rig:


To see what exacly is being sent:


The blue capture is from my PIC and the yellow one is from an original remote control! (But different keys were pressed/sent) Just to see the timing ;).

I am using this transmitter module with much power: link but standard modules like this are fine, too. If your transmitter has a RF encoder chip on it, you have to cut the "RFout" wire from it and connect your PIC with the end of the wire that goes to the circuit.

I welcome questions and/or criticism on my code. The 8 bit variable is used so I can directly control it over uart! (on my PIC12F for example)

Oh, and everybody who doesn't know what I am talking about: these thingies are remote outlets

Code: [Select]
#define FOSC  80000000LL
#define FCY      (FOSC/2)  // MCU is running at FCY MIPS
#include "libpic30.h"

void send_rf(char conf1, char conf2)
{
  int i, j;
char conf1a, conf2a;
conf1a = conf1;
conf2a = conf2;
j = 0;
for (j=0; j<5; j++){ // repeat sending 5 times.
                                          //This is needed by the PT2272 receiver (at least 3 times iirc)
conf1 = conf1a; // store data to send
conf2 = conf2a;
for(i=0; i<8; i++){ // parse data from conf1 and send via RF (right to left)
           
            switch (conf1 & 0x01){   // one bit at a time!
                  case (0): {        // send as float
                        RF=1;
                        __delay_us(300);
                        RF=0;
                        __delay_us(900);
                        RF=1;
                        __delay_us(900);
                        RF=0;
                        __delay_us(300);
                  break;
                  }
                 
                  case (1): {        // send as 0
                        RF=1;
                        __delay_us(300);
                        RF=0;
                        __delay_us(900);
                        RF=1;
                        __delay_us(300);
                        RF=0;
                        __delay_us(900);
                  break;
                  }
            }
            conf1>>=1; // shift conf1 right to parse next bit
  }
  for(i=0; i<4; i++){ // parse data from conf2 and send via RF
                      // only the lower 4 bits are needed.

            switch (conf2 & 0x01){   // one bit at a time!
                  case (0): {        // send as float
                        RF=1;
                        __delay_us(300);
                        RF=0;
                        __delay_us(900);
                        RF=1;
                        __delay_us(900);
                        RF=0;
                        __delay_us(300);
                  break;
                  }

                  case (1): {        // send as 0
                        RF=1;
                        __delay_us(300);
                        RF=0;
                        __delay_us(900);
                        RF=1;
                        __delay_us(300);
                        RF=0;
                        __delay_us(900);
                  break;
                  }
            }
            conf2>>=1; // shift conf1 right to parse next bit
  } // done with data, now a sync is needed.
  RF=1;          // sync
  __delay_us(300);
  RF=0;
__delay_us(9690);  // weird time, I know...
  }
}

Have fun with it! Hope it helps.

PS: This is not an april fools. ;)

Best regards.
10
Web platform / Internet bootloader on Web Platform ?!
Hi,

I was wondering if anybody has tried an internet bootloader on the webplatform?! The one I found from microchip is for the 18f97j60 chip. I found some commercial bootloaders, but nothing free.

It would be very nice to automatically load a firmware every reboot if a new file is on a tftp or something.


thanks in advance.

PS: I just ordered my web platform and I am interested in testing it out. I was to lazy to make my own board, have already worked with 18f97j60 with internal ethernet. My own ethernet board currently controls my lights at home.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01442402744session_write_close ( )...(null):0
20.01472534336ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01472535112Database_MySQL->query( ).../DatabaseHandler.php:119
40.05962673848Database_MySQL->error( ).../Db-mysql.class.php:273