input HEX to program LED ATMega8 - Help ME
-
- Beiträge: 14
- Registriert: Dienstag 25. August 2015, 11:48
- Wohnort: Poland/Bielsko-Biała
- Kontaktdaten:
input HEX to program LED ATMega8 - Help ME
Hello.
They're working on the device inputs and outputs USB-based microcontroller Atmega8. Share when I finish.
The unit will consist of modules that connect to his own personal experience bath.
When you create macros encountered a serious problem with access.
With RS-232 I get the value HEX 16-bit microcontroller input ATMega8. I can do so that the LEDs in the program work in turn. In the example I posted the switches that send HEX values corresponding to those of my microcontroller (do not start at the same time!). The practice can also be combinations of switches so HEX values must be literally translated output LEDs. Please help.
They're working on the device inputs and outputs USB-based microcontroller Atmega8. Share when I finish.
The unit will consist of modules that connect to his own personal experience bath.
When you create macros encountered a serious problem with access.
With RS-232 I get the value HEX 16-bit microcontroller input ATMega8. I can do so that the LEDs in the program work in turn. In the example I posted the switches that send HEX values corresponding to those of my microcontroller (do not start at the same time!). The practice can also be combinations of switches so HEX values must be literally translated output LEDs. Please help.
- Dateianhänge
-
- HELP ME.prj
- (3.63 KiB) 275-mal heruntergeladen
Re: input HEX to program LED ATMega8 - Help ME
Could you be more specific on the exact problems you've encountered?lukg20 hat geschrieben:When you create macros encountered a serious problem with access.
How do you do that exactly? Are there really 2 Bytes being received?lukg20 hat geschrieben:With RS-232 I get the value HEX 16-bit microcontroller input ATMega8.
Please post the code of the ATMega8 ... for us to 'see', what's going on there.
++++++
Gruss/regards IKT
Gruss/regards IKT
-
- Beiträge: 14
- Registriert: Dienstag 25. August 2015, 11:48
- Wohnort: Poland/Bielsko-Biała
- Kontaktdaten:
Re: input HEX to program LED ATMega8 - Help ME
I do not have the source code Atmega.
Atmega sends the states of pins (pinc) in the form of HEX values (FF or 3F or 00 or 01 or 08 etc ....) I need to decode them into such a form that the LEDs in PROFILAB match will enter the Atmega8. When decoded hex (attachment 1 Post) into binary form LEDs light up in a different order (depending on the combination of the input states). They need to map input Atmega8.
This will be the input module in my project.
Atmega sends the states of pins (pinc) in the form of HEX values (FF or 3F or 00 or 01 or 08 etc ....) I need to decode them into such a form that the LEDs in PROFILAB match will enter the Atmega8. When decoded hex (attachment 1 Post) into binary form LEDs light up in a different order (depending on the combination of the input states). They need to map input Atmega8.
This will be the input module in my project.
Re: input HEX to program LED ATMega8 - Help ME
You have to think in hex.
$CNST2 has to be 16
$CNST1 has to be 32
Mike
$CNST2 has to be 16
$CNST1 has to be 32
Mike
-
- Beiträge: 14
- Registriert: Dienstag 25. August 2015, 11:48
- Wohnort: Poland/Bielsko-Biała
- Kontaktdaten:
Re: input HEX to program LED ATMega8 - Help ME
no
Atmega8 send 8 bits.
When you check various combinations of the Windows calculator (bin this hex) results are identical.
Atmega8 send 8 bits.
When you check various combinations of the Windows calculator (bin this hex) results are identical.
Re: input HEX to program LED ATMega8 - Help ME
OK, then use Byte receive (from COM) directly, similar to below: HD4 is the one that is on the left hd. side of HD3 (to display the value correctly)!lukg20 hat geschrieben:Atmega8 send 8 bits.
Bit's 0-3 --> LOW Nibble (00-0F)
Bit's 4-7 --> HIGH Nibble(00-F0)
Zuletzt geändert von IKT am Donnerstag 27. August 2015, 10:57, insgesamt 1-mal geändert.
++++++
Gruss/regards IKT
Gruss/regards IKT
-
- Beiträge: 14
- Registriert: Dienstag 25. August 2015, 11:48
- Wohnort: Poland/Bielsko-Biała
- Kontaktdaten:
Re: input HEX to program LED ATMega8 - Help ME
thank you very much, but it does not help me because I have to use the receiver $ string 232 with one leg
It is also used in other modules (not only input module) Could you try to solve the problem in a different way?
It seems to me that your solution also does not help.
Hex value that was converted into binary as well as at 20 and 10 to two LEDs shining at the same time.
It is also used in other modules (not only input module) Could you try to solve the problem in a different way?
It seems to me that your solution also does not help.
Hex value that was converted into binary as well as at 20 and 10 to two LEDs shining at the same time.
Re: input HEX to program LED ATMega8 - Help ME
I think you didn't read my post.
If you enter 10 into $CNST it will be interpreted as a decimal Number!
Mike
If you enter 10 into $CNST it will be interpreted as a decimal Number!
Mike
Zuletzt geändert von Mike D am Donnerstag 27. August 2015, 11:41, insgesamt 2-mal geändert.
Re: input HEX to program LED ATMega8 - Help ME
You obviously don't understand:
an LED shows exactly the status of one binary line, therefore it is NORMAL that more than one LED is "lit", depending on the value you're "getting in"!
E.g. HEX - 3C means that:
LED 5-8 (bin 4-7) = 3 decimal (HEX=3)
Whole range in decimal is: 0 to 255 or -128 to +127 (HEX: 00 to FF)
an LED shows exactly the status of one binary line, therefore it is NORMAL that more than one LED is "lit", depending on the value you're "getting in"!
E.g. HEX - 3C means that:
- LED 1 = Off
LED 2 = Off
LED 3 = On
LED 4 = On
LED 5 = On
LED 6 = On
LED 7 = Off
LED 8 = Off
LED 5-8 (bin 4-7) = 3 decimal (HEX=3)
Whole range in decimal is: 0 to 255 or -128 to +127 (HEX: 00 to FF)
++++++
Gruss/regards IKT
Gruss/regards IKT
-
- Beiträge: 14
- Registriert: Dienstag 25. August 2015, 11:48
- Wohnort: Poland/Bielsko-Biała
- Kontaktdaten:
Re: input HEX to program LED ATMega8 - Help ME
Mike D - thanks for you
I can not change what sends Atmega ...
It addresses Atmega8 pins.
When preferable to try the calculator windows in turn change his bits, 5 and 6 beating after conversion to hex you hit precisely on the values (10; 20)
it's beyond me .... it's not for me to understand ...
Help!
I can not change what sends Atmega ...
It addresses Atmega8 pins.
When preferable to try the calculator windows in turn change his bits, 5 and 6 beating after conversion to hex you hit precisely on the values (10; 20)
it's beyond me .... it's not for me to understand ...
Help!
Re: input HEX to program LED ATMega8 - Help ME
The problem is not the Atmega program, the problem is your example "HELP ME.prj".
You simulation of the hex input is wrong.
$CNST is to make constant strings, not to make hex values. If you put 10 as string into $CNST and connect it to the anolog input of the A/D, the 10 will be interpreted as a decimal 10, and not as a hex.
Normaly you coudn't connect strings to analog, but PL has an build in auto conversion, HIGH <> 5.00, LOW <> 0.00, and numbers in strings are converted as decimal number.
Have a look at my example hex2.prj from my earlier post.
Mike
You simulation of the hex input is wrong.
$CNST is to make constant strings, not to make hex values. If you put 10 as string into $CNST and connect it to the anolog input of the A/D, the 10 will be interpreted as a decimal 10, and not as a hex.
Normaly you coudn't connect strings to analog, but PL has an build in auto conversion, HIGH <> 5.00, LOW <> 0.00, and numbers in strings are converted as decimal number.
Have a look at my example hex2.prj from my earlier post.
Mike
Re: input HEX to program LED ATMega8 - Help ME
Easy Solution: HEX (String) Input, then converted to DEC (Numeric) then converted to BIN (with A/D converter) ...
see Project below:
see Project below:
- Dateianhänge
-
- HEX_Input(as_String).prj
- (5.08 KiB) 296-mal heruntergeladen
++++++
Gruss/regards IKT
Gruss/regards IKT
-
- Beiträge: 14
- Registriert: Dienstag 25. August 2015, 11:48
- Wohnort: Poland/Bielsko-Biała
- Kontaktdaten:
Re: input HEX to program LED ATMega8 - Help ME
Sorry buddy Mike D. Maybe it looks like I did not pay attention to your posts.
I have a very short ProfiLab (a few days), and just teach him.
Your examples are certainly very clever, but I do not know what they have to pay attention - sorry
Back to the topic....
switches which I used in my example to serve as a simulation of what sends Atmega8 when a signal on one of the port pins C (do not know how otherwise). Thank you, buddy ICT for it that gave me a nice example, but unfortunately in this case does not work Still the problem is not solved
As I mentioned I am building a large project all for free. In Annex I ship ready libraries (you can see how they work). I miss even libraries input modules (I have a problem with them, () and ADC - there will be no easier.
Idea: With my designs contained PCBs and diagrams can easily create each module.
The device will consist of a motherboard and modules that can be connected discretion.
For example:
6 inputs and 6 outputs, or 6 outputs and 6 ADC inputs or outputs 2x 6 (tomorrow photos of finished modules)
He promises that everything you are provided.
Please - give me an example - I am new and do not know enough PROFILAB
As I mentioned received values are the addresses of ports C.
when you use the Windows calculator can be seen as moves to 8 bits and their values in hex they correspond to those which I wrote in the example.
I can not insert pictures (do not know the German language). If not so, please be moderator for help.
I have a very short ProfiLab (a few days), and just teach him.
Your examples are certainly very clever, but I do not know what they have to pay attention - sorry
Back to the topic....
switches which I used in my example to serve as a simulation of what sends Atmega8 when a signal on one of the port pins C (do not know how otherwise). Thank you, buddy ICT for it that gave me a nice example, but unfortunately in this case does not work Still the problem is not solved
As I mentioned I am building a large project all for free. In Annex I ship ready libraries (you can see how they work). I miss even libraries input modules (I have a problem with them, () and ADC - there will be no easier.
Idea: With my designs contained PCBs and diagrams can easily create each module.
The device will consist of a motherboard and modules that can be connected discretion.
For example:
6 inputs and 6 outputs, or 6 outputs and 6 ADC inputs or outputs 2x 6 (tomorrow photos of finished modules)
He promises that everything you are provided.
Please - give me an example - I am new and do not know enough PROFILAB
As I mentioned received values are the addresses of ports C.
when you use the Windows calculator can be seen as moves to 8 bits and their values in hex they correspond to those which I wrote in the example.
I can not insert pictures (do not know the German language). If not so, please be moderator for help.
- Dateianhänge
-
- Biblioteki.rar
- (3.53 KiB) 291-mal heruntergeladen
Re: input HEX to program LED ATMega8 - Help ME
I think the MAIN problem is the language here.lukg20 hat geschrieben:Thank you, buddy ICT for it that gave me a nice example, but unfortunately in this case does not work Still the problem is not solved
Your English is simply not adequate, for us to understand, what you want to tell us.
Get yourself somebody to help you with the english language, so we can understand:
what do you really want to do???
++++++
Gruss/regards IKT
Gruss/regards IKT
-
- Beiträge: 14
- Registriert: Dienstag 25. August 2015, 11:48
- Wohnort: Poland/Bielsko-Biała
- Kontaktdaten:
Re: input HEX to program LED ATMega8 - Help ME
Already too much invested in this project to hire an interpreter;)
I am using "the Google translator"
Does anyone know the Polish language?
I am using "the Google translator"
Does anyone know the Polish language?
Re: input HEX to program LED ATMega8 - Help ME
Google translate (and all the others) are simply crap:
it looks like english, but it is not (english speakers don't understand it).
This is true for any language, not only english ...
Having checked your Macros (specially PortC_Out):
it looks like english, but it is not (english speakers don't understand it).
This is true for any language, not only english ...
Having checked your Macros (specially PortC_Out):
- 1) call it PortC_IN (from a PL point of view it is an Input)
2) use an equal amount of Macro Pin's on both sides (12 total in this case)
3) unused Inputs on components must be grounded (to work properly)
4) commenting what you're doing (helps to find faults)
5) see the modifications I've made and test it ...
- Dateianhänge
-
- PortC_test.prj
- (6.44 KiB) 263-mal heruntergeladen
++++++
Gruss/regards IKT
Gruss/regards IKT
Re: input HEX to program LED ATMega8 - Help ME
Hej lukg20,
what I try to tell you is, that you think wrong in one topik.
The Atmega is sending a hex 10 (dec 16) if only bit 5 is high.
The A/D-Converter sets bit 5 high if you set hex 10 or decimal 16 to its input.
So everything is OK.
The problem is your simulation of the Atmega inputs, because you set there decimal 10 instead of hex 10.
I think you misinterpret the result shown by the windows calculator.
bin hex dec
000000 0 0
000001 1 1
000010 2 2
000100 4 4
001000 8 8
010000 10 16
100000 20 32
Mike
what I try to tell you is, that you think wrong in one topik.
The Atmega is sending a hex 10 (dec 16) if only bit 5 is high.
The A/D-Converter sets bit 5 high if you set hex 10 or decimal 16 to its input.
So everything is OK.
The problem is your simulation of the Atmega inputs, because you set there decimal 10 instead of hex 10.
I think you misinterpret the result shown by the windows calculator.
bin hex dec
000000 0 0
000001 1 1
000010 2 2
000100 4 4
001000 8 8
010000 10 16
100000 20 32
Mike
Re: input HEX to program LED ATMega8 - Help ME
Oh, the solution is so easy.
please enter $10 in $CNST2
and $20 in $CNST1 then your HELP ME.projekt works fine.
The $ makes PL to interpret the values as hex.
Mike
please enter $10 in $CNST2
and $20 in $CNST1 then your HELP ME.projekt works fine.
The $ makes PL to interpret the values as hex.
Mike