{"id":1652,"date":"2016-03-23T14:47:12","date_gmt":"2016-03-23T14:47:12","guid":{"rendered":"http:\/\/grodansparadis.com\/wordpress\/?p=1652"},"modified":"2016-03-23T14:47:12","modified_gmt":"2016-03-23T14:47:12","slug":"vscp-firmware-release-1-6","status":"publish","type":"post","link":"https:\/\/grodansparadis.com\/wordpress\/?p=1652","title":{"rendered":"VSCP Firmware release 1.6"},"content":{"rendered":"<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2015\/08\/vscp_new_v2.png\" rel=\"attachment wp-att-1009\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1009\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=1009\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2015\/08\/vscp_new_v2.png?fit=500%2C700&amp;ssl=1\" data-orig-size=\"500,700\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"vscp_new_v2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2015\/08\/vscp_new_v2.png?fit=500%2C700&amp;ssl=1\" class=\"alignnone wp-image-1009\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2015\/08\/vscp_new_v2.png?resize=183%2C256\" alt=\"vscp_new_v2\" width=\"183\" height=\"256\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2015\/08\/vscp_new_v2.png?w=500&amp;ssl=1 500w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2015\/08\/vscp_new_v2.png?resize=214%2C300&amp;ssl=1 214w\" sizes=\"auto, (max-width: 183px) 100vw, 183px\" \/><\/a><\/p>\n<p>A new VSCP firmware is released as version 1.6.0.<\/p>\n<p>The main difference in this release is that the segment controller check has been removed.\u00a0 This means that the node control that was present in register 131\/0x83\u00a0 is now replaced by the error counter.\u00a0 Thus read the current error counter value from this register.\u00a0 Reset the error counter by writing anything to the register.<\/p>\n<p>With the same segment check removed a node that is moved from one segment to another now must be manually initialized after it has been started up.<\/p>\n<p>Previously one control byte was used to check for initialized EEPROM.\u00a0 Now this is two bytes. The callbacks for this purpose has therefore been changed.<\/p>\n<pre>\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/ setVSCPControlByte\r\n\/\/\r\n\r\nvoid vscp_setControlByte( uint8_t idx, uint8_t ctrl )\r\n{\r\n    if ( idx &gt; 1 ) return;\r\n    eeprom_write( VSCP_EEPROM_CONTROL1 + idx, ctrl );\r\n}\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/ getVSCPControlByte\r\n\/\/\r\n\r\nuint8_t vscp_getControlByte( uint8_t idx )\r\n{\r\n    if ( idx &gt; 1 ) return 0;\r\n    return eeprom_read( VSCP_EEPROM_CONTROL1 + idx );\r\n}\r\n<\/pre>\n<p>Another callback has been added that do the actual initialization of the EEPROM<\/p>\n<pre>\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/ vscp_init_pstorage\r\n\/\/\r\nvoid vscp_init_pstorage( void )\r\n{\r\n    init_app_eeprom();\r\n}\r\n<\/pre>\n<p>An addition is added if you define<\/p>\n<blockquote><p>VSCP_FIRMWARE_ENABLE_ERROR_REPORTING<\/p><\/blockquote>\n<p>which will give access to a method for <a href=\"http:\/\/www.vscp.org\/docs\/vscpspec\/doku.php?id=class1.error\">VSCP standard error reporting<\/a><\/p>\n<pre>\/*!\r\n    Send error event (CLASS=508).\r\n    http:\/\/www.vscp.org\/docs\/vscpspec\/doku.php?id=class1.error\r\n    idx can be used to identify the internal part (\"submodule\") that was the\r\n    origin of the error. Both zone and sub zone are always set to zero.\r\n    @param type This is the VSCP type\r\n    @param idx Index to identify possible sub module. Normally set to zero.\r\n    @return True if event was sent.\r\n*\/\r\n#ifdef VSCP_FIRMWARE_ENABLE_ERROR_REPORTING\r\nuint8_t vscp_sendErrorEvent( uint8_t type, uint8_t idx );\r\n#endif\r\n\r\n<\/pre>\n<p>Just remember that over CAN it is no use in reporting communication problems as doing so will most likely make them worse.<\/p>\n<p>Another addition is added if you define<\/p>\n<blockquote><p>VSCP_FIRMWARE_ENABLE_LOGGING<\/p><\/blockquote>\n<p>which gives access to a method for <a href=\"http:\/\/www.vscp.org\/docs\/vscpspec\/doku.php?id=class1.log\">standard VSCP logging<\/a>.<\/p>\n<pre>\/*!\r\n    Send log event (CLASS=509). \r\n    http:\/\/www.vscp.org\/docs\/vscpspec\/doku.php?id=class1.log\r\n    For loging first send Type = 2(0x01) Log Start then logging events and when \r\n    log is closed send Type = 3 (0x03) Log Stop. To log several things use a \r\n    unique if for each and open\/close each.  \r\n    @param type VSCP logevent type.\r\n    @param id Identifier for the logging channel.\r\n    @param level Loglevel for this log event.\r\n    @param idx index for multiframe log event starting at zero.\r\n    @param pData Log data (Allways 5 bytes).\r\n    @return TRUE if event was sent.\r\n *\/\r\n#ifdef VSCP_FIRMWARE_ENABLE_LOGGING\r\nuint8_t vscp_sendLogEvent( uint8_t type, \r\n                            uint8_t id, \r\n                            uint8_t level, \r\n                            uint8_t idx, \r\n                            uint8_t data );\r\n#endif\r\n<\/pre>\n<p>As always the <a href=\"http:\/\/www.grodansparadis.com\/paris\/paris.html\">Paris project<\/a> and the <a href=\"http:\/\/www.grodansparadis.com\/kelvinntc10k\/kelvin_ntc10ka.html\">Kelvin NTC10K project<\/a> can be used as reference code.<\/p>\n<p>The release is available <a href=\"https:\/\/github.com\/grodansparadis\/vscp_firmware\/releases\/tag\/v1.6.0\">here<\/a>.<\/p>\n<p>Enjoy!<br \/>\n\/Ake<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A new VSCP firmware is released as version 1.6.0. The main difference in this release is that the segment controller check has been removed.\u00a0 This means that the node control that was present in register 131\/0x83\u00a0 is now replaced by the error counter.\u00a0 Thus read the current error counter value from this register.\u00a0 Reset the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[13],"tags":[],"class_list":["post-1652","post","type-post","status-publish","format-standard","hentry","category-vscp"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4raCZ-qE","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1652"}],"version-history":[{"count":1,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1652\/revisions"}],"predecessor-version":[{"id":1653,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1652\/revisions\/1653"}],"wp:attachment":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}