Update :
Mars 11 2020 :
Code Works fine with a PIC32MX250F128B, but not with a PIC32MX230F256B (why ??? i do not know) . So i am closing for now this Post
Hello.
I wish to buy mikroBasic Pro compiler for PIC32.
(i am a newbie in PIC32)
Previously I want to test a simple code on a PIC32MX230F256B who is a small footprint 28 pin package.
I use the MikroProg USB programmer for PIC32 with IDC10 connector (not multiplexed) on a breadboard.
I had to update MikroProg firmware to be able to program the PIC32MX230F256B
Now the MikroProg programmer and programming functions are all OK (verify, blank, write, read etc..)
I use this very simple code :
program LED_ON
' Processor P32MX230F256B SDIP 28 pins
' Xtal 8 MHz
' It is a blinking LED Test on PortB.7
main:
ANSELB=0 'all Digital
TRISB=0 'all output
while True
PortB.7=1
delay_ms(500)
PortB.7=0
Delay_ms(500)
wend
end.
but the LED on PortB.7 (Pin 16) does not flash;
I tried LED on all port B pins : same
I changed the IC PIC 3 times, same problem.
I checked the oscillator: on the oscilloscope, I have a good signal at 8 MHz .
If someone can help me, it's been a week that I'm working on it.
I am enclosing screenshots of what I see.
Sincerly.
Laurent.
PIC32MX230F256B ,Trouble running the code? or other reason ?
-
- Posts: 12
- Joined: 12 Nov 2010 10:27
- Location: France
PIC32MX230F256B ,Trouble running the code? or other reason ?
Last edited by micromatel on 12 Mar 2020 11:41, edited 4 times in total.
Re: PIC32MX230F256B ,Trouble running the code? or other reas
One problem, you are trying to toggle the led pin using portx. On pic18, pic24, dspic and pic32 you would use LATx. There is also a pic32 led blink example in the compiler folder
Code: Select all
Change
PortB.7=1
delay_ms(500)
PortB.7=0
delay_ms(500)
to
LATB.7=1
delay_ms(500)
LATB.7=0
delay_ms(500)
-
- Posts: 12
- Joined: 12 Nov 2010 10:27
- Location: France
Re: PIC32MX230F256B ,Trouble running the code? or other reas
Thank you MicroMark for your fast reply. I forgot to say that I had tried all the code samples I saw on the Mikroe website,MicroMark wrote:One problem, you are trying to toggle the led pin using portx. On pic18, pic24, dspic and pic32 you would use LATx. There is also a pic32 led blink example in the compiler folder
Code: Select all
Change PortB.7=1 delay_ms(500) PortB.7=0 delay_ms(500) to LATB.7=1 delay_ms(500) LATB.7=0 delay_ms(500)
And of course I tried the LATB.x commands.
I just tested again your code with these LATB.x commands and the LED does not light up.
I read the PIC Datasheet regarding the registers and cabling precautions and I did multiple tries, without success.
I did a code check, and there is no difference, so i am sure the PIC is programmed
Maybe the boot code is not good for this pic32?
I'm always listening to suggestions.
Thank you very much.
Laurent.
Re: PIC32MX230F256B ,Trouble running the code? or other reas
Reading the data sheet, on power up portb defaults to 0xffff or all inputs. So you need to set the trisb register to output. Sometimes the jtag bit will cause problems so disable it. If this does not work then it is most likely your config settings or oscillator set up?
Code: Select all
main:
ANSELB=0 'all Digital
JTAGEN_bit = 0 ' Disable JTAG
TRISB = 0 ' Configure PORTB as output
'TRISB.7 = 0
While(True)
LATB.7=1
delay_ms(500)
LATB.7=0
delay_ms(500)
Wend
-
- Posts: 12
- Joined: 12 Nov 2010 10:27
- Location: France
Re: PIC32MX230F256B ,Trouble running the code? or other reas
Hi.MicroMark wrote:Reading the data sheet, on power up portb defaults to 0xffff or all inputs. So you need to set the trisb register to output. Sometimes the jtag bit will cause problems so disable it. If this does not work then it is most likely your config settings or oscillator set up?
Code: Select all
main: ANSELB=0 'all Digital JTAGEN_bit = 0 ' Disable JTAG TRISB = 0 ' Configure PORTB as output 'TRISB.7 = 0 While(True) LATB.7=1 delay_ms(500) LATB.7=0 delay_ms(500) Wend
With this code it's always the same problem.
I'm ordering a MINI-32 Board containing IC32MX534F064H, and I'll try to program that MINI-32 PIC with the MikroProg and MikroBasic Compiler, and we'll see the result.
For now I leave the post open.
Thank you.
https://www.mikroe.com/mini-pic32mx
November 28 2019 : All is working fine with MINI-32 without Bootloader.(PIC32MX534F064H)
So, i am ordering a ChipKit 32 board for further tests with another and new one PIC32MX230F256B (~test: middle January 2020)
Junuary 2020 :
The problem is same with PIC32MX230F256B on a ChipKit 32 Board.
But the populated PIC32MX250F128B on the Chipkit 32 board working fine.
Mars 11 2020 :
Works fine with a PIC32MX250F128B, but not with a PIC32MX230F256B (why ??? i do not know) . So i am closing for now this Post.