picprojects.net Forum

Bug and Error from Writing and Read on Raspberri Py and PIC.
Page 1 of 1

Author:  ludo302 [ Mon Sep 11, 2017 3:48 pm ]
Post subject:  Bug and Error from Writing and Read on Raspberri Py and PIC.

I have made some jobs before arrive to make it works, so i give you my probleme and my answers.

On Raspberry pi compute, but for all RPI, i think, connected on ssh.

My micro is a PIC24 familly and it was connected over GPIO.

I arrive to prog my pic with PGEC, PGEDout, PEGDin, MCLR, on PIC32 programmer, and it's was also connected respectively on GPIO1 GPIO28, GPIO29, GPIO5,

The MCLR is protected by 470ohm from the pic to 1k pull up, otherwise it reboot ...
The PGEDout is protected by 1K for writing on PGED fromPIC, and PGEDin is from the PGED signal directly from the PIC side like callback from Dout.

I have edit the /opt/picpgm/pgmifcfg.xml for Raspberry GPIO like this :

<PgmIf name="GPIO Programmer (Raspberry Pi) on PIC24 " typ="LVP" connection="GPIO">
<PinCfg name="MCLR" pin="5" invert="0" />
<PinCfg name="CLK" pin="1" invert="0" />
<PinCfg name="DOUT" pin="28" invert="0" />
<PinCfg name="DIN" pin="29" invert="0" />

The line " <PinCfg name="PGM" pin="16" invert="0" />" was deletted.

#Beware, the GPIO name can 't be change or add, like new config GPIOPIC24 dont works...

But the PICPGM dont arrive to detect or autodetect my PIC, but ot works somme time if i define it.

So the script that may works is :
sudo picpgm -p_code myfile.hex -pic PIC24FJ256GB206 -if GPIO

So now, it works some time or not and it's report bug from verifying memory.

So after some try, it's seem to be the timing from process to be in fault.

In this case just SSH payload, so with GUI or Big process ... ?!

so i need to make PICPGM on Middle priority to make it's works perfectly.
with chrt -f 50 it could be fine, ans add some delay for the timing on picpgm by -delay 2. 2->10

So i need to make this one for works perfect all time :

sudo chrt -f 50 picpgm -p_code myfile.hex -pic PIC24FJ256BG206 -if GPIO -delay 2

That Works fine ...

Maybe you could be define the priority request inside the picpgm., and add some time to be sure writing et erase is done.

May this can help someone,

ps : You can also make a first erase for stoping the pic software and io switching, sleep 1s for flush the proc queue, and make writing.

sudo chrt -f 50 picpgm -e -pic PIC24FJ256BG206 -if GPIO -delay 2
sleep 1
sudo chrt -f 50 picpgm -p_code myfile.hex -pic PIC24FJ256BG206 -if GPIO -delay 2
echo "it's done..."

Ludo302, Thanks ...

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group