Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help using MAX222 with shutdown feature [solved]
#1
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?
Reply
#2
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
Reply
#3
[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?
Reply
#4
That is a pure hardware modification. It has nothing to do with the boot loader.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)