Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[AVR] CodeVision AVR - Is There Any Software Serial Library?

Status
Not open for further replies.

Rabiuls

Junior Member level 1
Joined
May 26, 2010
Messages
18
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,425
Hello,

Does anyone know about software serial library for CodeVision AVR?

Thank you.
 

Section 6.6 in the user manual explains how you can setup and use UART in codevision

- - - Updated - - -

You can also take a look it the
There is also a software UART example in the same link (if you don't want to use the hardware UART of AVR)
 

Section 6.6 is for setting hardware serial.

And the example ( https://www.hpinfotech.ro/softuart.zip ) is for Mega128, I could not adopt it for Mega328.

"Two USARTs and LCD" is using 2 hardware serial ports.

Thank you.
 
Last edited:

The code is probably not running as is but it shouldn't be that hard to modify.
Just change the device in the compiler, change the included device header and replace the register names that show an error

As a start here is a list or replacements to get the idea (old -> new)

Code:
OCR0 -> OCR0A
TIFR -> TIFR0
TIMSK -> TIMSK0
TIM0_COMP (interrupt handler) -> TIM0_COMPA
....

open the mega328.p header and find the existing register names that should replace the ones used in m128
 

I did something like that, and was able to compile too, but it didn't work. Perhaps I should try again.

So far it seems there is no library till now which I was looking for. Or, I could not find it through google.

I appreciate your help.

Best regards.
 

I did something like that, and was able to compile too, but it didn't work. Perhaps I should try again.

Maybe the initialization code for the peripherals need to be changed too, check the external interrupt.

Also according to the info the Rx pin should be the INT0 pin, in m128 that is PORTD.0 but in m328 it's PORTD.2
 

Thanks a lot again, and probably you are right. Unfortunately I have deleted the folder where were the modified source and the compiled file. I only replaced/added "0" and "0A", where I was getting error after compile (read datasheet for the variable/register and added "0"/"0A"). But did nothing with the Rx pin (PORTD.0 -> PORTD.2).

If I do it again, I shall remember this INT0 matter. Sorry, can't test all these right now due to some other works. Also planned to do it on Arduino.

I am grateful to you. I also believe your information will help others.

Take care and best regards.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top