picprojects.net Forum

picprojects.net Forum
It is currently Thu Dec 14, 2017 10:45 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Bug and Error from Writing and Read on Raspberri Py and PIC.
PostPosted: Mon Sep 11, 2017 3:48 pm 
Offline

Joined: Mon Sep 11, 2017 2:54 pm
Posts: 1
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" />
</PgmIf>

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 :
Code:
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 :

Code:
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.

Code:
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 ...


Top
 Profile  
 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group