{"id":231,"date":"2017-11-23T00:03:58","date_gmt":"2017-11-22T23:03:58","guid":{"rendered":"http:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=231"},"modified":"2023-03-04T23:48:10","modified_gmt":"2023-03-04T22:48:10","slug":"16-spi_max5250-library-stm32f4","status":"publish","type":"page","link":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=231","title":{"rendered":"16-SPI_MAX5250-Library (STM32F4)"},"content":{"rendered":"<p><div id=\"nav-below\" class=\"navigation\"><div class=\"nav-previous\"><a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=229\" title=\"15-SPI_LoLevel-Library (STM32F4)\"><span class=\"meta-nav\">\u2190<\/span> 15-SPI_LoLevel-Library (STM32F4)<\/a><\/div><\/div><!-- #nav-below --><div id=\"nav-below\" class=\"navigation\"><div class=\"nav-next\"><a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=233\" title=\"17-SPI_LIS302DL-Library (STM32F4)\">17-SPI_LIS302DL-Library (STM32F4) <span class=\"meta-nav\">&rarr;<\/span><\/a><\/div><\/div><!-- #nav-below --><\/p>\n<p>-diese Library dient zum ansteuern eines MAX5250 (4fach DA-Wandler) von einem externen Modul das per SPI an den STM32F4 angeschlossen ist.<\/p>\n<p>-es wird die SPI-LoLevel-Library benutzt (mit SPI2)<\/p>\n<p><strong>Beispielbild :<\/strong><\/p>\n<p><a href=\"http:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-content\/uploads\/2013\/03\/max5250.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-703\" src=\"http:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-content\/uploads\/2013\/03\/max5250-300x179.jpg\" alt=\"max5250\" width=\"300\" height=\"179\" \/><\/a><\/p>\n<p><strong>Benutzte Pins :<\/strong><\/p>\n<pre lang=\"c\" line=\"1\">SCK an PB13\r\nMOSI an PB15\r\nMISO an PB14\r\nChipSelect an PB12<\/pre>\n<p><strong>Voraussetzungen :<\/strong><\/p>\n<pre lang=\"c\" line=\"1\">Benutzte Module der CooCox-IDE : GPIO\r\nBenutzte Librarys : STM32_UB_SPI2<\/pre>\n<p><strong>Enumerationen :<\/strong><\/p>\n<pre lang=\"c\" line=\"1\">typedef enum {\r\n  DAC_0 = 0,  \/\/ DAC-Kanal-0\r\n  DAC_1,      \/\/ DAC-Kanal-1\r\n  DAC_2,      \/\/ DAC-Kanal-2\r\n  DAC_3       \/\/ DAC-Kanal-3\r\n}MAX5250_DAC_t;<\/pre>\n<p><strong>Funktionen :<\/strong><\/p>\n<pre lang=\"c\" line=\"1\">ErrorStatus UB_MAX5250_Init(void);                          \/\/ zum initialisieren des MAX5250\r\nvoid UB_MAX5250_SetDAC(MAX5250_DAC_t kanal, uint16_t wert); \/\/ zum setzen eines DAC-Wertes<\/pre>\n<p><strong>Beispiel :<\/strong><\/p>\n<pre lang=\"c\" line=\"1\">\/\/--------------------------------------------------------------\r\n\/\/ File     : main.c\r\n\/\/ Datum    : 04.03.2013\r\n\/\/ Version  : 1.0\r\n\/\/ Autor    : UB\r\n\/\/ EMail    : mc-4u(@)t-online.de\r\n\/\/ Web      : www.mikrocontroller-4u.de\r\n\/\/ CPU      : STM32F4\r\n\/\/ IDE      : CooCox CoIDE 1.7.0\r\n\/\/ Module   : CMSIS_BOOT, M4_CMSIS_CORE\r\n\/\/ Funktion : Demo der MAX5250-Library\r\n\/\/ Hinweis  : Diese zwei Files muessen auf 8MHz stehen\r\n\/\/              \"cmsis_boot\/stm32f4xx.h\"\r\n\/\/              \"cmsis_boot\/system_stm32f4xx.c\"\r\n\/\/--------------------------------------------------------------\r\n\r\n#include \"main.h\"\r\n#include \"stm32_ub_max5250.h\"\r\n\r\nint main(void)\r\n{\r\n  SystemInit(); \/\/ Quarz Einstellungen aktivieren\r\n\r\n  UB_MAX5250_Init(); \/\/ Init vom MAX5250\r\n\r\n  UB_MAX5250_SetDAC(DAC_0,0);    \/\/ DAC0 auf Minimum (0V)\r\n  UB_MAX5250_SetDAC(DAC_1,341);  \/\/ DAC1 auf 33%     (1V)\r\n  UB_MAX5250_SetDAC(DAC_2,682);  \/\/ DAC2 auf 66%     (2V)\r\n  UB_MAX5250_SetDAC(DAC_3,1023); \/\/ DAC3 auf Maximum (3V)\r\n\r\n  while(1)\r\n  {\r\n\r\n  }\r\n}\r\n<\/pre>\n<p>Hier die Library zum\u00a0<strong>Download :<\/strong><\/p>\n<p><a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-content\/uploads\/2013\/03\/ub_stm32f4_spi_max5250_v100.zip\">ub_stm32f4_spi_max5250_v100<\/a><\/p>\n<p>Hier der komplette CooCox-Projektordner zum\u00a0<strong>Download :<\/strong><\/p>\n<p><a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-content\/uploads\/2013\/03\/Demo_16_SPI_MAX5250.zip\">Demo_16_SPI_MAX5250<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>-diese Library dient zum ansteuern eines MAX5250 (4fach DA-Wandler) von einem externen Modul das per SPI an den STM32F4 angeschlossen ist. -es wird die SPI-LoLevel-Library benutzt (mit SPI2) Beispielbild : Benutzte Pins : SCK an PB13 MOSI an PB15 MISO &hellip; <a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=231\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":144,"menu_order":16,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[128],"tags":[9,150,49,7],"class_list":["post-231","page","type-page","status-publish","hentry","category-stm32f4","tag-library","tag-max5250","tag-spi","tag-stm32f4"],"_links":{"self":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=231"}],"version-history":[{"count":4,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/231\/revisions"}],"predecessor-version":[{"id":3666,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/231\/revisions\/3666"}],"up":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/144"}],"wp:attachment":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}