microcontroller

How can I broadcast data to multiple SPI slaves and how it works?

若如初见. 提交于 2019-12-02 22:55:56
问题 I know basic SPI protocol and its master to slave operations. I want to know that is it possible to broadcast data on multiple slave? If it is possible then how it works. I've heard that after writing to any SPI slave you have to read from slave even if you are not going to use read data. How is this possible in case broadcast if broadcast is possible? 回答1: No, it's not possible. Since SPI is 4- wire interface. The SS line is used for slave selection.One SPI master can have multiple slaves

Converting a Makefile to CMakeLists.txt for Tiva C Series

六眼飞鱼酱① 提交于 2019-12-02 17:52:37
问题 I'd like to program my Tiva C Series LaunchPad board in C++ using CMake build process. I downloaded a simple examples to blink the RGB LED I built using make and I'd like to be able to use cmake to start a bigger project. Here is the Makefile provided in the example : # Tiva Makefile # ##################################### # # Part of the uCtools project # uctools.github.com # ####################################### # user configuration: ####################################### # TARGET: name

USB programming

独自空忆成欢 提交于 2019-12-02 15:54:27
I want to program a microcontroller (AVR) to control some leds through USB. It's just out of interest in how to build and program USB devices. There are some AVR microcontrollers that support the USB protocol or I could implement the USB protocol in an another microcontroller myself, but I wonder what to use to write your own drivers on the computer. My level in system programming: total noob (hence the question) So what is the literature you people would advice to get good knowledge of the USB technology and how to write your own drivers and beyond? P.S.: I know: C (probably will need it here

How can I make my own microcontroller?

一曲冷凌霜 提交于 2019-12-02 14:17:25
How can I make my own microcontroller? I've done some work using GAL chips and programmed a chip to do simple commands such as add, load, move, xor, and output, but I'd like to do something more like a real microcontroller. How can I go about doing this? I've read a little bit about FPGA and CPLD, but not very much, and so was looking for some advice on what to get and how to start developing on it. Look here for a good wiki book. I had some coursework I wrote when I was teaching Electronic Eng, but I couldn't find it around. When I was teaching, most of the students were happy to use the

pronounce a color based on the bits values with the pic 18f4550

陌路散爱 提交于 2019-12-02 13:45:17
update 2 I want to make a program that can play sound (that can say red, green and blue) on my pic 18f4550 there is a speaker connected to the picdem, that part works fine, I wrote the following program with microchip version 6.83 with the C compiler. I need to retrieve the bits value of a .wav file, when I say red (this has a bit pattern). My right question, how can a get the bit value of my .wav file. void main (void) { TRISD = 0x00; // PORTD als uitgang TRISB = 0b00110000; // RB4 en RB5 als ingang TRISA = 0x00; // RA output RCONbits.IPEN = 0; // interrupts INTCONbits.GIE = 1; INTCONbits

How can I broadcast data to multiple SPI slaves and how it works?

守給你的承諾、 提交于 2019-12-02 13:10:20
I know basic SPI protocol and its master to slave operations. I want to know that is it possible to broadcast data on multiple slave? If it is possible then how it works. I've heard that after writing to any SPI slave you have to read from slave even if you are not going to use read data. How is this possible in case broadcast if broadcast is possible? No, it's not possible. Since SPI is 4- wire interface. The SS line is used for slave selection.One SPI master can have multiple slaves but it cannot select all the slaves at once since it is either using some bit or SS signal to select the slave

C8051f312 microcontroller [closed]

柔情痞子 提交于 2019-12-02 13:04:26
I'm not very good at C language, but I have write a very simple code to a C8051F312 microcontroller. My code doesn't working. Please help me what did I wrong. #include C8051F310.h #include stdio.h sbit LED_16 = P1^7; // green LED: 1 = ON; 0 = OFF void init(void) { // XBRN registers_init XBR0 = 0x00; XBR1 = 0x00; // Enable the crossbar PCA0MD = 0X00; // port_init P0MDOUT = 0x00; // Output configuration for P0 P1MDOUT = 0x40; // Output configuration for P1 P2MDOUT = 0x00; // Output configuration for P2 P3MDOUT = 0x00; // Output configuration for P3 } void main(void) { init(); while (1) { LED_16

push_back() causes program to stop before entering main()

Deadly 提交于 2019-12-02 08:41:25
问题 I'm developing in c++ for my STM32F3 Discovery board and using std::deque as queue. After trying to debug my code (directly on device with ST-link or in simulator), the code eventually stops at breakpoint before even entering my code in main(). However, SystemInit() configures board just fine.. I've traced this behavior down to using push_back() (and push_front) as commenting it out from code solves the issue. Through disassmebly I found that after using it, the execution stops at breakpoint

How to retarget printf() on an STM32F10x?

扶醉桌前 提交于 2019-12-02 08:20:25
问题 I use this code for retarget printf() , but it does not work #ifdef __GNUC__ /* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf set to 'Yes') calls __io_putchar() */ #define PUTCHAR_PROTOTYPE int __io_putchar(int ch) #else #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f) #endif /* __GNUC__ */ PUTCHAR_PROTOTYPE { /* Place your implementation of fputc here */ /* e.g. write a character to the LCD */ lcd_Data_Write((u8)ch); return ch; } I use STM32F103RBT6

How to retarget printf() on an STM32F10x?

狂风中的少年 提交于 2019-12-02 03:21:56
I use this code for retarget printf() , but it does not work #ifdef __GNUC__ /* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf set to 'Yes') calls __io_putchar() */ #define PUTCHAR_PROTOTYPE int __io_putchar(int ch) #else #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f) #endif /* __GNUC__ */ PUTCHAR_PROTOTYPE { /* Place your implementation of fputc here */ /* e.g. write a character to the LCD */ lcd_Data_Write((u8)ch); return ch; } I use STM32F103RBT6 compiler : GCC with emBitz editor Try hijacking the _write function like so: #define STDOUT_FILENO 1 #define