Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Search found 39 matches
www.mcselec.com Forum Index
Author Message
  Topic: printbin keeps port (even if not used)
mpo

Replies: 8
Views: 982

PostForum: BASCOM-AVR Unsupported versions   Posted: Thu Jul 24, 2014 2:11 pm   Subject: printbin keeps port (even if not used)
After all the idea of bascom is that you need to add as little as possible and that bascom handles it for you.

This time it handled to much... Smile
At the end it is still necessary to manually ma ...
  Topic: printbin keeps port (even if not used)
mpo

Replies: 8
Views: 982

PostForum: BASCOM-AVR Unsupported versions   Posted: Wed Jul 23, 2014 7:41 am   Subject: printbin keeps port (even if not used)
Hi,

You can use #IF/#ENDIF with constants to conditionally compile code.

Regards
Ian Dobson
No, I can't.
My device uses rx/tx AND normal i/o - mode is choosen by user in menu, so all options ...
  Topic: printbin keeps port (even if not used)
mpo

Replies: 8
Views: 982

PostForum: BASCOM-AVR Unsupported versions   Posted: Tue Jul 22, 2014 11:55 am   Subject: printbin keeps port (even if not used)
Hi,

Simply put the Compiler "sees" that you have a print in your code and configures the Serial port for you. As you used a Byte variable the Compiler assumes the print code will be executed at som ...
  Topic: printbin keeps port (even if not used)
mpo

Replies: 8
Views: 982

PostForum: BASCOM-AVR Unsupported versions   Posted: Sun Jul 20, 2014 10:45 pm   Subject: printbin keeps port (even if not used)
Also I don't enable rx/tx in UCSR0B in this code. And default value is 0.
This is strange that dead code (never executed) sets registers.
I put into my code

Do
Loop Until Ucsr0a.udre0 = 1 ...
  Topic: printbin keeps port (even if not used)
mpo

Replies: 8
Views: 982

PostForum: BASCOM-AVR Unsupported versions   Posted: Sun Jul 20, 2014 5:05 pm   Subject: printbin keeps port (even if not used)
Strange situation.
I use PORTD.1 as Tx output or just ordinary I/O pin, but if I compile 'printbin' somewhere into program, it takes ownership of this pin.

In the example below I never use printbi ...
  Topic: Question about casting
mpo

Replies: 1
Views: 184

PostForum: BASCOM-AVR Unsupported versions   Posted: Thu Feb 20, 2014 11:00 am   Subject: Question about casting
Hello,
Maybe I miss something, but let me understand how it works in bascom.
I have very basic example below:

$regfile = "m8def.DAT"
$crystal = 8000000
$sim
Dim W16 As Word
Dim X16 ...
  Topic: pin change interrupt configuration
mpo

Replies: 4
Views: 211

PostForum: BASCOM-AVR Archive   Posted: Mon Dec 30, 2013 1:03 pm   Subject: pin change interrupt configuration
You are right. It's PD0. But it's also PCINT16 as desired.
I put wrong bit number.
  Topic: pin change interrupt configuration
mpo

Replies: 4
Views: 211

PostForum: BASCOM-AVR Archive   Posted: Mon Dec 30, 2013 1:08 am   Subject: pin change interrupt configuration
In the meantime I found the answer (on the forum, can not find such info in help file).

Pcmsk2 = &B0000_0001
ON PCINT2 pinchange_pd1

Confusing at the ...
  Topic: pin change interrupt configuration
mpo

Replies: 4
Views: 211

PostForum: BASCOM-AVR Archive   Posted: Mon Dec 30, 2013 12:46 am   Subject: pin change interrupt configuration
Hi,
In my device based on atmega168 I need to use pin change interrrupt (on PD1 pin).
Is there any support in Bascom for such interrupts?
I can manually manipulate relevant bits in PCICR, PCIFR, PC ...
  Topic: microwire serial eeprom access
mpo

Replies: 0
Views: 129

PostForum: BASCOM-AVR Archive   Posted: Fri Nov 15, 2013 10:41 am   Subject: microwire serial eeprom access
Hi,
I found that 8051 bascom has nice MWREAD instruction.
Is it somehow available on avr bascom or I have to implement it by myself?
Maybe someone have procedures or lib that support 93C56 access? ...
  Topic: atmega8 to atmega168 porting problem
mpo

Replies: 15
Views: 1501

PostForum: AVR   Posted: Wed Nov 06, 2013 10:33 am   Subject: atmega8 to atmega168 porting problem
I added some sugested changes to isr


power_fail:
'switch all to input
DDRB=0
DDRC=0
DDRD=0
'and disable pullup
MCUCR.PUD=1


Also I disabled unused peripherials to lower power consum ...
  Topic: atmega8 to atmega168 porting problem
mpo

Replies: 15
Views: 1501

PostForum: AVR   Posted: Tue Nov 05, 2013 3:18 pm   Subject: atmega8 to atmega168 porting problem
Well, the PCB is fixed, so there is no room for additional comparator.
On the output of 7805 I have only one 100nF cap. Total current is about 100-200mA, so voltage should drop immediately.

Some p ...
  Topic: atmega8 to atmega168 porting problem
mpo

Replies: 15
Views: 1501

PostForum: AVR   Posted: Mon Nov 04, 2013 10:22 pm   Subject: atmega8 to atmega168 porting problem

I'd try an 1k parallel to C2 to have a sharp drop in input voltage.
Good idea - I'll try this tomorrow.
I have lot of power consumers connected before schottky diode, so drop should be immediate. ...
  Topic: atmega8 to atmega168 porting problem
mpo

Replies: 15
Views: 1501

PostForum: AVR   Posted: Mon Nov 04, 2013 9:15 pm   Subject: atmega8 to atmega168 porting problem
I tried this.
When INT1 is just pulled via resistor and I ground it manually, interrupt occurs and eeprom is written.
But I see no reason why backup capacitor is not enough. I tried to add 1000uF mo ...
  Topic: atmega8 to atmega168 porting problem
mpo

Replies: 15
Views: 1501

PostForum: AVR   Posted: Mon Nov 04, 2013 11:51 am   Subject: atmega8 to atmega168 porting problem
Hi,
Not sure if my question is more bascom or hardware related, but I start here.

I have device based on atmega8 which has feature: "write few bytes to eeprom when power off".
It's done by monito ...
 
Page 1 of 3 Goto page 1, 2, 3  Next
All times are GMT + 1 Hour
Jump to: