{"id":28,"date":"2014-10-04T21:14:40","date_gmt":"2014-10-04T19:14:40","guid":{"rendered":"http:\/\/wp.famlarsson.net\/?p=28"},"modified":"2014-10-04T22:55:38","modified_gmt":"2014-10-04T20:55:38","slug":"pickkit-2","status":"publish","type":"post","link":"https:\/\/wp.famlarsson.net\/?p=28","title":{"rendered":"Pickkit 2 med pk2cmd"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">F\u00f6r PIC-programmering kr\u00e4vs 2 program. Sdcc f\u00f6r kompilering och Pk2cmd f\u00f6r att f\u00f6ra \u00f6ver till mikrokontrollern. Dessa m\u00e5ste i ubuntu kompileras och installeras fr\u00e5n k\u00e4llkod d\u00e5 det annars saknas includfilerer pga licensprolem.<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">### Pk2cmd ###<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">export PATH=$PATH:\/usr\/share\/pk2 #G\u00f6r att filen hittas och kan anv\u00e4ndas.<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">pk2cmd &#8217;-S#&#8217; list all connected Pickit 2 devices and their firmware version<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">pk2cmd -Dfile replace the firmware by the contents of the specified file<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">pk2cmd -Ppart -R -T power on the target, part is for example PIC18F4550. The -R option is needed to release the Vpp line, which is also the MCLR (reset) on many PIC&#8217;s.<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">pk2cmd -Ppart -W power off the target<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">pk2cmd -Ppart -Ffile -M program the target using specified file<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">\u201dpart = PIC18F4550\u201d<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">Ladda upp firmware test.hex.<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">pk2cmd -M -PPIC18f4550 -Ftest.hex<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">### sdcc ###<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">#Kompilera test.c<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">sdcc -mpic16 -p18f4550 &#8211;use-non-free test.c<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">### list usb devices ####<\/p>\n<p style=\"margin-bottom: 0cm; line-height: 100%;\">lsusb<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; F\u00f6r PIC-programmering kr\u00e4vs 2 program. Sdcc f\u00f6r kompilering och Pk2cmd f\u00f6r att f\u00f6ra \u00f6ver till mikrokontrollern. Dessa m\u00e5ste i ubuntu kompileras och installeras fr\u00e5n k\u00e4llkod d\u00e5 det annars saknas includfilerer pga licensprolem. ### Pk2cmd ### export PATH=$PATH:\/usr\/share\/pk2 #G\u00f6r att filen hittas och kan anv\u00e4ndas. pk2cmd &#8217;-S#&#8217; list all connected Pickit 2 devices and their [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/wp.famlarsson.net\/index.php?rest_route=\/wp\/v2\/posts\/28"}],"collection":[{"href":"https:\/\/wp.famlarsson.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.famlarsson.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.famlarsson.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.famlarsson.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=28"}],"version-history":[{"count":3,"href":"https:\/\/wp.famlarsson.net\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":31,"href":"https:\/\/wp.famlarsson.net\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions\/31"}],"wp:attachment":[{"href":"https:\/\/wp.famlarsson.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.famlarsson.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.famlarsson.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}