MX150F128B works allmost fine but some strange behavior

BerndK
Posts: 9
Joined: Sat Feb 16, 2013 11:23 am

MX150F128B works allmost fine but some strange behavior

Post by BerndK » Sat Feb 16, 2013 2:08 pm

Thanks very much for supporting MX1xx and MX2xx PIC32 :D

I build a Board with an PIC32MX150 28 Pin DIP Version.

> some minor changes to the new bootloader (Oscilator settings - using the intern one - , Prozessor Type, Flash size, LEDs) and it worked fine. I used _BOARD_EXAMPLE_MX1_ as a basis. Thanks very much for this great job.

> With the MPIDE i used "cerebot_ga4" as a basis for customizing my board.
in board.txt I needed to change:

* cerebot_ga4.ldscript to =chipKIT-application-32MX120F032.ld
(not ..120F032D.ld)
* cerebot_ga4.upload.maximum_size to =122880 (128k - 8k reserve for whatever)
* cerebot_ga4.build.mcu=32MX250F128D thats not the MCU I use but
..MX150F128B is not supported by the bootloader...
Error Message:" avrdude: AVR Part "32MX150F128B" not found."

does anybody know, what to do? :?:

Even though this settings are not optimal, the bord works (allmost fine).

> In Bord_Defs.h I just changed:
#define NUM_DIGITAL_PINS from 30 to 31 (Pin count starts with 0)
to get access to Pin 30 (RA4) wich is the boot button and also used in my sketch
No changes in Bord_Defs.c

> Digital Input/Output tested -> LEDs are blinking -> works fine. :)

> Serial.print ... tested -> works fine 8-)
after configuring UART1 pins RX and TX in setup()
U1RXR = 0x1; //mapping RB6 to RX1 (Pin 15 on PIC21MX150F128B)
RPB7R = 0x1; //mapping TX1 to RB7 (Pin 16 on PIC21MX150F128B)

> Wire (i2c): got it working -> great :D
but:

1. After initialising i2c with Wire.begin(4);
digital Pins 24 (RA0) and 25 (RA1) do no more work as output (LEDs stop
blinking on these ports). No trouble with RB2 (ouput) or RA4 input. :?

2. initialising i2c (Wire.begin();) before initialisind Digital Pins (pinMode(..))
does not work. -> I get no communication onn i2c bus.
At first I thouged Wire would not work :shock:
When I moved Wire.begin(..) beyond initialising pinMode(..) it worked! :o

I use Wire with a PIC32MX440F256H - wich I customized to - and I do not
have this problens.

Any hints? :?:

Bernd
Attachments
board_MX150.jpg
My board:
board_MX150.jpg (34.04 KiB) Viewed 3019 times

BerndK
Posts: 9
Joined: Sat Feb 16, 2013 11:23 am

Re: MX150F128B works allmost fine but some strange behavior

Post by BerndK » Sun Feb 17, 2013 2:39 pm

One Problem solved:

..MX150F128B is not supported by the bootloader...
Error Message:" avrdude: AVR Part "32MX150F128B" not found."

In "avrdude.conf" I just copied the Section for the

"Pic CPU PIC32MX250F128D added by Brian Schmalz, May 2012"

and changed

part
id to = "pic32-150-128";
desc to = "32MX150F128B";

It works: :)

The strange behavior at ports RA0 and RA1 still remains! :(

dangeljs
Posts: 82
Joined: Thu Jun 09, 2011 8:22 pm

Re: MX150F128B works allmost fine but some strange behavior

Post by dangeljs » Sun Feb 17, 2013 4:26 pm

It is interesting that you ran into the same problem I had about a month ago (Not using MPIDE but MPLAB). It is a problem with the chip seen in the Errata sheet for the MX1/2 chips.

See this link to ensure it is the same problem:
http://www.microchip.com/forums/tm.aspx?m=697846

The work around was setting the DISSL bit (I2C1.<9>) and the voltage will go back.

Also, are the changes above the only changes you needed to get it to work with MPIDE? I would like to be able to use MPIDE with my PIC chips, and would like to use some of your work to do it.

Hope it helps you out,

Jason

BerndK
Posts: 9
Joined: Sat Feb 16, 2013 11:23 am

Re: MX150F128B works allmost fine but some strange behavior

Post by BerndK » Sun Feb 17, 2013 7:21 pm

Hey Jason,

thats it!

I2C1CONbits.DISSLW = 1; and it works fine! :D

Thank's a lot.

What I described above were the only changes I had to do. Very important is to use the latest version of the bootloader source and the latest version of MPIDE (20121013).

In addition I adopted pin maping in the MPIDE variants files Board_Defs.h and Board_Data.c to my Bord (PIC32MX150F128B 28 pin DIP version) today. With these settings I do not need to configure Perihperal Select Pins for UART1 in the sketch setup().

What PIC chips do you use? If it are the same as I do, I could provide bootloader and config files.

Bernd

dangeljs
Posts: 82
Joined: Thu Jun 09, 2011 8:22 pm

Re: MX150F128B works allmost fine but some strange behavior

Post by dangeljs » Sun Feb 17, 2013 11:49 pm

Glad to hear that it worked. I was using the MX250, but I have a few MX150s that I would prefer to use with MPIDE. So I guess the setup would be the same.

Is there a bootloader in the repository for the MX150 or did you create one yourself? If you created it yourself I would appreciate if you could send me a copy, but if not could you just please direct me where I could download it from.

Thanks,

Jason

BerndK
Posts: 9
Joined: Sat Feb 16, 2013 11:23 am

Re: MX150F128B works allmost fine but some strange behavior

Post by BerndK » Mon Feb 18, 2013 2:05 am

Here is the Github repo :https://github.com/chipKIT32/PIC32-avrdude-bootloader

You may find some more information here: http://www.chipkit.org/forum/viewtopic.php?f=6&t=1824

I used _BOARD_EXAMPLE_MX1_ as a basis and made some changes to BoardConfig.h (see attachment). I also attached the MPIDE variant files Board_Defs.h and Board_Data.c. It is better to use the chipKIT-application-32MX250F128.ld than chipKIT-application-32MX120F032.ld linker skript. I chagned this in the boards.txt file.

Hope I could help.

If there is anything wrong with my files, please tell me.

Bernd
Attachments
Board_Defs.h
(14.61 KiB) Downloaded 123 times
Board_Data.c
(19.8 KiB) Downloaded 120 times
BoardConfig_MX150_part.h
relevant part of the bootloader:
(4.99 KiB) Downloaded 131 times

BerndK
Posts: 9
Joined: Sat Feb 16, 2013 11:23 am

Re: MX150F128B works allmost fine but some strange behavior

Post by BerndK » Mon Feb 18, 2013 2:09 am

Sorry, max three Attachments.

Here is the part of the boards.txt file I added.

Bernd
Attachments
boards_MX150_part.txt
(1.7 KiB) Downloaded 126 times

BerndK
Posts: 9
Joined: Sat Feb 16, 2013 11:23 am

Re: MX150F128B works allmost fine but some strange behavior

Post by BerndK » Tue Feb 19, 2013 10:05 pm

SPI and DSPI tested.

After initialising the PPS Pins ..

SDI2R = 0x3; //SDI2 := RB13
RPB11R = 0x4; //SDO2 := RB11

everything is fine.

At present I use the MX150 with Digilent Pmod NIC100 as a Web server. Some minor changes to the Digilent DNETcK library and configuring PPS INT1 Pin

INT1R = 0x2 ; //INT1 := RB0

Bernd

JohnL
Posts: 17
Joined: Tue May 20, 2014 9:07 am

Re: MX150F128B works allmost fine but some strange behavior

Post by JohnL » Sun Aug 02, 2015 6:51 am

I have started playing with PIC32MX150F128B and new with double SRAM (64KB) PIC32MX1F256B.

I am relatively new to internal MPIDE setup as far as new controllers are concerned.

Anyway, have managed to follow this thread and successfully installed serial UART bootloader for MX150, appears to work on MX170 as well.

At this early stage of testing, I can upload sketches OK.

However, Serial1.print () works OK on UART 1 port pin 21, but I can't get Serial1.read() pin 22 to receive anything even though the receive pin
works OK with bootloader. Have checked with scope and am getting correct data at the receive pin 22.

Would appreciate any advice on possible MPIDE 0023 configuration issues.

Also if anyone has an updated configuration files for MX170 or advice how to change MX150 files to support full 64KB of RAM in MX170.

Best Regards
JohnL


***UPDATE***

Managed to find a definition file and found that Serial1 is actually mapped on pins 10 and 14. Serial1.read() works OK on pin 14 Rx.
But Serial.print also works on pin 21 as well as pin 10.



Issue MX150 (not tried MX170), reset button alone enters bootloader mode?
FIXED, PROG HIGH should be pin 16 with the bootloader I'm using.

Still looking at way to modify bootloader baud rate from 115200 to lower rate 19200 ?


Would appreciate any help.

Regards
JohnL

JohnL
Posts: 17
Joined: Tue May 20, 2014 9:07 am

Re: MX150F128B works allmost fine but some strange behavior

Post by JohnL » Fri Jun 17, 2016 11:03 am

Revisiting MPIDE and PIC32MX150F128B after long absence, unfortunately lost all previous information with old comp.

Is there a working UART bootloader Hex file for PIC32MX150F128B using internal RC oscillator and supporting configuration files if not the same as in this thread?

Thanks

Post Reply