Maybe this should be in another thread. I have been using visual Micro with Visual Studio 2015 for some time but saw there was an update so I have installed Visual Studio 2019 version 16.0.2 with Visual Micro 1904.20.1 and the Arduino IDE 1.8.9 but now I am having a few problems with a project which built OK in the old setup.
I am experimenting with an ATTiny841 using the library from SpenceKonde/ATTinyCore.
https://github.com/SpenceKonde/ATTinyCore.
I downloaded the zipped library file and un-zipped it to C:\Users\james\Documents\Arduino\Hardware\ATTinyCore.
The problem I have is when I now open the project in the new installation, and start typing in say DDR for DDRA I dont get intellisense suggestions, also Intellisense highlights a number of errors in the code but the project seems to Builds OK and runs when downloaded to my board.
What you cant see in the attached code is that PIN_B0, PINB0 etc and all references to the processors registers like DDRB, UBRR0H etc have the red squigly intellisense warning under them with "Potential fixes". If I look at the "potential fixes" I get a huge list of #include suggestions.
//Red Green Indicator
const byte IndicatorLedRed = PIN_B0;
const byte IndicatorLedRedRegPos = PINB0;
const byte IndicatorLedGreen = PIN_B1;
const byte IndicatorLedGreenRegPos = PINB1;
byte MainLoopCount;
void setup()
{
DDRB = DDRB | (1 << IndicatorLedRedRegPos) | (1 << IndicatorLedGreenRegPos);// initialize the indicator pins
USART0_Init(25);// Set the baudrate to 2400 bps using a 1 MHz
}
void loop(void)
{
MainLoopCount = 1;
while (MainLoopCount) //flash indicator green/red 5 times to show startup
{
digitalWrite(IndicatorLedGreen, HIGH);
delay(2000);
digitalWrite(IndicatorLedGreen, LOW);
delay(200);
digitalWrite(IndicatorLedRed, HIGH);
delay(2000);
digitalWrite(IndicatorLedRed, LOW);
delay(200);
--MainLoopCount;
}
USART0_Transmit(char('5'));//send unsigned character
}
void USART0_Init(unsigned int baud)// Initialize UART
{
UBRR0H = (unsigned char)(baud >> 8);// Set baud rate
UBRR0L = (unsigned char)baud;
//UCSR0B = (1 << RXEN0) | (1 << TXEN0);//Enable receiver and transmitter
UCSR0B = (1 << TXEN0);//Enable transmitter
UCSR0C = (1 << USBS0) | (3 << UCSZ00);// Set frame format: 8data, 2stop bit
}
void USART0_Transmit(unsigned char data)//send serial
{
while (!(UCSR0A & (1 << UDRE0)));// Wait for empty transmit buffer
UDR0 = (data);// send a single byte
}
Any ideas, probably something silly I have done.
Jim