Skip to main content

Topics

This section allows you to view all Topics made by this member. Note that you can only see Topics made in areas you currently have access to.

Topics - Jim

1
Pirate PIC programmer / Bus Pirate PIC 24F Programmer Dev Thread
Since there isn't a thread (that I could find) about the recent blog posts I started this one.

Attached is a script to read the configuration words, you will have to remove the .txt extension and add a .scrp24 extension.

One thing to note is that the Programming Spec says that we should load CW2Address15:0 into W6 with the SIX instruction 2xxxx7 (2ABFC7 for the bus pirate's pic). This does not work and looking at the openprog source code the line should be 2xxxx6 (2ABFC6), which is logical since it's safe to assume that the last nibble defines the target register.

edit: WOOT! I have a script to write the configuration words up and running. You will need to modify lines 29 and 99 to suit your own purposes though and if bit 15 of the REGOUT doesn't clear by the end of step 8 add some duplicate step 8s to pad out the wait.

edit2: I did a couple more short scripts. One to demonstrate writing code memory and one to read code memory, but, due to the fact that my code that reads the scripts (I don't have a functioning bus pirate so I can't use the one in the dangerous prototypes repo), it just writes and reads the first 48 bytes of a table page.

So if you erase your chip with 7's script in the repo then run the attached ReadCodeMemory script you should read out 48 Fs. Then run the WriteCodeMemory script it will be programmed with 0123456789ABCDEF13579BDFFDB97531FEDCBA9876543210 starting at memory address 0x000200 which is the beginning of user flash program memory. Running the Read script again will read out the newly programmed code.

edit3: I just realized that to get this to work with the program in the repo you'll need to play with the timings. My programmer clocks the data in and out at 10ms per bit, which is really slow, but it works and rules out timing as a factor if any issues come up.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01172276864session_write_close ( )...(null):0
20.01202408456ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01202409232Database_MySQL->query( ).../DatabaseHandler.php:119
40.05732547968Database_MySQL->error( ).../Db-mysql.class.php:273