Pull to refresh

My feed

Type
Rating limit
Level of difficulty
Warning
To set up filters sign in or sign up
Post

Artery AT32F407 и scanf()

Речь пойдет об отладке AT-START-F407 V1.3. В составе платы находится программатор/отладчик AT-Link-EZ V1.2, который подключается по USB к ПК, где он виден как COM порт.

Его же можно использовать для целей отладки, а именно выводить информацию на ПК с помощью printf(). На эту тему а Artery есть AN0015_Printf_Debug_Demo, описанные там переопределения уже содержатся в файле at32f403a_407_board.c:

FILE __stdout;

#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)

PUTCHAR_PROTOTYPE
{
  while(usart_flag_get(PRINT_UART, USART_TDBE_FLAG) == RESET);
  usart_data_transmit(PRINT_UART, (uint16_t)ch);
  while(usart_flag_get(PRINT_UART, USART_TDC_FLAG) == RESET);
  return ch;
}

Все что нужно сделать, это добавить в код функцию инициализации uart_print_init(115200), где 115200 скорость COM порта.

Аналогичным образом можно с консоли передавать данные в МК с помощью функции scanf(). (На эту тему я не нашел AN). Добавим в файл at32f403a_407_board.c:

FILE __stdin;

#define GETCHAR_PROTOTYPE int fgetc(FILE * f)

GETCHAR_PROTOTYPE
{
  uint8_t cha = 0;
  usart_flag_clear(PRINT_UART, USART_ROERR_FLAG);  // Clear Overrun flag
  while(usart_flag_get(PRINT_UART, USART_RDBF_FLAG) == RESET);	
  cha = usart_data_receive(PRINT_UART);  
  usart_data_transmit(PRINT_UART, (uint16_t)cha); // Echo 
  return cha;
}

Все работает? Нет. Надо еще вызвать функцию

usart_receiver_enable(PRINT_UART, TRUE);

scanf("%d", &k);
k = 2*k;
printf(" \n\r You entered = %d", k);

И, теперь все работает.

Tags:
Total votes 1: ↑1 and ↓0+2
Comments0
Post

Написал ебилд (это инсталлятор для Gentoo Linux) игры Gigalomania - клон известной Mega-Lo-Mania. Люблю эту игру, но печально видеть что оригинал выглядит значительно лучше. Пишу сюда чтобы сказать вам - вдруг вы или знакомый хотите потренироваться в создании визуального дизайна игр, улучшить портфолио на этом некоммерческом проекте - автор на странице игры написал что ждет вас:

Help wanted!

...

Graphics artists - Whilst most of the "placeholder" graphics have now been removed, there's still plenty of room for improvement, so please let me know.

Игра относительно простая, текстур там относительно немного. Механика классная.

а выглядит плохо
а выглядит плохо

Может знаете еще в какое комьюнити можно написать?

Сайт игры: https://gigalomania.sourceforge.net/

Спасибо.

Tags:
Total votes 1: ↑1 and ↓0+3
Comments0
Article

How to build and run calculator from Windows XP using GCC x64?

Level of difficultyHard
Reading time63 min
Reach and readers2.9K

Hi Everyone!

In this article we a little bit will analyze of code of Windows XP and will compile the calculator application using GCC x64 in Windows 10 environment. We will look what kind of errors I faced during the build and the methods how to solve them. At the end we will launch the build of the calc.exe application.

Have a nice reading!

Read more
Article

Want to eliminate Agile? Define requirements

Reading time6 min
Reach and readers3.3K

Sometimes it seems that jokes about management implementing Agile to do more with less aren't far from the truth. I've rarely seen development teams understand Agile as anything more than a set of ceremonies, most often associated with Scrum.

In my experience, attempts to optimize team performance often boil down to changing the internal processes within the team itself. Meanwhile, critical decisions are made outside the team, remaining in a waterfall model. This creates a disconnect: on one hand, company management strives for the flexibility of Agile, while on the other, they continue to follow rigid patterns, limiting the team and preventing it from fully realizing its potential.

Read more 🔥
Article

Context switching

Level of difficultyEasy
Reading time4 min
Reach and readers2.3K

Hi! My name is Slava. I am currently working as a leading Product and Senior Project Manager at Uzum Bank. One of the leading digital banks in Uzbekistan.

We are growing fast. Really fast. Speaking in numbers, our interest income has increased x10 over the past year (!).

And, as in any similar projects with rapid growth, we constantly lack qualified personnel. So I and my colleagues always have a lot of work to do.

I have two teams with completely different products, and I also manage some projects as a project manager. And I have my own small business – an online tea and coffee shop. And in conclusion, I am the father of two small children)

So, I hope this makes it clear to you that I have faced all the problems, such as working at night, lack of sleep, working in a noisy environment, calls with crying children in the background, calls during breakfast on the wheels, when I take a child to kindergarten (never do that!) etc. and so on and so forth XD

You can ask me: how do you manage to do everything?
The answer is simple: I don't XD

But. This forces me to build a system that helps me quickly switch between different types of tasks, focus quickly and complete them over and over again.

So, today I want to tell you about one of the things, that can completely ruin your day. And sometimes – whole week. It's called "context switching".

Read more
Article

Machine Learning and Data Science: Academia vs. Industry

Level of difficultyMedium
Reading time8 min
Reach and readers95K

Machine Learning (ML) technologies are becoming increasingly popular and have various applications, ranging from smartphones and computers to large-scale enterprise infrastructure that serves billions of requests per day. Building ML tools, however, remains difficult today because there are no industry-wide standardised approaches to development. Many engineering students studying ML and Data Science must re-learn once they begin their careers. In this article, I've compiled a list of the top five problems that every ML specialist faces only on the job, highlighting the gap between university curriculum and real-world practice. 

Read more
Article

Utilizing Wearable Digital Health Technologies for Cardiovascular Monitoring

Level of difficultyMedium
Reading time17 min
Reach and readers1.5K

Wearable Digital Health Technologies for Monitoring in Cardiovascular Medicine

This review article presents a three-part true-life clinical vignette that illustrates how digital health technology can aid providers caring for patients with cardiovascular disease. Specific information that would identify real patients has been removed or altered. Each vignette is followed by a discussion of how these methods were used in the care of the patient.

Read more
Article

New ChatGPT-4o: A Game-Changer That Could Replace Data Analysts, Demo Included

Level of difficultyEasy
Reading time3 min
Reach and readers3.7K

In this article, I’m going to discuss something really important. If you’re a data analyst or you want to learn data analysis, please watch this video till the end because it’s really important.

Read more
Article

How to increase capacity of drive from 32 to 256 GB for Asus E200H laptop

Level of difficultyEasy
Reading time5 min
Reach and readers4.1K

Hi Everyone.

Recently I got Asus E200H laptop, which I would like to use as a portable computer to work with a high-precision equipment.

Within the scope of the article we will perform the experiment about the upgrade of the default 32 GB eMMC capacitor to 256 GB and will test it.

Have a nice reading!

Read more
Article

How to practice user empathy in UX design and make product more accessible

Level of difficultyEasy
Reading time6 min
Reach and readers1.4K

According to the Oxford Dictionary, empathy is “the ability to understand and share the feelings of another”. In UX, there is a special term “user empathy”. It refers to the ability of UX designers to fully understand what users need from a particular software product. Having user empathy and basing design solutions around users” comfort is one of the most true indicators of a designer”s professionalism. Without that, any product a designer works on has a high chance of turning out to be pointless. Apart from having empathy as a soft skill in general, there are several ways a designer can practice user empathy through different UX methods and techniques. In this article we would like to talk on how a UX designer can treat users with empathy and make the product more accessible for different groups of target audience.

Read more
Article

VS Code Extensions You Need in 2024: My Top Picks

Level of difficultyEasy
Reading time2 min
Reach and readers11K

Welcome to my latest article. If you haven't caught my previous ones, I highly recommend checking them out for some really useful content. Today, I'm excited to dive into something special: my top 10 favorite VS Code extensions. These tools are incredibly popular among developers globally, and I believe they're essential for anyone serious about coding.

Read more
News

Machines are learning to lie: The Dark Side of Intelligent Systems

Reading time1 min
Reach and readers3.7K

Recent research published in the journal Patterns has shown examples of how artificial intelligence (AI) systems are learning to manipulate information and deceive people. The concept of deception by AI dates back to Alan Turing's famous 1950 paper, which introduced the "Imitation Game" - a test that evaluates whether a machine can demonstrate human-like intelligence.

Read more
Article

Top 10 Google Sheets Features to Enhance Your Productivity

Level of difficultyEasy
Reading time3 min
Reach and readers2.5K

It's been a while since my last appearance, but I'm excited to be back and to share something truly special with you. In this article, we'll explore my top 10 Google Sheets features that are guaranteed to boost your productivity, speed up your workflow, and make your data handling more efficient. So, without further ado, let's dive into these game-changing tools!

Read more
Article

Simple complex programming

Level of difficultyMedium
Reading time5 min
Reach and readers1.9K


I always pay attention to assessing the complexity of programming in a particular language. Programming is indeed not an easy task and this is perceived as a fact and usually does not require any confirmation.


But the concept of “complexity” is akin to the term “heap”. For some, five coconuts is not so much, but for someone who ate one and “didn’t want any more,” this means that even one coconut will be too much for him.


The same goes for the complexity of programs. It seems that the constant increase in the complexity of programs is obvious to everyone and is observed in all areas of application of IT technologies, and programming languages themselves become more and more complex as they develop, but assessing “complexity” using numerical metrics is a problem. obviously a thankless task, but also “You can’t manage what you can’t measure...”


Typically, talk of “complexity” only implies value judgments without any numerical evaluation. And since I am personally interested in the issue of the complexity of programming languages, I decided to calculate the complexity of implementing the gcc compiler on some conditional “parrots”. What if we could see some patterns of difficulty changing over time?

Read more →
Article

Building blocks in programming languages

Level of difficultyMedium
Reading time5 min
Reach and readers1.6K

Practically all programming languages are built either on the principle of similarity (to make like this one, only with its own blackjack) or to realize some new concept (modularity, purity of functional calculations, etc.). Or both at the same time.


But in any case, the creator of a new programming language doesn't take his ideas randomly out of thin air. They are still based on his previous experience, obsession with the new concept and other initial settings and constraints.


Is there a minimal set of lexemes, operators, or syntactic constructs that can be used to construct an arbitrary grammar for a modern general-purpose programming language?

Read more →
Article

What is to see under the Black Sun of Giedi Prime?

Level of difficultyEasy
Reading time6 min
Reach and readers3.9K

The director Denis Villeneuve and cinematographer Greig Fraser in their Dune: Part Two movie made a curious decision to film the scenes on the surface of the Giedi Prime planet in the infrared spectrum. It turned out to have interesting aesthetics and there are some interesting related physics to discuss and speculate about how realistic the look of it is.

Read more