Xmega ADC This compile fine and can read the digital value Config Adca = Single , Convmode = UnSigned , Resolution = 12bit , Dma = Off , Reference = Intvcc , Event_mode = None , Prescaler = 512 , _ Ch0_gain = 1 , Ch0_inp = Single_ended , Mux0 = &B00000000 'Setup Channel 0 in Single Ended Mode
Do w = Getadc(adca , 0 , &B00000000) 'ADC A, Channel 0 , MUX = &B00000000 --> PINA.0 Waitms 1000 print #1, "ADC steps = " ; w Loop
But i need to use the ADC on PortA.3 but if make the config like this, it not compile and show errors, what make i wrong? Config Adca = Single , Convmode = UnSigned , Resolution = 12bit , Dma = Off , Reference = Intvcc , Event_mode = None , Prescaler = 512 , _ Ch3_gain = 1 , Ch3_inp = Single_ended , Mux3 = &B10000000 'Setup Channel 3 in Single Ended Mode
Appreciate any help Regards P_Santos
[b:ccd2d088c4][color=red:ccd2d088c4](BASCOM-AVR version : 126.96.36.199 )[/b:ccd2d088c4][/color:ccd2d088c4]
I will try to do it tonight. The frequency of the oscillator was also checked and the setting fuse bit for the clock. Everything is OK here. As you wrote, I will check everything to be sure on the LED.
you best do the toggle test, then when that is ok and you are sure that it is wired as in the CONFIG LCD, share this info here. something else : make sure the $crystal matches the actual processor clock. when you set it to say 1 mhz and it is actual higher, the timing will not be right. but the toggle test will reveal that quickly when using 1000 mS delay.
[quote:2213d8691b="atmega64"]only with this code I have a minimum frequency of 7.6Hz ...[/quote:2213d8691b] Understandable with a prescaler of 8 [quote:2213d8691b]how can I get to have a frequency range of 1Hz - 5Hz?[/quote:2213d8691b] [code:1:2213d8691b]TCCR1B = &B00011011[/code:1:2213d8691b]
I will do it, please do not feel sorry for me. I was digging through the Internet for a week, and in all available Arduino documents with pin mapping, I had the same information. In the examples of BASCOM for Arduino Uno everything was also right. I did not think about checking the correctness of the Arduino documentation. And the definition of LCD in BASCOM is so trivial that I considered it an abuse to paste such code ....
When you post for help, you should wonder if you post enough information so you can get help. at least you should post your code (in code tags). that is the very minimum. then it will also help to post a circuit or part of the circuit. especial when dealing with arduino hardware. and you should have performed a test for the used pins. if you think pg5 is used, just make it toggle and connect a LED to see if it does. in short you should do maximum your best to provide the readers all the info there is. no room for guessing.
Hello, I have a problem with running it would seem a simple thing. I want to use the Mega2560 and LCD Keypad Shield. And I can not run the LCD ... The program is compiling, however, after loading the LCD does not work. The Arduino documentation shows that the LCD is connected via digital pins 4, 5, 6, 7, 8 and 9. Translating this on the ports of the Mega2560 processor comes out that in the LCD configuration I should use: PG5, PE3, PH3, PH4, PH5 and PH6 . After entering the appropriate ports and compiling the program, the LCD does not work. Lights up but does not display any characters. Of course, in the same set when I am loading an Arduino sketch, everything works perfectly. I have a lot of my own programs for years written in BASCOM, I got used to it and I do not want to give up, and here a simple thing stopped me. Does anyone have any idea what's going on?