Forum - MCS Electronics


FAQFAQ SearchSearch RegisterRegister Log inLog in

Search found 324 matches Forum Index
Author Message
  Topic: Code error is a major wtf

Replies: 7
Views: 426

PostForum: BASCOM-AVR Archive   Posted: Sun Jul 13, 2008 6:05 pm   Subject: Code error is a major wtf
You can do limited AND/OR combinations for IF statements, such as IF a=1 OR b=2 THEN...

For more complex combinational logic in IF blocks, you'll have to nest IF statements.

It's similar for mor ...
  Topic: Attiny 45 PWM and Timer1 again...

Replies: 11
Views: 2782

PostForum: BASCOM-AVR Archive   Posted: Fri Jul 11, 2008 11:13 am   Subject: Attiny 45 PWM and Timer1 again...
Fast PWM is the simplest PWM generation method on the AVRs. The counter counts up from 0 to 255 (for 8 bit PWM), then resets to 0 and keeps counting. When the counter hits 0, the output compare pin is ...
  Topic: Attiny 45 PWM and Timer1 again...

Replies: 11
Views: 2782

PostForum: BASCOM-AVR Archive   Posted: Thu Jul 10, 2008 8:10 pm   Subject: Attiny 45 PWM and Timer1 again...
It so happens that I used the tiny45 OCR1B as part of an RGB LED project. I used OCR0A/B and OCR1B for 8 bit fast PWM. Snippets below.

$regfile = "ATtiny45.DAT"
$crystal = 8000000

  Topic: SPI and SHIFTIN

Replies: 4
Views: 814

PostForum: BASCOM-AVR Archive   Posted: Tue Jun 03, 2008 11:05 am   Subject: SPI and SHIFTIN
You can have several SPI devices connected to the hardware SPI interface, provided they use the same SPI mode (phase/polarity). I'm working on a project that uses an SD card, a SPI RTC and a SPI UART ...
  Topic: How to use Analog comparator interruption?

Replies: 4
Views: 461

PostForum: BASCOM-AVR Archive   Posted: Tue Apr 29, 2008 11:29 am   Subject: How to use Analog comparator interruption?
The internal analog comparator doesn't seem to have much hysteresis (if any) so it's not so good for noisy signals. You can implement some hysteresis in software (by setting/resetting a port pin immed ...
  Topic: Math problem!

Replies: 15
Views: 1326

PostForum: BASCOM-AVR Archive   Posted: Tue Apr 29, 2008 11:07 am   Subject: Math problem!
Converting your 10bit ADC results to 16bit values can be done just by multiplying (as integers) by 64, or shifting left by 6 bits. The result won't scale right up to 65535 though. If you're using sing ...

Replies: 20
Views: 1391

PostForum: BASCOM-AVR Archive   Posted: Mon Apr 28, 2008 7:37 pm   Subject: NO HELP HERE
OK, let's start with the basics. Have you programmed with AVR (or other like PIC) microcontrollers before? If not, Bascom and AVRs is a good way to get started, but you need to start simple and try so ...
  Topic: mutiple condition check

Replies: 5
Views: 393

PostForum: BASCOM-AVR Archive   Posted: Wed Apr 23, 2008 11:38 am   Subject: mutiple condition check
You can use logical AND and OR operators to combine two conditions:
if variable > 500 and variable < 525 then
'do task
end if

For lots of conditions, you can nest multiple IF blocks:
  Topic: ADC: minimum voltage difference

Replies: 2
Views: 354

PostForum: BASCOM-AVR Archive   Posted: Wed Apr 23, 2008 11:26 am   Subject: ADC: minimum voltage difference
Do you mean the Analog to Digital Converter (ADC) or the Analog Comparator?

You can't get the ADC to trigger an interrupt based on the conversion result value. The ADC can trigger an interrupt when ...
  Topic: SPI Help required for m128

Replies: 2
Views: 407

PostForum: BASCOM-AVR Archive   Posted: Tue Apr 22, 2008 12:04 pm   Subject: SPI Help required for m128
Check your $crystal settings - I think you have an extra 0 in there, which will affect the serial baud rate.

You need to have PORTB.0 as an input on the slave because this is the Slave Select (chip ...
  Topic: select Sub problem

Replies: 2
Views: 227

PostForum: BASCOM-AVR Archive   Posted: Wed Apr 16, 2008 10:47 am   Subject: select Sub problem
This happens in 9.0 too, but not in 8.3 IIRC. It used to be a useful feature but now that you need to type "sub" or "function" first it's easier just to scroll down the list...
  Topic: help for wireless commounication

Replies: 4
Views: 647

PostForum: BASCOM-AVR Archive   Posted: Tue Apr 15, 2008 8:47 pm   Subject: help for wireless commounication
FSK = [url=]Frequency Shift Keying, a digital radio data modulation system.

There are lots of low-power radio modules that will do all the modulat ...
  Topic: Accurate timing

Replies: 14
Views: 1449

PostForum: BASCOM-AVR Archive   Posted: Mon Apr 14, 2008 9:34 pm   Subject: Accurate timing
I notice in several datasheets (eg M32, M128, though it's not specified for some newer devices) that the internal loading capacitors for the asynchronous 32kHz oscillator are 36pF each - that's a lot ...
  Topic: Anyone can make .bas from .c file?

Replies: 2
Views: 925

PostForum: BASCOM-8051   Posted: Sat Apr 12, 2008 9:15 pm   Subject: Anyone can make .bas from .c file?
I don't mean to sound nasty, but you can't expect others here to do your work for you. We can offer tips and a bit of help, but this is a fair bit of work.

This would make a great exercise for lear ...
  Topic: Sending large amounts of data to SPI

Replies: 1
Views: 341

PostForum: BASCOM-AVR Archive   Posted: Fri Apr 11, 2008 6:13 pm   Subject: Sending large amounts of data to SPI
If you have the data in a large table (using Data/Read, or stored into program memory) you can use a for/next type loop and send bytes directly to the SPI port without using SpiOut. That way there is ...
Page 20 of 22 Goto page Previous  1, 2, 3 ... 19, 20, 21, 22  Next
All times are GMT + 1 Hour
Jump to: