ds30 Loader free edition forums
Help using MAX222 with shutdown feature [solved] - Printable Version

+- ds30 Loader free edition forums (https://picbootloader.com/forum)
+-- Forum: Support (https://picbootloader.com/forum/forumdisplay.php?fid=3)
+--- Forum: 8-bit firmwares (https://picbootloader.com/forum/forumdisplay.php?fid=7)
+--- Thread: Help using MAX222 with shutdown feature [solved] (/showthread.php?tid=494)



Help using MAX222 with shutdown feature [solved] - brid0030 - 2012-04-27

I wonder if I could get some pointers for modifying the DS30 bootloader to work with a MAX222 RS232 level shifter that features a low power shutdown mode. Pin 18 on this device must be set high to enable any communication on the TX and RX pins. I had been using a very standard MAX232 IC, and it worked fine (both with the bootloader and otherwise) except that it uses about 10mA of current during standby. To save some power, I dropped in a MAX222, and attached the Shutdown pin to PortB.1 on the PIC18f25k22. If I program the PIC directly (no bootloader) everything works. However, when I try to use the bootloader, the software cannot find the PIC because the MAX222 is shut down. If I connect the shutdown pin directly to 5V on the board, then the bootloader works fine.

So, what I would like to do is modify the code so that PortB.1 is held high throughout the execution of the bootloader. I use PICBASIC PRO to do most of my programming, so I'm pretty shaky with assembly. I tried putting "bsf PORTB, 1" Near the beginning of the bootloader assembly code, but that did not work (seemed to have no effect). Can anybody clue me in as to how to activate the MAX222 when the bootloader is executing?


RE: Help using MAX222 with shutdown feature - Mikael Gustavsson - 2012-04-27

You need to configure the pin as an output first. Also when it comes to outputs you should use the lat register.
Code:
bcf TRISB, TRISB1
bsf LATB, LATB1



RE: Help using MAX222 with shutdown feature - brid0030 - 2012-04-27

[quote=
Code:
bcf TRISB, TRISB1
bsf LATB, LATB1
[/quote]

OK, That was simple, works fine now.

I saw a short thread from a while back ([broken link]) in which someone had a modified version of the DS30 bootloader that did not require a level shifter for RS232 communication. You just needed a couple of resistors. I added the level shifter to my design specifically so I could use a bootloader. But I would very much like to lose the MAX232 if I could. Does anyone have this version of DS30 that works without a level shifter?


RE: Help using MAX222 with shutdown feature - Mikael Gustavsson - 2012-04-27

That is a pure hardware modification. It has nothing to do with the boot loader.